-
Notifications
You must be signed in to change notification settings - Fork 255
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
Wrong version constraint when building dependant libraries using ProjectReference and GitVersion #5003
Comments
I also tried |
The result is the same if I call MSBuild for each target separately. |
@thoemmi i think this is a dupe of : #4790 . There is a workaround listed there too . If you think that's the issue, can you please close this out and subscribe to that issue for updates? |
@rohit21agrawal I can confirm that the referenced workaround does work. I've created following file and imported it in my <Project>
<!-- GitVersion version -->
<PropertyGroup>
<GitVersionTaskVersion>4.0.0-beta0011</GitVersionTaskVersion>
</PropertyGroup>
<ItemGroup>
<!-- reference GitVersionTask package -->
<PackageReference Include="GitVersionTask" Version="$(GitVersionTaskVersion)" PrivateAssets="All" />
</ItemGroup>
<!--
Import GitVersionTask target
This ugly workaround is necessary because of this NuGet issue: https://github.com/NuGet/Home/issues/4790
-->
<ImportGroup Condition="'$(ExcludeRestorePackageImports)' == 'true'">
<Import
Project="$(UserProfile)\.nuget\packages\gitversiontask\$(GitVersionTaskVersion)\buildMultiTargeting\GitVersionTask.targets"
Condition="Exists('$(UserProfile)\.nuget\packages\gitversiontask\$(GitVersionTaskVersion)\buildMultiTargeting\GitVersionTask.targets')" />
</ImportGroup>
<Target
Name="FixUpVersion"
BeforeTargets="_GenerateRestoreProjectSpec"
DependsOnTargets="GetVersion"
Condition="'$(GitVersion_Task_targets_Imported)' == 'True'" />
</Project> I'll close this issue and subscribe to #4790 as requested. |
I have a solution with two library projects, using VS2017. Project B has a ProjectReference to A. The version are determined at compile time by GitVersion (4.0.0-beta0011). The current version of my libraries is 0.1.0.
I create the NuGet packages using msbuild:
While both packages have the version 0.1.0, the nuspec of B says it depends on A, version 1.0! However, v1.0 doesn't exist, so you cannot add package B to any project.
You can reproduce the issue with my repository StickyWindows: StickyWindows.WPF depends on StickyWindows, version >= 1.0 (see NuGet gallery), though both packages are 0.1.0, created with the same build.
The text was updated successfully, but these errors were encountered: