Open JinsPeter opened 2 years ago
I don't think any of that is necessary, SerilogAnalyzer.dll
is neither copied to the output directory nor are you able to access the SerilogAnalyzer
namespace in your project where you are referencing the analyzer. Are there any other concerns i'm missing here? Marking it as PrivateAssets=All
should be fine though, even though i don't see what that would change.
My understanding is that if someone were to include this in their project and generate a nuget package from that this package would be listed as a dependency and it probably shouldn't be. That's why PrivateAssets should probably be included by default.
Are there any other concerns i'm missing here?
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<TargetFramework>netstandard2.0</TargetFramework>
<IsPackable>true</IsPackable>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="SerilogAnalyzer" Version="0.15.0" />
</ItemGroup>
</Project>
From NugetPackageExplorer on dummy project built with SerilogAnalyzer:
@Suchiman Your package should be flagged as a developmentDependency. If it has that flag then Visual Studio should automatically create correct attributes in the <PackageReference>
tag for your users to not include it as a dependency.
When installed SerilogAnalyzer, the package gets installed as a Project dependency rather than a build time dependency?
Below is a sample from a FxCopAnalyzer installation where the visual studio itself marked the package reference as
<PrivateAssets> All </PrivateAssets>
.Is there anything to be done to install SerilogAnlyzer as a Build dependency. Is it okay if we manually mark it as a PrivateAssets=All?