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:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
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).
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:
nbgv install
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.