msbuild GenerateDepsFile fails - msbuild

All my projects are not failing to build on my Azure DevOps MacOS build host. It's a self-hosted build host. Suddenly, my projects are throwing this error when trying to build:
error MSB4018: The "GenerateDepsFile" task failed unexpectedly.
error MSB4018: System.MissingMethodException: Method not found: System.Collections.Generic.IList`1<NuGet.Packaging.Core.PackageDependency> NuGet.ProjectModel.LockFileTargetLibrary.get_Dependencies()
I found this GitHub issue which seemed similar, but the posted solution didn't help me:
https://github.com/mono/mono/issues/13537
As mentioned in xamarin/xamarin-android#3155 this is caused by a version mismatch in nuget between msbuild and dotnet core. The solution is to update your dotnet core install to the latest stable version
I've installed the most recent .NET Core, and updated Visual Studio for Mac, but alas, the problem remains.
Another information:
When I build the same Xamarin.iOS project from my Windows machine coupled with the same MacOS build host, the app builds just fine. But I am guessing the process is probably different.

Updating both Visual Studio for Mac and .NET Core SDK again today seems to have fixed the problem.

Related

Trying to execute a program in VS Code, but i keep getting an error

[Running] dotnet run --project "c:\Users\Bloxxel64\CodeProjects\AssetStudio\AssetStudioGUI\AssetStudioGUI.csproj"
C:\Program Files\dotnet\sdk\5.0.403\Microsoft.Common.CurrentVersion.targets(1217,5): error MSB3644: The reference assemblies for .NETFramework,Version=v4.0 were not found. To resolve this, install the Developer Pack (SDK/Targeting Pack) for this framework version or retarget your application. You can download .NET Framework Developer Packs at https://aka.ms/msbuild/developerpacks
The build failed. Fix the build errors and run again.
[Done] exited with code=1 in 3.872 seconds
I've Already installed the latest .NET Framework and SDK but i can't get it to run.
I cannot figure out how to fix this. any advice?
There are helpful links in the microsoft forum Link and StackOverflow Link that have the question on your type Target frameworks are differents.

MsBuild failing for .Net Standard project with error "Package System.Security.Cryptography.ProtectedData, version x.x.x was not found"

Project Setup : Mixed framework solution
.Net Framework 4.6.2 projects in solution : 15
.Net Standard 2.0 projects in solution - 1
Development Machine
Visual Studio 2017(15.7.4) : Builds without any errors
Build Server
TeamCity Version 2017.1.3
Build Steps
Nuget Restore(3.4.4)
dotnet Restore
MSBuild( Build Tools 2017), Tools Version 15.0
Build fails with following error in the .net standard 2.0 project : [ResolvePackageAssets] C:\Program Files\dotnet\sdk\2.1.301\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(198, 5): Package System.Security.Cryptography.ProtectedData, version 4.4.0 was not found. It might have been deleted since NuGet restore. Otherwise, NuGet restore might have only partially completed, which might have been due to maximum path length restrictions.
What's interesting is I can't find reference or use of System.Security.Cryptography.ProtectedData anywhere in the project. Any help is greatly appreciated.
P.S - Can't use dotnet build, as the solution needs building of licenses.licx files, and the component which builds it (Microsoft.Build.Tasks.LC) is not ported to .Net Core. The suggestion from various posts was to use MsBuild.exe

Appveyor CI fails to build a .net core 2.1 solution with a database project

Our .net core 2.1 solution compiles fine on our local development machines with .net core sdk 2.1.301. Appveyor used to compile the solution in its CI pipeline when there was no database projects defined. Once such a project added, Appveyor started failing in building the solution with the error message below. Any clues how to address this issue?
C:\projects\comingsoon\ComsingSoonDatabase\ComsingSoonDatabase.sqlproj(57,3):
error MSB4019: The imported project "C:\Program
Files\dotnet\sdk\2.1.300\Microsoft\VisualStudio\v11.0\SSDT\Microsoft.Data.Tools.Schema.SqlTasks.targets"
was not found. Confirm that the path in the declaration is
correct, and that the file exists on disk.
The database project can only be built using the full framework MSBuild tools included in visual studio.
Depending on how you set up appveyor, you need to change your definition to use msbuild.exe instead of dotnet commands.

.NET 4.5.1 broke MSBUILD

We've been using TeamCity for some time without issues. We went a few weeks without doing builds and our server team installed .NET 4.5.1 on the server. Now all of our builds are breaking.
Here is the command line being ran (edited for privacy):
C:\Windows\Microsoft.NET\Framework64\v4.0.30319>msbuild "C:\programs\TeamCity\bu
ildAgent\work\<path to proj file>.csproj" /t:Package /P:Configuration=Test
Which results in this error:
The target "Package" does not exist in the project.
Lots of results talk about this being a missing visual studio folder named "web" or not having web deploy installed. That is not the case here. Those solutions are not working.

MSBuild error - Solution is of version 12.00 which is not currently supported

I have a Build server which has TFS 2010 Build Service installed. I have 2 Build Agents and 1 Controllers configured. One of our projects have been converted to Visual Studio 2012.
I found out that .NET framework 4.5 comes with new version of MSBuild which is version 4.5.
I installed .NET framework 4.5 on the Build Server because prior to installing it every time the project was built I kept getting the following error:
"Solution is of version '12.00' which is not currently supported".
After installing .NET 4.5, I still run into the same issue.
How could I go about resolving this?
Do I have to configure the Build Agent to use the new MSBuild 4.5 in order to build this particular project or do I set something in the projects solution file itself? If so how?
I would really appreciate if somebody could assist me with this please?
Try install vs2012 on the build server, while i don't believe it's strictly needed it's the easiest way to get all the requirements installed.
We have installed VS2012 on the build agent. Interestingly when I RDC to the build agent and then run msbuild from the command line everything works fine. So the issue looks like it happens before we even get to MSBuild.