[英]In Visual Studio 2022, publish to IIS returns a build error, but publish to Folder is ok (and it was all working fine before)
I've updated Visual Studio 2022 to 17.1.0 recently and I now have this weird error, but not on every project (on only one up to now).我最近将 Visual Studio 2022 更新到 17.1.0,现在我遇到了这个奇怪的错误,但不是在每个项目上(到目前为止只有一个)。 I've tested other projects and they still work fine.
我已经测试了其他项目,它们仍然可以正常工作。
But this one project won't publish to IIS. It builds/runs locally, it can publish to a Folder profile, and a previous version is working in IIS.但是这个项目不会发布到 IIS。它在本地构建/运行,它可以发布到文件夹配置文件,并且以前的版本在 IIS 中运行。
It's a .NET 6.0 web api project.这是一个 .NET 6.0 web api 项目。
In the Output window I can see these 2 errors:在 Output window 我可以看到这两个错误:
Error CTC1000: Method not found: 'Void Microsoft.VisualStudio.Containers.Tools.Shared.Functions.AzureFunctionsFeedDataProvider..ctor(Microsoft.VisualStudio.Containers.Tools.Common.Services.Logging.ILoggingService)'.
Error MSB4018: The "KillAppInsideContainer" task failed unexpectedly.
But I'm not deploying on Azure and I'm not deploying on a container.但我没有在 Azure 上部署,也没有在容器上部署。 The project was set up for Docker use but I commented out the
<DockerDefaultTargetOS>
part of the.csproj and excluded the dockerfile
from the project to test if it impacted the resut;该项目设置为 Docker 使用,但我注释掉了 the.csproj 的
<DockerDefaultTargetOS>
部分,并从项目中排除了dockerfile
以测试它是否影响了结果; it removes the KillAppInsideContainer
error but not the other one.它删除了
KillAppInsideContainer
错误,但没有删除另一个错误。
Any help appreciated!任何帮助表示赞赏! Thanks
谢谢
To solve this publishing issue, I came back from Microsoft.VisualStudio.Azure.Containers.Tools.Targets version 1.14.0 to version 1.11.1 from nuget packages为了解决这个发布问题,我从Microsoft.VisualStudio.Azure.Containers.Tools.Targets版本1.14.0回到版本1.11.1从 nuget 包
I suddenly had the same problem today and could get rid of it by upgrading Microsoft.VisualStudio.Azure.Containers.Tools.Targets from 1.14.0 to 1.15.1 .我今天突然遇到了同样的问题,可以通过将 Microsoft.VisualStudio.Azure.Containers.Tools.Targets 从1.14.0升级到1.15.1来摆脱它。
Remove package Microsoft.VisualStudio.Containers.* || Microsoft.VisualStudio.azure.Containers.*
For what it's worth, this is what I had to do on my PC:对于它的价值,这是我必须在我的电脑上做的:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.