我嘗試發佈ASP.NET Core Web項目到IIS(遠程服務器)使用非管理員帳戶使用Visual Studio 2017年,我有上部署了以下錯誤:如果用戶是非管理員,而同一用戶可用於在同一Web服務器上進行VS2015 Web發佈,則Visual Studio 2017 Web發佈將失敗
Starting Web deployment task from source: manifest(D:\Projects\Own\AspNetCore\CoreWithAngularTrial\CoreWithAngularTrialApi\obj\Debug\netcoreapp1.1\PubTmp\CoreWithAngularTrialApi.SourceManifest.xml) to Destination: auto(). C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\Sdks\Microsoft.NET.Sdk.Publish\build\netstandard1.0\PublishTargets\Microsoft.NET.Sdk.Publish.MSDeploy.targets(134,5): Error : Web deployment task failed. (Connected to the remote computer ("...") using the Web Management Service, but could not authorize. Make sure that you are using the correct user name and password, that the site you are connecting to exists, and that the credentials represent a user who has permissions to access the site. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_USER_UNAUTHORIZED .) Make sure the site name, user name, and password are correct. If the issue is not resolved, please contact your local or server administrator. Error details: Connected to the remote computer ("...") using the Web Management Service, but could not authorize. Make sure that you are using the correct user name and password, that the site you are connecting to exists, and that the credentials represent a user who has permissions to access the site. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_USER_UNAUTHORIZED . The remote server returned an error: (401) Unauthorized. Publish failed to deploy.
我已經部署了以下配置:
Publish method = Web deploy
Server = servername:8172/msdeploy.axd
Site name = Default Web Site/CoreWithAngularTestApi
User name = username
Password = ******
發佈時完全相同的配置工作不同的應用(ASP.NET MVC 5)在同一Web站點(默認Web站點)下,因此發佈配置在遠程服務器上顯示爲正確。
製作username
本地管理員放開出版過程在Visual Studio 2017年
而且,發佈配置文件(* .pubxml)幾乎是一樣的。遠程服務器上
事件查看器捕獲以下錯誤:
IISWMSVC_AUTHORIZATION_SERVER_NOT_ALLOWED
Only Windows Administrators are allowed to connect using a server connection. Other users should use the 'Connect To Site or Application' task to be able to connect.
Process:WMSvc User=username
問:我怎樣才能使非政府網上發佈從Visual Studio 2017年?