Friday, May 4, 2018

Need help - Building normal .Net project with MSBuild 15 which ships with Visual Studio 2017

I have a project which is currently in .Net version 4.5.1 and it has normal .Net project structure.

I am trying to build this project using Jenkins on a Windows agent where only VS 2017 is installed.

I am building this project using MSBuild 15 which ships with VS 2017, which is at the location - C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe

But I am facing error -

error MSB3644: The reference assemblies for framework ".NETFramework,Version=v4.5.1" were not found. To resolve this, install the SDK or Targeting Pack for this framework version or retarget your application to a version of the framework for which you have the SDK or Targeting Pack installed. Note that assemblies will be resolved from the Global Assembly Cache (GAC) and will be used in place of reference assemblies. Therefore your assembly may not be correctly targeted for the framework you intend.

As per my understanding, as my project does not have sdk based structure - it is not building the solution and due to that, I will force the admin to install VS 2015 on the windows agent OR I need to restructure all my project to sdk based structure as per this post -

https://www.natemcmaster.com/blog/2017/03/09/vs2015-to-vs2017-upgrade/

OR is there any better way to handle this situation?

Need help - Building normal .Net project with MSBuild 15 which ships with Visual Studio 2017 Click here
  • Blogger Comment
  • Facebook Comment

0 comments:

Post a Comment

The webdev Team