I'm getting the following message when I trigger a build on check-in to Visual Studio Online. Locally it compiles and deploys just fine.
packages\Microsoft.Net.Compilers.1.0.0\tools\Microsoft.CSharp.Core.targets (67, 5)
To be more precise, this is the problem being described.
The "Microsoft.CodeAnalysis.BuildTasks.Csc" task could not be loaded from the assembly C:\a\1\s\packages\Microsoft.Net.Compilers.1.0.0\build..\tools\Microsoft.Build.Tasks.CodeAnalysis.dll. Could not load file or assembly 'file:///C:\a\1\s\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.
So, evidently, I have some locally placed files making the compilation work on site (i.e. my machine) but those aren't deployed using check-in. I haven't put in any DLLs or such manually into my project. Everything that's there is either source code based or obtained with the package manager.
That poses the following issues.
The settings in the build step are as follows.
This issue usually occurs when the nuget packages are checked in to Version Control. Delete the packages folder in Version Control, and make sure the "packages.config" file is checked in to Version Control. Then queue a new build.
It turns out that NuGet packages were committed to the repository and breaking everything. Deleting the project\project\packages directory from the repo solved all build problems since NuGet fetches the packages automatically on build.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With