-
Notifications
You must be signed in to change notification settings - Fork 655
[ISSUE]: GitVersion not working when called from msbuild
or Visual Studio
, but works through dotnet msbuild
#4118
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
Comments
please check this #3827 |
Thanks @arturcic, I see that it's turned off but is there a solution or workaround to get it working in visual studio? Or a plan to turn it on in the future? |
It's turned off because we do not support .Net Framework anymore and we are focused only on support for the LTS versions of .NET. Because Visual Studio currently runs on .Net Framework that means it will be turned off always. |
I'll answer myself for anyone stumbling on this in the future - the only solution if using |
@arturcic It's unfortunate that users have to downgrade to |
@deAtog I can understand the frustration, but I think a good practice is to read the release notes/ breaking changes before upgrading |
@arturcic Let's be honest, no one reads release notes. People expect new versions to either break upon upgrade or to continue to function as they did previously. In my opinion, causing a build error when building from Visual Studio would have been preferable in this case. It would have immediately highlighted the fact that Visual Studio was no longer supported by the package. In my particular case, I was adding the package to an existing project and was caught off-guard when it didn't work as expected. |
Actually when this issue initially appeared after removal of .net48 most of the community members requested to disable because it was failing for them to locally build with VS, and they were using |
FYI, I created https://www.nuget.org/packages/Dorssel.GitVersion.MsBuild, which does support Visual Studio even with version 6 GitVersion tool. |
@dorssel thanks for sharing, I had a similar idea to decouple the MsBuild from Core |
Uh oh!
There was an error while loading. Please reload this page.
Prerequisites
GitVersion package
GitVersion.MsBuild
GitVersion version
6.0.0
Operating system
Windows
What are you seeing?
When I try building a project that includes
GitVersion.MSBuild
package, theGitVersion
does not run during the build and the variables are left unset. This is the case both in case of building from CLI and through Visual Studio 2022 (both community and professional editions).What is expected?
I expect the tool to work correctly like it does if I build with
dotnet msbuild
instead ofmsbuild
, however I cannot (or don't know how to) change this in Visual Studio when building there.Steps to Reproduce
Simple console app:
Program.cs
ConsoleApp1.csproj
RepositoryFixture Test
No response
Output log or link to your CI build (if appropriate).
When building using
dotnet
the version and sha get set successfully:When building using
msbuild
the version and sha are left empty (also the case when running from Visual Studio):I noticed that the `msbuild` when called directly uses a version for `.NET Framework` while `dotnet msbuild` uses `.NET`. Not sure if that's the cause but I would expect the tool to work in both cases? Or is that not possible? Or am I missing something? that
The text was updated successfully, but these errors were encountered: