-
Notifications
You must be signed in to change notification settings - Fork 654
[Bug]Build error due to malformed file path obj\/gitversion.json
#2534
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
Sorry guys, false alarm. Something else must've been going on as I can't reproduce it now after reloading VS. You still might want to look at that mangled path though ;-) |
There may be hard coded instances of |
@asbjornu this one is done in msbuild props
|
maybe we need to remove the |
Ah, we should replace that with |
That's a good point and may highlight why Microsoft designed all paths to deliberately end with slashes in MSBuild. I've always despised that decision, but alleviating the need to do |
I believe just dropping the slash is exactly what the MSBuild convention is, considering this property is documented to end with the slash here. If you want to guard against users who override this property but forget to add the slash at the end I suggest |
@bddckr do you mind sending a PR? |
👍 However, I'll check out the provided repro later today or tomorrow first - I've not been able to reproduce in my own projects at all 🤔 (I already had the slash at the end for this property, but even removing it doesn't change anything - it keeps working for me no matter what.) |
Hi all,
The path should be quoted, otherwise the call fails when the package is cached in a path containing whitespaces (on Windows, this is usually %userprofile%.nuget\packages - I my case, having a space in my user name). After changing this to |
I have this issue as well. My project under https://github.com/SeppPenner/SerilogSinkForPostgreSQL (With multiple target frameworks) throws the error: @arturcic I will try your change from arturcic@353837a and see if this works for me. |
Ok, the workaround doesn't solve my issue. I have tried to change <PropertyGroup Condition="'$(MSBuildRuntimeType)' == 'Full' Or '$(MSBuildRuntimeType)' == 'Mono'">
<GitVersionFileExe>$(MSBuildThisFileDirectory)net48/gitversion.exe</GitVersionFileExe>
<GitVersionAssemblyFile>$(MSBuildThisFileDirectory)net48/GitVersion.MsBuild.dll</GitVersionAssemblyFile>
</PropertyGroup> to <PropertyGroup Condition="'$(MSBuildRuntimeType)' == 'Full' Or '$(MSBuildRuntimeType)' == 'Mono'">
<GitVersionFileExe>$(MSBuildThisFileDirectory)net48\gitversion.exe</GitVersionFileExe>
<GitVersionAssemblyFile>$(MSBuildThisFileDirectory)net48\GitVersion.MsBuild.dll</GitVersionAssemblyFile>
</PropertyGroup> However, this doesn't help either, the error stays the same. EDIT: I agree with @julianbartel, my path has a space in it... |
Is there any known workaround? I've added <PropertyGroup>
<GitVersionOutputFile>$(BaseIntermediateOutputPath)gitversion.json</GitVersionOutputFile>
<GitVersion_ToolArgments>-output file -outputfile $(GitVersionOutputFile)</GitVersion_ToolArgments>
</PropertyGroup> in my Directory.Build.props, but it didn't help. |
The best "workaround" is to provide a pull request that fixes this in GitVersion. |
If I knew where the problem was, there would have been one from my side :D |
🎉 This issue has been resolved in version 5.6.4 🎉 Your GitReleaseManager bot 📦🚀 |
Describe the bug
GitVersion.MSBuild nuget package v5.6.3 uses a badly formed path that causes a build error.
The build log makes this clear:
Expected Behavior
Obviously, there should not be a build error
Steps to Reproduce
Context
Showstopper! I can no longer build my code.
Your Environment
Windows 10
VS2019 Enterprise
.NETStandard 2.1 class library project
GitVersion.MSBuild nuget package v5.6.3
Here is a link to the minimal solution required to reproduce the issue (it is really just File/New Project)
https://github.com/NameOfTheDragon/TA.GitVersionIssue
The text was updated successfully, but these errors were encountered: