BuildTasks.Csc task could not be loaded from the a

2019-01-21 18:13发布

I feel guilty asking a question like this around here, but I'm at a loss and would appreciate some help.

A proof-of-concept like web application was built on one PC and put up on a repo to download on another PC at a different location. There was originally an auto-build feature set up where Azure would build and publish automatically on check-in, but that was removed. Things were working on both ends until one side included a bulk of excluded changes. Now I'm seeing the following error:

The "Microsoft.CodeAnalysis.BuildTasks.Csc" task could not be
loaded from the assembly ...\packages\Microsoft.Net.Compilers.1.0.0\build..\tools\Microsoft.Build.Tasks.CodeAnalysis.dll. Could not load file or assembly 'file:///...\packages\Microsoft.Net.Compilers.1.0.0\tools\Microsoft.Build.Tasks.CodeAnalysis.dll' or one of its dependencies. The system cannot find the file specified. 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.

Does anyone have any suggestions on where to begin looking for the issue?

16条回答
时光不老,我们不散
2楼-- · 2019-01-21 18:55

I just tried this on a clean install of a Windows 10 machine and the issue for me ended up being that I didn't have the .NET 3.5 framework installed. This stackoverflow question helps explain why.

Cannot build WIX project on windows 10

查看更多
SAY GOODBYE
3楼-- · 2019-01-21 18:55

Deleting the bin folder worked for me

查看更多
一夜七次
4楼-- · 2019-01-21 18:56

I have tried all solutions described before, but none worked.

What solved it for me, was to update the Microsoft.Net.Compilers from the NuGet Package Manager

查看更多
The star\"
5楼-- · 2019-01-21 18:56

Re-build, clean solution and restart Visual Studio worked for me.

查看更多
登录 后发表回答