Reputation: 185
In VS2019, I have MVC dotnet framework project and while doing dotnet build got the issue
error MSB4801: The task factory "CodeTaskFactory" is not supported on the .NET Core version of MSBuild
error MSB4175: The task factory "CodeTaskFactory" could not be loaded from the assembly "C:\Program Files\dotnet\sdk\3.1.201\Microsoft.Build.Tasks.Core.dll".
Upvotes: 8
Views: 6293
Reputation: 67
Comment this lines on your csproj:
<Target Name="PreBuild" BeforeTargets="PreBuildEvent">
<EnvVarSet VarName="DOTNET_HOST_PATH" VarValue="dotnet" />
</Target>
<!-- <Target Name="PreBuild" BeforeTargets="PreBuildEvent">
<EnvVarSet VarName="DOTNET_HOST_PATH" VarValue="dotnet" />
</Target> -->
Upvotes: -1