Fody/NullGuard

When Nullguard.Fody is added to a project that is built as a NuGet package, the produced package has a dependency on NullGuard.Fody

salfab opened this issue · 8 comments

Hi, I read the template, and I am not a patron, but as a good citizen, I just wanted to raise awareness regarding an issue you may have never come accross before. Even if this issue gets ignored by NullGuard.Fody's developers, it may help other people that use the package and want to work around the problem manually.

Describe the issue

When Nullguard.Fody is added to a project that is built as a NuGet package, the produced package has a dependency on NullGuard.Fody

Minimal Repro

create a new .net library, make sure "Generate nuget package on build" is checked in the project's properties, and build solution.

Check the produced .nupkg : NullGuard.Fody is listed as a dependency to the produced package.

Submit a PR that fixes the bug

No PR, but the idea is to apply this tag in the .csproj in the consuming project, upon installation of NullGuard.Fody.

If the feature never gets implemented, this can be applied manually by whoever references the NullGuard.Fody package in their own NuGet package project.

In the consuming project, replace

    <PackageReference Include="NullGuard.Fody" Version="1.8.5" />

with

    <PackageReference Include="NullGuard.Fody" Version="1.8.5" >
      <PrivateAssets>all</PrivateAssets>
    </PackageReference>

For more info on the PrivateAssets tag, see the controlling dependency assets article on microsoft's documentation

@salfab can u send a doco PR to this file that adds the above https://github.com/Fody/Home/blob/master/pages/source/usage.md

Of course.

Should there also be a mention of it in the doco of NullGuard, or only in Fody/Home ?

Done. I opened a PR on the usage.md file.

only in Fody/Home. i dont think it is valuable enough to replicate over 50+ addin repositories, since we are essentially documenting standard nuget behavior

so re this

and I am not a patron,

do you feel $3 a month is too much ?

I'm not saying it is, I just literally discovered Fody accepted donations while writing my issue.

given the doco is added (thanks for the PR) i will close this