-
Notifications
You must be signed in to change notification settings - Fork 650
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ISSUE]: GitVersion.MsBuild no longer supports GitVersionInformation namespace is breaking change #4102
Comments
dotnet new console --name test
cd test
dotnet add package GitVersion.MsBuild --version 6.0.0-rc.2
git init
git add .
git commit -m "Init"
echo 'Console.WriteLine(GitVersionInformation.FullSemVer);' > .Program.cs
dotnet run I ran this in terminal and it works as expected |
Thanks for your time with testing. I have run the same commands and yes using However, when building the exact same project through Visual Studio (2022) it does not build giving the following error For reference here is the complete Build log i wonder if this is a dotnet build vs msbuild problem. Can you please confirm your project can successfully build through Visual Studio? |
@conorvahland I don't use Visual Studio, only command line and Rider. In Visual Studio it will not work as we dropped support for .net framework 4.8 (and by consequence Visual Studio) |
thank you for the explanation |
So... how is anyone using Visual Studio supposed to use GitVersion.MsBuild with version 6? Note that I'm having the same issues in VS when creating an MVC Core or WPF (DotNet 8.0) apps... Building and launching apps from VS is pretty common for people using this IDE... does this mean we're stuck using version 5, effectively forever? |
You can still load the project that contains the package in Visual Studio without problems, it's just the GitVersion disabled. I suppose you need a version whenever you do a release, and its most probably done in a CI/CD manner, and most probably using |
But if "GitVersion is disabled" then references to the static class will fail to compile. At best you could say the tool is now non-deterministic, as it now gives different results based on the IDE. But I'd argue it just no longer works as expected in VS. |
@Szaamaan I can understand your frustration. In the last years there was a lot of effort put into maintaining compatibility with .Net Framework, sometimes most of the effort, and a lot of issues we had to solve just to keep .Net Framework in the list of supported. At some point during the release of 6.0 we had to decide to drop it as it was slowing us down because of too many issue and limited time and people that are maintaining the project. My frustration and I guess of other maintainers is, the effort is not always appreciated, taking in consideration we all have full time jobs and families, and the free time we can find sometimes at night to keep the project running. I would expect the community that uses the tool to contribute back and help solve their problem, and keep maintaining the code they contribute with, and not just expect we will solve all the problems. That's how myself I started contributing and in the end maintaining the project. Sometimes we have to take decisions that will affect people using the tool, but that's needed to keep the project running. As for your case, you can use |
There must be some key detail that I'm missing, because this issue affects any kind of project opened in VS, not just ones targeting the old .NET Framework (or using the old I can certainly understand dropping suport for the old runtimes, really I do. But this seems like a case where you're not actually checking the target runtime, rather the build tool...? And while using |
@arturcic please pin this issue because it affects pretty much all use cases for people using Visual Studio, which is the most popular (and first-party-supported) way to develop for .NET. Reading the changelog, it is not obvious that removing support for .NET Framework also breaks compatibility with Visual Studio, but it does makes sense if VS uses the Framework MSBuild. In my case, this change broke both in-IDE builds (Run/Debug) and publishing EXEs, which I rely on to deploy all my applications. Just my 2 cents, no hard feelings as I can understand the trade offs that must be made when maintaining open source projects. |
Agree, hopefully I can find time to check for solutions |
Prerequisites
GitVersion package
GitVersion.MsBuild
GitVersion version
6.0.0-rc.2
Operating system
Windows
What are you seeing?
When using GitVersion.MsBuild it seems the GitVersionInformation class is no longer existing, causing build processes to break.
Using GitVersion.MsBuild v5.x I could display build variables within the application itself, eg BranchName, ShortSha or CommitDate on a version information page.
There is no mention in the documentation of this functionality being removed and this doesnt seem to be documented as a breaking change.
What is expected?
Build information accessible within the application to display variables on a version page when using GitVersion.MsBuild
Steps to Reproduce
create Visual Studio 2022 web application
RepositoryFixture Test
No response
Output log or link to your CI build (if appropriate).
No response
The text was updated successfully, but these errors were encountered: