8

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".
Kissaki
  • 8,810
  • 5
  • 40
  • 42
Himan
  • 125
  • 3
  • 12
  • ref: https://github.com/aspnet/RoslynCodeDomProvider/issues/51 , adding the target does not solve the problem, actually the project is not ref pacakges.config at all and here need to change a whole csproj file how to do it – Himan May 03 '20 at 05:22

1 Answers1

-1

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> -->
Ale Caro
  • 57
  • 1
  • 7