Reputation: 5596
I have asp.net web api application targeting 4.5 framework.
I am trying to create a docker image for my application. In order to build the application, I can use MSBuild.exe available in C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe
or C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe
locations.
When I build using C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe
location, I get error saying "
C:\MyApp-Api\MyApp-Api.csproj(985,3)
: error MSB4019: The imported project "C:\Program Files (x86)\MSBuild\Microsoft
\VisualStudio\v11.0\WebApplications\Microsoft.WebApplication.targets" was not f
ound. Confirm that the path in the declaration is correct, and that th
e file exists on disk."
I am able to build my application using C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe
location.
Questions:
C:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe
location is the right approach as it comes with default location and I think MSBuild in program files comes due to installation of Visual Studio. and on my Build server I will not have visual studio installed.
Upvotes: 0
Views: 5241
Reputation: 431
I was browsing web with a similar query today and stumbled upon this random link to a Veracode extension which lists nicely the difference.
The first two paths below that contain Professional differ based on the edition of Visual Studio you have installed. Replace Professional with Enterprise or Community, when appropriate.
Note: the Visual Studio Preview install also changes the path based on Enterprise, Professional, or Community.
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin\amd64\
C:\Program Files (x86)\Microsoft Visual Studio\Preview\Professional\MSBuild\15.0\Bin
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\
C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin\amd64\
C:\Program Files (x86)\MSBuild\14.0\Bin\ C:\Program Files (x86)\MSBuild\14.0\Bin\amd64\
C:\Program Files (x86)\MSBuild\12.0\Bin\ C:\Program Files (x86)\MSBuild\12.0\Bin\amd64\
C:\Windows\Microsoft.NET\Framework\v4.0.30319\ C:\Windows\Microsoft.NET\Framework64\v4.0.30319\
It seems like you have both VS2012 and VS2015 installed. I dont know much about ASP.NET and docker but will try to answer your questions:
If you dont mind me asking - Why not switching to ASP.NET Core ?
Upvotes: 3