-
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
Exclude package target/props imports during restore #3604
Labels
Comments
This can be limited to just |
emgarten
added a commit
to NuGet/NuGet.Client
that referenced
this issue
Oct 11, 2016
Framework conditions for targets/props are added only when a project uses cross targeting. For scenarios with a single framework under $(TargetFramework) buildCrossTargeting will be left out and there will be no framework conditions to block the imports. In addition to this a new property has been added to allow control over package imports: ExcludeRestorePackageImports. This flag is used at restore time to avoid imports from packages changing the inputs to restore, without this it is possible to get different results between the first and second restore. This change also contains support for nooping when writing out targets/props files. Currently the check is a simple string compare on the files since these files are small. Nooping is now a major benefit since all NETCore projects reference the SDK package, without nooping on the targets/props files MSBuild will always end up rebuilding everything for NETCore solutions. Fixes NuGet/Home#3588 Fixes NuGet/Home#3637 Fixes NuGet/Home#3604 Fixes NuGet/Home#3641 Fixes NuGet/Home#3199
emgarten
added a commit
to NuGet/NuGet.Client
that referenced
this issue
Oct 11, 2016
Framework conditions for targets/props are added only when a project uses cross targeting. For scenarios with a single framework under $(TargetFramework) buildCrossTargeting will be left out and there will be no framework conditions to block the imports. In addition to this a new property has been added to allow control over package imports: ExcludeRestorePackageImports. This flag is used at restore time to avoid imports from packages changing the inputs to restore, without this it is possible to get different results between the first and second restore. This change also contains support for nooping when writing out targets/props files. Currently the check is a simple string compare on the files since these files are small. Nooping is now a major benefit since all NETCore projects reference the SDK package, without nooping on the targets/props files MSBuild will always end up rebuilding everything for NETCore solutions. Fixes NuGet/Home#3588 Fixes NuGet/Home#3637 Fixes NuGet/Home#3604 Fixes NuGet/Home#3641 Fixes NuGet/Home#3199
drewcassidy
added a commit
to KSPModdingLibs/KSPBuildTools
that referenced
this issue
Sep 7, 2024
Due to NuGet/Home#3604, `restore` targets defined in nuget packages never get run. Luckily the ckaninstall stuff only runs when needed so having it under `build` is not the end of the world
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Now that NuGet supports PackageReference in msbuild files there is a potential for packages to include targets/props files under the build folder which change the dependencies of a project.
Problem
If a package contains a build/package.targets file that contains a PackageReference the output of restore will change based on if the project had previously been restored.
Proposal
NuGet should exclude targets/props from packages while restoring and provide properties which give control over imports in the auto generated targets/props files.
New properties
Usage
Restore will run with ExcludeRestorePackageImports=true
The text was updated successfully, but these errors were encountered: