PVB
PVB

Reputation: 81

Error MSB4019 with visual studio for Mac

With visual studio for Mac

/Users/piyushbhatt/Projects/myfmf/FMF/FMF.Web/fmf.Web.csproj(3,3): Error MSB4019: The imported project "/Library/Frameworks/Mono.framework/Versions/5.0.0/lib/mono/xbuild/Microsoft/VisualStudio/v15.0/WebApplications/Microsoft.WebApplication.targets" was not found. Confirm that the path in the declaration is correct, and that the file exists on disk. (MSB4019) (FindMeFood.Web)

Upvotes: 8

Views: 7026

Answers (5)

geekyj
geekyj

Reputation: 401

I also ran into this exact same issue for Mac without realizing this thread is already resolved when I open my question. Where the only delta is that I am using Visual Studio 2022 for Mac v17.5.2 (build 14) and Mongo project for Visual Studio for Mac 6.12.0 Stable (6.12.0.182).

It turns out that you don't need to hunt down any additional installer, because the WebApplication runtime hasn't changed over the last few years. Just follow @fwan answer solution. That resolved my issue.

Below you can also see the md5 sum of the file is exactly identical.

$ cd /Library/Frameworks/Mono.framework/Versions/6.12.0/lib/mono/xbuild/Microsoft/VisualStudio

MD5 (./v10.0/WebApplications/Microsoft.WebApplication.targets) = 3c0175c55c0a28ddbfc9cce04971fd8a
MD5 (./v11.0/WebApplications/Microsoft.WebApplication.targets) = 3c0175c55c0a28ddbfc9cce04971fd8a
MD5 (./v12.0/WebApplications/Microsoft.WebApplication.targets) = 3c0175c55c0a28ddbfc9cce04971fd8a
MD5 (./v14.0/WebApplications/Microsoft.WebApplication.targets) = 3c0175c55c0a28ddbfc9cce04971fd8a
MD5 (./v15.0/WebApplications/Microsoft.WebApplication.targets) = 3c0175c55c0a28ddbfc9cce04971fd8a
MD5 (./v16.0/WebApplications/Microsoft.WebApplication.targets) = 3c0175c55c0a28ddbfc9cce04971fd8a
MD5 (./v17.0/WebApplications/Microsoft.WebApplication.targets) = 3c0175c55c0a28ddbfc9cce04971fd8a
MD5 (./v9.0/WebApplications/Microsoft.WebApplication.targets) = 3c0175c55c0a28ddbfc9cce04971fd8a

Upvotes: 0

fwan
fwan

Reputation: 43

For reference Shine's answer works for future versions of Mono as well.

Just navigate to /Library/Frameworks/Mono.framework/Versions/5.0.0/lib/mono/xbuild/Microsoft/VisualStudio/

Here will be a list of versions. Your error message will say which version is missing web targets. In this case it's v15.0. In my case it was v17.0 In any case, open the previous version and copy only the folder "WebApplications" and paste it in the folder for the version that you are having the error for.

Upvotes: 2

shine
shine

Reputation: 678

You can copy the WebApplications folder from /Library/Frameworks/Mono.framework/Versions/5.0.0/lib/mono/xbuild/Microsoft/VisualStudio/v14.0 to v15.0 to fix it.

Upvotes: 14

Simon Balarabe
Simon Balarabe

Reputation: 1

Seems to be missing from the mono5 package. Report the bug

@https://bugzilla.xamarin.com/

I tried to copy the files manually from the 14 folder, but ended up running into other problems.

Upvotes: 0

Related Questions