Mono / Ubuntu SLN Building

I am trying to create my SLN on Ubuntu using Mono / xbuild

I started getting errors related to the lack of webapplication.targets, and thought I fixed it by adding simlink as in Webapplication.targets, which was missing when creating the MVC4 project in MonoDevelop on OS X 10.7.4

But now I get errors related to: error: error initializing the task Error: the file or assembly "Microsoft.Build.Tasks.v4.0" or one of its dependencies could not be loaded.

Are there any special steps I need to take to get this to work? Do I need a specific version of Mono?

[UPDATE]

This seems to be a problem with the Nuget step:

azureuser@scratchpad :~/test-api/src/Model$ xbuild Model.csproj XBuild Engine Version 12.0 Mono, Version 3.2.8.0 Copyright (C) 2005-2013 Various Mono authors Build started 8/4/2014 11:29:09 AM. __________________________________________________ Project "/home/azureuser/test-api/src/Model/Model.csproj" (default target(s)): Target EnsureNuGetPackageBuildImports: : error : Error initializing task Error: Could not load file or assembly 'Microsoft.Build.Tasks.v4.0' or one of its dependencies. The system cannot find the file specif ied. Task "Error" execution -- FAILED Done building target "EnsureNuGetPackageBuildImports" in project "/home/azureuser/test-api/src/Model/Model.csproj".-- FAILED Target _RecordCleanFile: : error : Error initializing task ReadLinesFromFile: Could not load file or assembly 'Microsoft.Build.Tasks.v4.0' or one of its dependencies. The system cannot find the file specified. Task "ReadLinesFromFile" execution -- FAILED Done building target "_RecordCleanFile" in project "/home/azureuser/test-api/src/Model/Model.csproj".-- FAILED Done building project "/home/azureuser/test-api/src/Model/Model.csproj".-- FAILED Build FAILED. Errors: /home/azureuser/test-api/src/Model/Model.csproj (default targets) -> (EnsureNuGetPackageBuildImports target) -> : error : Error initializing task Error: Could not load file or assembly 'Microsoft.Build.Tasks.v4.0' or one of its dependencies. The system cannot find the fil e specified. /home/azureuser/test-api/src/Model/Model.csproj (default targets) -> /usr/lib/mono/4.5/Microsoft.Common.targets (_RecordCleanFile target) -> : error : Error initializing task ReadLinesFromFile: Could not load file or assembly 'Microsoft.Build.Tasks.v4.0' or one of its dependencies. The system cannot find the file specified. 0 Warning(s) 2 Error(s) Time Elapsed 00:00:00.3989900 
+6
source share
1 answer

I ran into the same issue on Debian Jessie. The β€œhint” from knocte was correct. Version 3.2.8 mono is not enough. I installed the latest version following the instructions on the monoproject site . and it works.

So I did:

 #add the Mono Project GPG signing key as trusted apt-key adv --keyserver pgp.mit.edu --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF #add their pacages repository to apt sources echo "deb http://download.mono-project.com/repo/debian wheezy main" > /etc/apt/sources.list.d/mono-xamarin.list #refresh package list apt-get update #install newer mono & friends apt-get install mono-devel 

and then my previously failed xbuild worked.

 mono --version 3.10.0 xbuild /version XBuild Engine Version 12.0 
+11
source

Source: https://habr.com/ru/post/973309/


All Articles