GitVersion
GitVersion copied to clipboard
[ISSUE]: Version mismatch when using EnablePackageValidation
Prerequisites
- [x] I have written a descriptive issue title
- [x] I have searched issues to ensure it has not already been reported
GitVersion package
GitVersion.MsBuild
GitVersion version
5.12.0
Operating system
Linux
What are you seeing?
Successfully created package 'MyProject.1.27.0-branch.1.nupkg'.
/usr/share/dotnet/sdk/6.0.428/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Compatibility.Common.targets(33,5): error MSB4018: The "Microsoft.DotNet.Compatibility.ValidatePackage" task failed unexpectedly. [/MyApp/MyProject/MyProject.csproj]
/usr/share/dotnet/sdk/6.0.428/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Compatibility.Common.targets(33,5): error MSB4018: System.IO.InvalidDataException: The file is not a valid nupkg. File path: /MyApp/MyProject/bin/Release/MyProject.1.27.0-branch.1+34.nupkg [/MyApp/MyProject/MyProject.csproj]
/usr/share/dotnet/sdk/6.0.428/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Compatibility.Common.targets(33,5): error MSB4018: ---> System.IO.FileNotFoundException: Could not find file '/MyApp/MyProject/bin/Release/MyProject.1.27.0-branch.1+34.nupkg'. [/MyApp/MyProject/MyProject.csproj]
The +34 is appended by the Microsoft.DotNet.Compatibility.ValidatePackage task. I don't know where it's pulling this info from
What is expected?
EnablePackageValidation should be able to verify the package correctly. I don't know if this is an sdk issue or GitVersion
The important difference is that msbuild uses the wrong version to find the current nuget package: MyProject.1.27.0-branch.1+34.nupkg but should be MyProject.1.27.0-branch.1.nupkg.
Steps to Reproduce
branch: feature/branch
csproj: set <EnablePackageValidation>true</EnablePackageValidation>
command: dotnet pack
runtime/sdk: net6.0 - due some company constraint I cannot upgrade yet
RepositoryFixture Test
No response
Output log or link to your CI build (if appropriate).
I assume it's happening here: https://github.com/GitTools/GitVersion/blob/main/src/GitVersion.MsBuild/msbuild/tools/GitVersion.MsBuild.targets#L67
Still I don't know why dotnet pack mismatches this with the real created file
This issue has been automatically marked as stale because it has not had recent activity. After 30 days from now, it will be closed if no further activity occurs.
This issue was closed because it has been stalled for 30 days with no activity. Thank you for your contributions