question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Do current NBGV versions work with old csproj files?

See original GitHub issue
  • Created a new Framework console app project in VS2017 targeting net462 (old-style csproj, not SDK)
  • Did nbgv install (v.2.3.38)
  • Deleted the version info from AssemblyInfo.cs
  • Committed everything
  • Ran msbuild.

I did not see any any version info embedded in the exe. Is this a known issue? Does Directory.build.props not get picked up by msbuild for old-style csproj files?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
AArnottcommented, Dec 22, 2018

Ah, I suspect you’re right on all of it. I think I can expound on part of it: the old style csproj projects are opened by the csproj.dll project system, which isn’t as dynamic as the project system that opens the new SDK style projects (which is CPS). Nevertheless, I’ve heard from the folks who own the csproj.dll project system that they still want NuGet to be a great experience with it, so if you file the bug, I suspect they’ll be interested in it (at least mildly).

0reactions
asherbercommented, Dec 22, 2018

Thanks – I’ll bring it up over there, but I’ll mention it here as well since you know more about how these things interact than I do.

The issue seems to be with how VS caches some information. Here are repeatable steps:

  1. Create project in VS, build.
  2. nbgv install
  3. Build solution in VS – no version info
  4. Rebuild solution in VS – no version info
  5. Close and reopen solution
  6. Build solution in VS – no version info
  7. Rebuild solution in VS – version info!

In 3 and 4, it’s like VS isn’t aware of Directory.Build.props being added, because it’s already taken stock of the build situation and doesn’t rescan. After a close and reopen, VS is aware of the file, but the build doesn’t do anything because the obj dir is up to date. But a rebuild at that point (or deleting obj and building) gets everything to work.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Nuget Package Version and nbgv cloud ...
Sorry I was thinking in the model of having multiple version.json files. Yes nbgv cloud on any directory under a version.json should be ......
Read more >
Does .NET 5 support the old csproj format?
The only issue I ran into is the migration assistant adds a more recent version of Microsoft.CSharp to each project reference. For my...
Read more >
C# language versioning - C# Guide
Learn about how the C# language version is determined based on your project and the reasons behind that choice. Learn how to override...
Read more >
Versioning made easier with Nerdbank.GitVersioning
It is fairly simple in a ASP.NET Core project to set your version number. Just open your csproj file and add a version...
Read more >
Upgrading an existing .NET project files to the lean new ...
In Visual Studio 2017 and .NET Core 2 (and beyond) the csproj format is MUCH MUCH leaner. There's a lot of smart defaults,...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found