2017-06-02 17 views
0

我尝试发布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年?

回答

0

我设法弄清楚为什么发布与非管理员用户失败。服务器设置是正确的,但Visual Studio发布似乎将ASP.NET Core Web应用程序部署与ASP.NET MVC 5不同。

我必须在发布配置文件xml文件中明确指定网站名称。因此,而不是:

<MSDeployServiceURL>servername:8172/msdeploy.axd</MSDeployServiceURL> 

我把

<MSDeployServiceURL>servername:8172/msdeploy.axd?Site=Default Web Site</MSDeployServiceURL> 

注:发布中VS2017的MVC 5项目时,不会发生此问题。

相关问题