"TransformWebConfig" task could not be loaded
See original GitHub issueWe experience this error when building new VS2017 csproj project with msbuild 2015:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Sdks\Microsoft.NET.Sdk.Publish\build\netstandard1.0\TransformTargets\Microsoft.NET.Sdk.Publish.TransformFiles.targets(54,5): error MSB4062: The "TransformWebConfig" task could not be loaded from the assembly C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Sdks\Microsoft.NET.Sdk.Publish\build\netstandard1.0\..\..\tools\net46\\Microsoft.NET.Sdk.Publish.Tasks.dll. Could not load file or assembly 'file:///C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\Sdks\Microsoft.NET.Sdk.Publish\tools\net46\Microsoft.NET.Sdk.Publish.Tasks.dll' or one of its dependencies. An attempt was made to load a program with an incorrect format. Confirm that the <UsingTask> declaration is correct, that the assembly and all its dependencies are available, and that the task contains a public class that implements Microsoft.Build.Framework.ITask.
Also it seems some other people experience it as well. See https://github.com/Microsoft/msbuild/issues/1010 and http://stackoverflow.com/q/42805862/213725
Issue Analytics
- State:
- Created 6 years ago
- Comments:13 (5 by maintainers)
Top Results From Across the Web
The "TransformWebConfig" task failed unexpectedly - ...
The "TransformWebConfig" task failed unexpectedly - System.Exception: The acceptable value for AspNetCoreModuleHostingModel property is either.
Read more >dotnet publish error - The "TransformWebConfig" task ...
This transformation fails because the web. config is not correct to be used with an in process ASP.NET Core application.
Read more >Publishing ASP.NET Core app from Visual Studio 2022 to ...
When I try to publish my ASP.NET Core app from VS 2022 (latest version) to Azure, the publishing fails in case the projects...
Read more >Running on VSTS an asp.net core sln I got: Error MSB4018
Running on VSTS an asp.net core sln I got: Error MSB4018: The “TransformWebConfig” task failed unexpectedlyClosed - Not a Bug1 6.
Read more >Not able to publish .NET Core Web App to folder with error ...
Not able to publish .NET Core Web App to folder ... TransformFiles.targets(49,5): Error MSB4018: The "TransformWebConfig" task failed unexpectedly. System.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@night-king - The log shows that you have an incorrect configuration setup. You cannot have inprocess hosting with AspNetCoreModule.
Can you add this to the csproj? This should fix the issue.
<AspNetCoreModuleName>AspNetCoreModuleV2</AspNetCoreModuleName>
It may be the same reason for a special case, but same is true for Service Fabric’s *.sfproj projects.