Open WeihanLi opened 3 months ago
To override how NuGet handles global package references, you'll need to set RestoreEnableGlobalPackageReference
to false
to disable the built-in logic. Then in your Directory.Build.targets
you can do something like:
<ItemGroup>
<PackageReference Include="@(GlobalPackageReference)"
Version=""
IncludeAssets="MyDefaultIncludeAssets"
PrivateAssets="All" />
<PackageVersion Include="@(GlobalPackageReference)"
Version="%(Version)" />
</ItemGroup>
@jeffkl thanks, it could help while we may want to update this for specific reference only, keep using the default behavior for other references, so maybe it's better to support an inline override
NuGet Product(s) Involved
NuGet.exe
The Elevator Pitch
The
GlobalPackageReference
would useRuntime;Build;Native;contentFiles;Analyzers
for theIncludeAssets
while sometimes the package may need to useall
to include thecompile
, maybe we could support overriding the defaultIncludeAssets
, trying to addIncludeAssets="All"
but no workingAdditional Context and Details
I'm trying to use CPM for the EasyNetQ project and trying to use the
GlobalPackageReference
forFody