-
Notifications
You must be signed in to change notification settings - Fork 663
Mark dependencies as private assets for GitVersion.MsBuild #3921
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
Mark dependencies as private assets for GitVersion.MsBuild #3921
Conversation
Chnage that all references of the msbuild package are marked as private
assets, so they don't get added as dependency to the nuget package.
The dependecies field of the nuspec before the change:
```xml
<dependencies>
<group targetFramework="net6.0">
<dependency id="System.Text.Json" version="8.0.1" exclude="Build,Analyzers" />
</group>
<group targetFramework="net7.0">
<dependency id="System.Text.Json" version="8.0.1" exclude="Build,Analyzers" />
</group>
<group targetFramework="net8.0">
<dependency id="System.Text.Json" version="8.0.1" exclude="Build,Analyzers" />
</group>
</dependencies>
```
and afer the change the dependencies of the nuspec look like this:
```xml
<dependencies>
<group targetFramework="net6.0" />
<group targetFramework="net7.0" />
<group targetFramework="net8.0" />
</dependencies>
```
|
@Louis9902 it seems the PR passes all the tests we have, including testing the actual nuget package. I will check the nuget package the CI generated locally and see if it works as expected. Thanks btw for the changes, it makes the nuspec much cleaner. |
|
It works. Looks great |
|
Thank you @Louis9902 for your contribution! |
|
🎉 This issue has been resolved in version 6.0.0-beta.6 🎉 Your GitReleaseManager bot 📦🚀 |
Description
Change that all references of the msbuild package are marked as private assets, so they don't get added as dependency to the nuget package.
The dependecies field of the nuspec before the change:
and afer the change the dependencies of the nuspec look like this:
Related Issue
No, so far, happy to create one if the pr is not enough
Motivation and Context
The dependencies cause extra dll's to be published, for build only dependencies (
PrivateAssets="All"). This problem seems to be cause by the change to the ceontral package management, whereSystem.Text.Jsonwas promoted to be included in theDirectory.Build.propsHow Has This Been Tested?
Build locally and checked the generated nuspec file in the outpur directory.
Screenshots (if appropriate):
Checklist: