[英]VS.NET 2015 ENT Web Deploy ASP.NET Core 1 error ERROR_USER_UNAUTHORIZED?
I have set a web deploy on a local Windows 2012 server with a new Site. 我已在具有新站点的本地Windows 2012服务器上设置了Web部署。
I have set permissions to Administrator at IIS server level and at the Site level thru IIS Manager Permissions. 我已在IIS服务器级别和站点级别通过IIS管理器权限设置管理员权限。
I have created an Application Pool and a Virtual Directory for MySiteApp. 我为MySiteApp创建了一个应用程序池和一个虚拟目录。
My Web Deploy publish settings at VS.NET 2015: My Web Deploy在VS.NET 2015上发布设置:
Server: 192.168.45.60 Site name: TestSite/MySiteApp User name: TESTSERVER\\Administrator
服务器:192.168.45.60站点名称:TestSite / MySiteApp用户名:TESTSERVER \\ Administrator
Validate Connection on publish profile pass ok. 验证发布配置文件上的连接传递确定。
Added True to .pubxml 添加True到.pubxml
When trying to Publish to server I am receiving the error: 尝试发布到服务器时,我收到错误:
Error Error: The remote server returned an error: (401) Unauthorized.
错误错误:远程服务器返回错误:(401)未经授权。 Error Code: ERROR_USER_UNAUTHORIZED
错误代码:ERROR_USER_UNAUTHORIZED
At Windows Server 2012 event viewer I can see this error: 在Windows Server 2012事件查看器中,我可以看到此错误:
IISWMSVC_LOGIN_UNKNOWN_ERROR IISWMSVC_LOGIN_UNKNOWN_ERROR
An unexpected error occurred while retrieving the login information. 检索登录信息时发生意外错误。
Exception:System.Runtime.InteropServices.COMException (0x8007000D): Invalid site name
异常:System.Runtime.InteropServices.COMException(0x8007000D):站点名称无效
at Microsoft.Web.Administration.Interop.IAppHostProperty.set_Value(Object value) at Microsoft.Web.Administration.ConfigurationElementCollectionBase`1.FindElementWithCollectionKey(String elementName, String collectionKey, Object value) at Microsoft.Web.Administration.SiteCollection.get_Item(String name) at Microsoft.Web.Management.Server.ApplicationManagementUnit.EnsureDefinition() at Microsoft.Web.Management.Server.ApplicationManagementUnit..ctor(IManagementContext context, String siteName, String applicationPath) at Microsoft.Web.Management.Server.WebManagementHttpModule.CreateManagementUnit(HttpRequest request) at Microsoft.Web.Management.Server.WebManagementHttpModule.OnApplicationPostAuthorizeRequest(Object sender, EventArgs e)
Microsoft.Web.Administration.SiteCollection.get_Item(String)上的Microsoft.Web.Administration.Interop.IAppHostProperty.set_Value(Object value)at Microsoft.Web.Administration.ConfigurationElementCollectionBase`1.FindElementWithCollectionKey(String elementName,String collectionKey,Object value)在Microsoft.Web.Management.Server.WebManagementHttpModule的Microsoft.Web.Management.Server.ApplicationManagementUnit..ctor(IManagementContext context,String siteName,String applicationPath)上的Microsoft.Web.Management.Server.ApplicationManagementUnit.EnsureDefinition()处。 Microsoft.Web.Management.Server.WebManagementHttpModule.OnApplicationPostAuthorizeRequest(Object sender,EventArgs e)中的CreateManagementUnit(HttpRequest请求)
Process:WMSvc User=TESTSERVER\\Administrator
进程:WMSvc User = TESTSERVER \\ Administrator
If I am changing at .pubxml as follows: 如果我在.pubxml更改如下:
<MSDeployPublishMethod>WMSVC</MSDeployPublishMethod>
to <MSDeployPublishMethod>WMSVC</MSDeployPublishMethod>
to
<MSDeployPublishMethod>RemoteAgent</MSDeployPublishMethod>
and add <AuthType>NTLM</AuthType>
并添加
<AuthType>NTLM</AuthType>
then I am able to publish with no problems. 然后我就可以毫无问题地发布了。
I guess something I did not setup correctly for publishing with WMSVC. 我想我没有正确设置WMSVC发布的东西。
Thanks for any help. 谢谢你的帮助。
Asaf 阿萨夫
I found that the Powershell script for .NET core was messing up the site URL. 我发现.NET核心的Powershell脚本搞乱了网站URL。 It was appending the publish site to the server URL but also including it in the destinationmanifest.xml file it was generating, so in effect it was trying to publish eg to "my_site/my_app" on "my_server" as " https://my_server:8172/msdeploy.axd?site=my_site/my_site/my_app ".
它将发布站点附加到服务器URL,但也将其包含在它生成的destinationmanifest.xml文件中,因此实际上它尝试将“my_server”上的“my_site / my_app”发布为“ https:// my_server” :8172 / msdeploy.axd?site = my_site / my_site / my_app “。
I read through the new publish-module.psm1 script and found that there's an attribute for the publish profile that keeps it from doing this duplication. 我阅读了新的publish-module.psm1脚本,发现发布配置文件有一个属性可以阻止它进行重复。
<UseMSDeployServiceURLAsIs>True</UseMSDeployServiceURLAsIs>
Others had reported they had to include the following, but I didn't (although our server does have a signed certificate for WMSVC, ymmv): 其他人报告说他们必须包括以下内容,但我没有(尽管我们的服务器确实有WMSVC的签名证书,ymmv):
<AllowUntrustedCertificate>True</AllowUntrustedCertificate>
<AuthType>NTLM</AuthType>
Ultimately my (rinsed) .pubxml file looks like: 最终我的(冲洗).pubxml文件看起来像:
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WebPublishMethod>MSDeploy</WebPublishMethod>
<ADUsesOwinOrOpenIdConnect>False</ADUsesOwinOrOpenIdConnect>
<LastUsedBuildConfiguration>Debug</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish />
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<ExcludeApp_Data>False</ExcludeApp_Data>
<PublishFramework>netcoreapp1.1</PublishFramework>
<UsePowerShell>True</UsePowerShell>
<EnableMSDeployAppOffline>True</EnableMSDeployAppOffline>
<MSDeployServiceURL>https://MYSERVER:8172/msdeploy.axd</MSDeployServiceURL>
<DeployIisAppPath>MYSITE/MYAPP</DeployIisAppPath>
<RemoteSitePhysicalPath />
<SkipExtraFilesOnServer>True</SkipExtraFilesOnServer>
<MSDeployPublishMethod>WMSVC</MSDeployPublishMethod>
<EnableMSDeployBackup>True</EnableMSDeployBackup>
<UserName>mydomain\myusername</UserName>
<_SavePWD>False</_SavePWD>
<UseMSDeployServiceURLAsIs>True</UseMSDeployServiceURLAsIs>
</PropertyGroup>
</Project>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.