Publish: PrivateAssets=All not honored on ProjectReference items
See original GitHub issueSteps
- Create a new .NET Core Console App
- Add a new .NET Standard Class Library
- Reference the class library from the console app:
<ProjectReference Include="..\ClassLibrary1\ClassLibrary1.csproj" PrivateAssets="All" />
- Run
dotnet publish
on the console app.
Unexpected Results
ClassLibrary1.dll
is copied to the the ‘publish’ directory.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:16
- Comments:13 (10 by maintainers)
Top Results From Across the Web
msbuild PackageReference.PrivateAssets = All does not ...
I thought setting PrivateAssets = All would do it, but apparently I misunderstand how it works, because it does not have the desired...
Read more >MSBuild reference for .NET SDK projects
This page is a reference for the MSBuild properties and items that you can use to configure .NET projects. Note. This page is...
Read more >Dotnet pack - include referenced projects
Shows how to workaround the current limitations of dotnet pack when referencing other projects.
Read more >Include both Nuget Package References *and* project ...
Recently I have been trying to generate more Nuget packages for our dotnet core projects, utilizing the dotnet pack command. One issue I...
Read more >Solving the source generator 'marker attribute' problem
In this post I describe how I solved a problem I've been wrestling with around source generators: where to put the 'marker attributes'...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Using Private=false metadata instead of ReferenceOutputAssembly=false should work for the compile against but do not copy semantic. (This is another data point that the term private is a poor choice for impacting copying. Classic reference metadata and nuget metadata are overloading it with opposite meaning. 😦)
I found a blog post which does go into a workaround for this with a custom target though it would be great if this worked out-of-the-box.