-
Notifications
You must be signed in to change notification settings - Fork 258
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
dotnet add package should use use correct defaults at evaluation time #7972
Comments
From @peterhuene on Monday, 08 April 2019 19:34:27 The I'm going to move this there. |
I'd imagine this is a dev dependency package? If so that's by design (as a popular ask by the community) |
@nkolev92 The values are not the defaults for all |
The specific situation where this arises is unit test projects. The projects have no downstream consumers, so the elements here are unnecessary noise in the project file for this case (they have no observable impact in the solution aside from clutter). Therefore, pull requests following the use of If NuGet automatically applied the correct properties during the build when they are not set in the project file, the values can be omitted from the project file and users can use /cc @KathleenDollard |
Spec at https://github.com/NuGet/Home/wiki/DevelopmentDependency-support-for-PackageReference I understand that, but that is the best solution we have. The other options was having different item type in MSBuild for dependencies. That got rejected in the long thread.
They do have an impact. It's a dev dependency and it's expressed as such in the project file. No compile assets & no transitive flow. This is not specific to the dotnet add package, it's the same experience in VS as well. |
@nkolev92 , is it possible to set defaults on the package side? Currently we have |
That's not really possible, but often times, it's not really necessary. If you have assets that you don't want your package consumers to use, don't add them to the package. |
@nkolev92 yet sometimes it should give a choice just with different defaults. For example, Mapperly uses conditionals for its attributes and authors recommend to reference the package this way:
thus erasing any trace of the library. Yet it's possible to save attributes, if needed. |
From @sharwell on Monday, 08 April 2019 18:34:35
Steps to reproduce
Expected behavior
The default values for
IncludeAssets
andPrivateAssets
are determined automatically during the build:Actual behavior
The default values for
IncludeAssets
andPrivateAssets
clutter the project file:Environment data
Unknown (filed in response to dotnet/winforms#702 (comment))
Copied from original issue: dotnet/cli#11101
The text was updated successfully, but these errors were encountered: