-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
PrivateAssets ignored on publish when targeting net462 #1019
Comments
|
Clear! But strange, because "Newtonsoft.Json": {
"type": "build",
"version": "10.0.1"
} to the following csproj file part. <PackageReference Include="Newtonsoft.Json" Version="10.0.1">
<PrivateAssets>All</PrivateAssets>
</PackageReference> (Newtonsoft.Json is just an example of course. I'm actually trying this with a different package.) It's also listed here as the proper way. What would be the proper alternative with MsBuild to have a build-time only project reference? (So no copying to the output folder and no publishing). |
PrivateAssets=All does suppress publishing, but that was arguably a mistake. We've added Publish=true as a way to get PrivateAssets without impacting publish, and Publish=false to impact publish without impacting how dependency flows to consumers. I suspect the issue here is that the |
…0191018.8 (dotnet#1019) - Microsoft.AspNetCore.Analyzers - 3.1.0-preview2.19518.8 - Microsoft.AspNetCore.Mvc.Api.Analyzers - 3.1.0-preview2.19518.8 - Microsoft.AspNetCore.Mvc.Analyzers - 3.1.0-preview2.19518.8 - Microsoft.AspNetCore.Components.Analyzers - 3.1.0-preview2.19518.8
Run
dotnet restore && dotnet build && dotnet publish -f netcoreapp1.0 && dotnet publish -f net462
bin\Debug\netcoreapp1.0\publish does not contain Newtonsoft.Json.dll, which is expected.
bin\Debug\net462\publish does however contain Newtonsoft.Json.dll, which is unexpected.
PS: Nice how small my sample could be with the new csproj format. Greate job!
The text was updated successfully, but these errors were encountered: