'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). 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.
It's a .NET 6.0 web api project.
In the Output window I can see these 2 errors:
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. 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; it removes the KillAppInsideContainer error but not the other one.
Any help appreciated! Thanks
Solution 1:[1]
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
Solution 2:[2]
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.
Solution 3:[3]
Remove package Microsoft.VisualStudio.Containers.* || Microsoft.VisualStudio.azure.Containers.*
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | buginbox |
| Solution 2 | Eike |
| Solution 3 | Peter Csala |
