Skip to content

Commit

Permalink
Fixing how the assemblies are referenced in NuGet (#253)
Browse files Browse the repository at this point in the history
Setting the DevelopmentDependency property will cause the nuspec to have a developmentDependency node in the metadata, which influences how the package is referenced in the consuming projects (see https://github.com/NuGet/NuGet.Client/blob/a41fd92fbbd65fb430e96b11c3277e2c96184474/src/NuGet.Core/NuGet.Build.Tasks.Pack/NuGet.Build.Tasks.Pack.targets#L236 for the task entrypoint).

This property would make sense if we were shipping something only for development in the nupkg (like just a source generator or analyzer) but since we're not, we're also shipping a runtime, we don't want the package considered a developmentDependency as that will influence the IncludeAssets and PrivateAssets properties of the package reference.

https://learn.microsoft.com/nuget/reference/nuspec#developmentdependency is the nuspec reference with more details here: https://github.com/NuGet/Home/wiki/DevelopmentDependency-support-for-PackageReference
  • Loading branch information
aaronpowell authored Oct 11, 2024
1 parent 17f01fc commit 6ab9cd9
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion src/CSnakes.Runtime/Packaging.targets
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<!-- warning NU5128: Add lib or ref assemblies for the netstandard2.0 target framework -->
<NoWarn>$(NoWarn);NU5128</NoWarn>

<DevelopmentDependency>true</DevelopmentDependency>
<GeneratePackageOnBuild>$(EnableLocalPackaging)</GeneratePackageOnBuild>
</PropertyGroup>

Expand Down
2 changes: 1 addition & 1 deletion src/Packaging.props
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<PackageIcon>logo.jpeg</PackageIcon>
<PackageReadmeFile>README.md</PackageReadmeFile>
<RepositoryUrl>https://github.com/tonybaloney/CSnakes</RepositoryUrl>
<VersionPrefix>1.0.18</VersionPrefix>
<VersionPrefix>1.0.19</VersionPrefix>
<PackageLicenseFile>LICENSE</PackageLicenseFile>

<PublishRepositoryUrl>true</PublishRepositoryUrl>
Expand Down

0 comments on commit 6ab9cd9

Please sign in to comment.