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:
- What is the difference between the MsBuild.Exe available in these two folders?
- Ideally I think using
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.- In order to build the application on container, I need to specify SDK which will allow me to build the application. Which version of SDK, I need to build .net 4.5 application.