Mark referenced packages in SDK as implicitly defined #105819
Merged
+3
−3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add
IsImplicitlyDefined="true"
toPackageReference
tags in Sdk.targets.Will fix two problems i had with C# scripting.
1. Prevent Package Manager in Visual Studio from trying to update SDK packages
When viewing installed packages in IDE, Package Manager suggests updating
Godot.SourceGenerators
,GodotSharp
andGodotSharpEditor
to the latest version. Looks like this action doesn't do anything, but it can mislead user into thinking they upgraded their environment to the latest version.Adding
IsImplicitlyDefined
should prevent IDE from changing versions of these packages.Screenshots
Before:
After:
2. Restore in Godot project fails when Central Package Management enabled
When using CPM with Godot, restore fails with error:
Example repository
With
IsImplicitlyDefined="true"
, NuGet will not try to manage the SDK packages, resolving this error.This change is backwards compatible and should not break anything in existing projects. However, since
IsImplicitlyDefined
is not properly documented, I’d appreciate it if someone more knowledgeable in MSBuild could ensure that nothing will break unexpectedly.What i found about
IsImplicitlyDefined
:NuGet/Home#13529
https://github.com/dotnet/sdk/pull/43151/files#r1746148520