Home > database >  The reference assemblies for .NETFramework,Version=v4.8 were not found
The reference assemblies for .NETFramework,Version=v4.8 were not found

Time:07-05

I get the following error when publishing my web app to a local folder.

The reference assemblies for .NETFramework,Version=v4.8 were not found

I checked the registry and I do have 4.8 installed. Visual Studio Enterprise specifically recommended to me, upon opening the solution that, that I should update the target framework to 4.8 and I agreed.

VS then set the compilation targetFramework attribute to 4.8 (from 4.0)

CodePudding user response:

I double-checked my installation of visual studio. I opened visual studio installer and it said there was an update. I applied the update, which took a long time. I opened the solution again, published, and viola! I'm not sure what happened, but that fixed it.

CodePudding user response:

The solution which worked for me was to add FrameworkPathOverride as a parameter along with your MSBuild commands.

So basically the command would look like this:

bat ‘”C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe” MySolutionName.sln /p:Configuration=Debug /p:Platform=\”Any CPU\” –p:FrameworkPathOverride=”C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5″‘

Notes:

  1. Make sure you have the required SDK installed on your agent and if not then install it first, no need to install the whole VS 2015 – just SDK should work
  2. Note that the path may change in your case. I just paste the path which worked for me
  3. Also, this is not a full and final solution to allow your regular .Net project to build with the latest VS 2017 tooling, it is just a solution to the above error
  • Related