Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dotnet build raise error MSB4062: The "Microsoft.CodeAnalysis.BuildTasks.Csc" task could not be loaded from the assembly #1173

Closed
moh-hassan opened this issue Dec 26, 2019 · 2 comments
Labels
area-Infrastructure-libraries untriaged New issue has not been triaged by the area owner

Comments

@moh-hassan
Copy link

Environment
vs2019 v16.4.0 is installed
last netcore 3.1.100 is installed.
Console project.csproj SDK style , net461
reference a class library project netstandard2.0, net461
The class library reference the package: Microsoft.Net.Compilers.Toolset v 3.4.0 to support c# 8 nullable in VS2017 .

Building the project using vs2019 IDE success.
Building the project using msbuild command success.: msbuild /t:build
Building the project using dotnet build fail with the error

error MSB4062: The "Microsoft.CodeAnalysis.BuildTasks.Csc" task could not be loaded from the assembly C:\Program Files\dotnet\sdk\3.1.100\Roslyn\Microsoft.Build.Tasks.CodeAnalysis.dll. Assembly with same name is already loaded Confirm that the 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. [F:\experiment\test.csproj]

Removing the package "Microsoft.Net.Compilers.Toolset and run dotnet build success.

How to stop this error in dotnet build?

@Dotnet-GitSync-Bot Dotnet-GitSync-Bot added area-Infrastructure-libraries untriaged New issue has not been triaged by the area owner labels Dec 26, 2019
@danmoseley
Copy link
Member

Hello @moh-hassan I think this probably should go to https://github.com/dotnet/roslyn. Can you close and reopen there?

@moh-hassan
Copy link
Author

Thanks @danmosemsft for reply.
Moving the question to roslyn project

@ghost ghost locked as resolved and limited conversation to collaborators Dec 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Infrastructure-libraries untriaged New issue has not been triaged by the area owner
Projects
None yet
Development

No branches or pull requests

3 participants