gpt4 book ai didi

webdeploy - 自移至VS 2019后无法发布

转载 作者:行者123 更新时间:2023-12-04 14:08:23 24 4
gpt4 key购买 nike

我最近卸载了VS 2017并安装了VS 2019。

当我通过Web Deploy发布网站时,如果失败并显示2条错误消息

Failed to load publish certificate dialog due to error of Object reference not set to an instance of an object. MyWebsite.Ui

Web deployment task failed. (Connected to the remote computer ("example.com") using the specified process ("Web Management Service"), but could not verify the server’s certificate. If you trust the server, connect again and allow untrusted certificates. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#ERROR_CERTIFICATE_VALIDATION_FAILED.)



我对如何解决这个问题一无所知...

编辑

根据评论,存在一个相同的问题,但该问题与Azure有关。我没有连接到任何与Azure相关的内容。我并不是说这使我的问题变得独特,更多的是我不了解原因/解决方案是否相同。 Deploying to Azure from Visual Studio fails when connecting

最佳答案

如果您信任服务器,则可以简单地忽略警告/错误,而直接编辑发布文件

https://stackoverflow.com/a/33662970/3252861

  1. Open the publish profile file (.pubxml) inside /Properties/PublishProfiles in a text editor
  2. Inside the PropertyGroup element, set AllowUntrustedCertificate to True (AllowUntrustedCertificate> True /AllowUntrustedCertificate>) or add it if it doesn't exist
  3. Set UsePowerShell to False (False).


我没有提到第三点,所以我想我以前曾经或不需要

现在,我们可以按照 https://developercommunity.visualstudio.com/content/problem/484286/publish-fails-to-iis-using-msdeploy-webdeploy.html上的建议进行操作,并实际添加以下 2个条目
<UseMSDeployExe>True</UseMSDeployExe>
<AllowUntrustedCertificate>True</AllowUntrustedCertificate>

应该指出的是,有些人报告您只需要使用以下两种之一:
<AllowUntrustedCertificate>True</AllowUntrustedCertificate>

因此, pubxml XML文件的开始现在看起来像
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<UseMSDeployExe>True</UseMSDeployExe>
<AllowUntrustedCertificate>True</AllowUntrustedCertificate>
<WebPublishMethod>MSDeploy</WebPublishMethod>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish />
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<ExcludeApp_Data>True</ExcludeApp_Data>
<MSDeployServiceURL>domain</MSDeployServiceURL>
<DeployIisAppPath>name</DeployIisAppPath>
<RemoteSitePhysicalPath />


关于webdeploy - 自移至VS 2019后无法发布,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56311166/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com