Skip to content
This repository was archived by the owner on Sep 17, 2020. It is now read-only.
This repository was archived by the owner on Sep 17, 2020. It is now read-only.

error MSB4801: The task factory "CodeTaskFactory" is not supported on the .NET Core version of MSBuild #43

@niyatidoshi

Description

@niyatidoshi

Hi Guys,

I'm facing below error when I run command "dotnet test.\SampleAPITest.csproj /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura /p:CoverletOutput="./TestResults/Coverage/" to run test cases.

D:\Projects\VSTS\SampleAPI\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\build\net46\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props(31,5): error MSB4801: The task factory "CodeTaskFactory" is not supported on the .NET Core version of MSBuild. [D:\Projects\VSTS\SampleAPI\SampleAPI\SampleAPI.csproj]

D:\Projects\VSTS\SampleAPI\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.2.0.1\build\net46\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.props(31,5): error MSB4175: The task factory "CodeTaskFactory" could not be loaded from the assembly "C:\Program Files\dotnet\sdk\3.1.300\Microsoft.Build.Tasks.Core.dll". The task factory must return a value for the "TaskType" property. [D:\Projects\VSTS\SampleAPI\SampleAPI\SampleAPI.csproj]

Below are the project details:

Projects are based on .Net Framework 4.7.2

  1. SampleAPI (WebAPI)
  2. SampleAPI.Test (Test Project)
    Project contains reference of "SampleAPI" - to write the test cases of Controller.

Other details:

  • To generate code coverage and reports, I've added reference of Coverlet in the test project.
  • Added MSBuild.Microsoft.VisualStudio.Web.targets in WebAPI project.
  • Already added "RoslynCodeTaskFactory" 2.0.7

Could you please guide me how to resolve the error?

Thanks,
Niyati

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions