I am trying to build an existing ASP.NET solution on Mono using xbuild, and among the errors I am getting, this is the first one (trimmed and formatted to fit):
MyProj/OrderQueueJob/OrderQueueJob.csproj: error :
MyProj/OrderQueueJob/OrderQueueJob.csproj:
../packages/Microsoft.Web.WebJobs.Publish.1.0.2/tools/webjobs.targets:
Project file could not be imported, it was being imported by
MyProj/OrderQueueJob/OrderQueueJob.csproj:
MyProj/packages/Microsoft.Web.WebJobs.Publish.1.0.2/tools//webjobs.console.targets:
Project file could not be imported, it was being imported by
MyProj/packages/Microsoft.Web.WebJobs.Publish.1.0.2/tools/webjobs.targets:
MyProj/packages/Microsoft.Web.WebJobs.Publish.1.0.2/tools/webjobs.console.targets
could not import "$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets"
I am relatively unknowing as to what goes into building .NET projects, but it seems clear that the VSToolsPath
seems to be unset, so that the referenced files (targets?) cannot be found. When googling this I only came upon older answers that mentioned that in some (now old) versions of Mono you needed to copy this folder from one location to the next - what seemed to be a simple omission. The weird thing is that I seem to have this folder in the file system, yet it cannot be found!
$ find /usr/local/Cellar/mono -iregex '.*VisualStudio.*Microsoft.WebApplication.targets'
/usr/local/Cellar/mono/4.2.2.30/lib/mono/xbuild/Microsoft/VisualStudio/v10.0/WebApplications/Microsoft.WebApplication.targets
/usr/local/Cellar/mono/4.2.2.30/lib/mono/xbuild/Microsoft/VisualStudio/v11.0/WebApplications/Microsoft.WebApplication.targets
/usr/local/Cellar/mono/4.2.2.30/lib/mono/xbuild/Microsoft/VisualStudio/v9.0/WebApplications/Microsoft.WebApplication.targets
What gives?
Obviously "MyProj" above is a trimmed down version of a longer file path such as /Users/John.Smith/projects/MyProj/
.