-
Notifications
You must be signed in to change notification settings - Fork 392
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
The nomination doesn't contain privateAssets=all for the netcoreapp package in test projects. #3493
Comments
@nkolev92 Can you describe the user impact of this issue? |
Extra restores in Visual Studio after a restore had happened on the commandline. The thing that makes it worth fixing (rather investigating initially) is that there might be different manifestations of the same root cause that we haven't been able to understand or reproduce yet. |
The use of PrivateAssets in an attribute causes a restore difference in the VS IDE and the command line. The IDE restore will ignore the PrivateAssets element and flow it to dependent projects. Moving to an element avoids this problem. NuGet/Home#6367 dotnet/project-system#3493
PrivateAssets is set to Microsoft.NETCore.App -- (Description: | RuntimeIdentifier: | NoWarn: | OriginalItemSpec: | FrameworkName: | Version:2.0 | Visible: | TargetFramework: | IncludeAssets: | PrivateAssets:All | ExcludeAssets: | IsImplicitlyDefined:true | FrameworkVersion: | Name: | Type: | Path:) However "Microsoft.NETCore.App": {
"target": "Package",
"version": "[2.0.0, )",
"autoReferenced": true
}, |
Are you saying that we're passing the right value to NuGet? |
@jmarolf Note that I have seen this for xunit .net core projects only. What you're articulating could be an additional NuGet issue, I'd love a repro if you have one. |
I cannot repro this - while Microsoft.NETCore.App has been moved to FrameworkReference, I tried with xUnit and its correctly being passsed through:
|
Think the difference was whether it was PrivateAssets attribute vs Element. <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="xunit" Version="2.4.0" PrivateAssets="all" /> Seems to be fixed now, I can't repro it either. |
Note that private assets is normally set to All for Microsoft.NETCore.App, but it's not in this nomination.
To see the difference, do a commandline restore and look at the project spec at the bottom of the assets file.
This doesn't repro in non-test projects.
Attached a pp.txt, I did not find any of the privateassets values being removed in any of the imports.
pp.txt
If a set a value manually to any of the other package reference, that specific reference gets correctly nominated.
Related to NuGet/Home#6772
The text was updated successfully, but these errors were encountered: