-
Notifications
You must be signed in to change notification settings - Fork 258
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
dotnet pack should pack tools with the versions that the package was built against #4063
Comments
Yes that needs to work (pretty big regression otherwise) |
…ackages so that test packages can reference exact packages. We need that because of NuGet/Home#4063. Without it, pack creates the nuspec with a version like 1.0.0-version-, instead of 1.0.0-version-<version_used_in_build>, which leads to problems when restoring the tool. Like, it ends up restoring to the closest version of the package (oldest), instead of the latest.
* rel/1.0.0-preview4: Adding MigrateWebSdkRule to the DefaultMigrationRuleSet (dotnet#4963) MSBuild to 15.1.458 (dotnet#4950) Update web template for Web SDK 154 (dotnet#4948) Adding a SdkNugetVersion property when invoking dotnet pack on test packages so that test packages can reference exact packages. We need that because of NuGet/Home#4063. Without it, pack creates the nuspec with a version like 1.0.0-version-, instead of 1.0.0-version-<version_used_in_build>, which leads to problems when restoring the tool. Like, it ends up restoring to the closest version of the package (oldest), instead of the latest. remove unused directories from bundled sdks fix mstest package version, aligned to c# align f# web template align f# xunit template align f# mstest template align f# lib template align f# console proj bundle fsharp sdk, only Sdk directory is required Add more xlf files for new strings Updating the preview4 channel to rel-1.0.0-preview4
* Updating the preview4 channel to rel-1.0.0-preview4 * Add more xlf files for new strings * bundle fsharp sdk, only Sdk directory is required * align f# console proj * align f# lib template * align f# mstest template * align f# xunit template * align f# web template * fix mstest package version, aligned to c# * remove unused directories from bundled sdks * Adding a SdkNugetVersion property when invoking dotnet pack on test packages so that test packages can reference exact packages. We need that because of NuGet/Home#4063. Without it, pack creates the nuspec with a version like 1.0.0-version-, instead of 1.0.0-version-<version_used_in_build>, which leads to problems when restoring the tool. Like, it ends up restoring to the closest version of the package (oldest), instead of the latest. * Update web template for Web SDK 154 (#4948) * Update WebSDK version * Update web template to get rid of globs aspnet/Templates#735 * MSBuild to 15.1.458 (#4950) * Adding MigrateWebSdkRule to the DefaultMigrationRuleSet (#4963) * Adding MigrateWebSdkRule to the DefaultMigrationRuleSet and adding a E2E test to cover it. * Do not migrate compile and EmbeddedResources for web application, because those are included in the Web Sdk already. * Addressing code review comments
Is there any way we can workaround this in RC.2 bits? If not, this will likely cause major pain while trying to upgrade aspnet to vs2017. We liberally use floating versions e.g. |
Workaround for RC.2: add this to your project <Target Name="ResolveRestoredPackageVersions"
BeforeTargets="GenerateNuspec"
DependsOnTargets="ResolvePackageDependenciesDesignTime"
Condition="'$(TargetFramework)'!=''">
<ItemGroup>
<_FloatingVersions Include="@(_PackageReferences)" Condition="$([System.String]::new('%(Version)').EndsWith('*'))" />
<_ResolvedFloatingVersion Include="@(_FloatingVersions)">
<ResolvedName>%(_DependenciesDesignTime.Name)</ResolvedName>
<Version>%(_DependenciesDesignTime.Version)</Version>
</_ResolvedFloatingVersion>
<_PackageReferences Remove="@(_PackageReferences)" Condition="$([System.String]::new('%(Version)').EndsWith('*'))" />
<_PackageReferences Include="@(_ResolvedFloatingVersion)" Condition="'%(Identity)'=='%(_ResolvedFloatingVersion.ResolvedName)'" />
</ItemGroup>
</Target> |
* Updating the preview4 channel to rel-1.0.0-preview4 * Add more xlf files for new strings * bundle fsharp sdk, only Sdk directory is required * align f# console proj * align f# lib template * align f# mstest template * align f# xunit template * align f# web template * fix mstest package version, aligned to c# * remove unused directories from bundled sdks * Adding a SdkNugetVersion property when invoking dotnet pack on test packages so that test packages can reference exact packages. We need that because of NuGet/Home#4063. Without it, pack creates the nuspec with a version like 1.0.0-version-, instead of 1.0.0-version-<version_used_in_build>, which leads to problems when restoring the tool. Like, it ends up restoring to the closest version of the package (oldest), instead of the latest. * Update web template for Web SDK 154 (dotnet#4948) * Update WebSDK version * Update web template to get rid of globs aspnet/Templates#735 * MSBuild to 15.1.458 (dotnet#4950) * Adding MigrateWebSdkRule to the DefaultMigrationRuleSet (dotnet#4963) * Adding MigrateWebSdkRule to the DefaultMigrationRuleSet and adding a E2E test to cover it. * Do not migrate compile and EmbeddedResources for web application, because those are included in the Web Sdk already. * Addressing code review comments
@rohit21agrawal - please get your head around this. raised as a blocking issue by asp.net team. (note there is a workaround) |
@rrelyea i already have a fix for this, this will be fixed in RC3. |
This is for a situation where I have a library (or tool) that has a * dependency, like on Microsoft.DotNet.Cli.Utils: 1.0.0-preview4-*.
Today, the nuspec for this package gets generated with 1.0.0-preview4-, which means that when the tool gets restored, we end up with the lowest version of Cli.Utils, no matter what.
Instead, when the nuspec gets generated by pack, it should set the * versions to those in the project.assets.json file of the project being packaged.
I believe this used to be the behavior for project.json, so, in a way, we lost parity with it.
Also, we just hit this in the CLI itself and it was a bit of a pain to debug and understand all this.
cc @piotrp @emgartem @rrelyea
The text was updated successfully, but these errors were encountered: