Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Webapplication.targets missing when building a MVC4 project in MonoDevelop on OS X 10.7.4

I am trying to build a test MVC4 project on OS X 10.7.4 using Mono 2.10.9. I created a new empty MVC4 web application in Visual Studio used git to transfer the source code from Windows to Mac OS X. I then ran xbuild for .nuget package restore, but when I build in monodevelop I get a weird error:

/Users/tamasnagy/Developer/Spellbound/Spellbound/Spellbound.csproj: Error: /Library/Frameworks/Mono.framework/Versions/2.10.9/lib/mono/xbuild/Microsoft/VisualStudio/v10.0/WebApplications/Microsoft.WebApplication.targets: Project file could not be imported, it was being imported by /Users/tamasnagy/Developer/Spellbound/Spellbound/Spellbound.csproj: Imported project: "/Library/Frameworks/Mono.framework/Versions/2.10.9/lib/mono/xbuild/Microsoft/VisualStudio/v10.0/WebApplications/Microsoft.WebApplication.targets" does not exist. (Spellbound)

What could this mean? This also happens when I simply create a new MVC project in MonoDevelop and press build. Any ideas?

like image 213
tamaslnagy Avatar asked May 13 '12 21:05

tamaslnagy


3 Answers

Create a symlink:

cd /usr/lib/mono/xbuild/Microsoft/VisualStudio/v9.0

ln -s v9.0 v10.0

I have the same exact ubuntu 12.04 distro on two different computers and could not figure out why mono would compile on one computer and not the other. But oh well, symlink solved the problem.

like image 65
don.najd Avatar answered Oct 23 '22 07:10

don.najd


Change your csproj file to import v9.0, as so...

<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v9.0\WebApplications\Microsoft.WebApplication.targets" />
like image 38
Patrick McEvoy Avatar answered Oct 23 '22 07:10

Patrick McEvoy


Mono's MSBuild implementation (xbuild) does not have an implementation of the targets for ASP.NET projects.

You might be able to build in MonoDevelop. Make sure you have the experimental xbuild integration turned off in MonoDevelop preferences.

like image 1
Mikayla Hutchinson Avatar answered Oct 23 '22 08:10

Mikayla Hutchinson