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

泪湿孤枕 提交于 2019-12-05 06:01:25

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.

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.

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

<Import Project="$(MSBuildExtensionsPath)\Microsoft\VisualStudio\v9.0\WebApplications\Microsoft.WebApplication.targets" />

I know this is an old question, but it came up when searching for how to use WebApplications.targets on OSX, so it's still worth answering. With the current version of Mono (5.x), Webapplication.targets is included, so now all you have to do, is to set the VSToolsPath, and everything should just work.

If you are using standard bash shell, the .profile file is the place to put it:

export VSToolsPath=/Library/Frameworks/Mono.framework/Versions/Current/lib/mono/xbuild/Microsoft/VisualStudio/v15.0/
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!