Search code examples
asp.net-corenugetasp.net-core-mvcvisual-studio-2017.net-standard-2.0

Add project reference with specific version in VS 2017


Is it possible to add a version to the ProjectReference in VS 2017?

I've tried building like so: <ProjectReference Include="..\Project2\Project2.csproj" Version="1.0.1.4" />

But the version of that assembly falls back down to 1.0.1.3 after building.

Some additional info:

in the .nuspec file that gets generated on build, it contains a reference to the old version <dependency id="Project2" version="1.0.1.3" exclude="Build,Analyzers" /> even though that is not the current version, and even if i edit the .nuspec manually, it goes back to 1.0.1.3 on the next build


Solution

  • Thanks to @MartinUllrich for pointing out that i need to run a dotnet restore. I somehow thought i had done that but that was the culprit the whole time.