Pack library with analyzer
See original GitHub issueIt is common to have:
Lib.csproj
Lib.Analyzers.csproj
Where Lib.csproj
does not have a project reference to Lib.Analyzers.csproj
but we want Lib.nupkg
to have package dependency to Lib.Analyzers.nupkg
When using paket for packing it is just a matter of adding the following to paket.template
:
dependencies
Lib.Analyzers
I tried adding a fake project reference as a hack
<ItemGroup>
<ProjectReference Include="..\Lib.Analyzers\Lib.Analyzers.csproj">
<!-- hack for packing with package dependency -->
<PrivateAssets>none</PrivateAssets>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
<SkipGetTargetFrameworkProperties>true</SkipGetTargetFrameworkProperties>
<UndefineProperties>TargetFramework</UndefineProperties>
</ProjectReference>
</ItemGroup>
But it did not work and had issues when building.
Is there support for this scenario and if so where is it documented?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Pack library with analyzer · Issue #429 · dotnet/roslyn-sdk
A project reference from your self-packing library project to your self-packing analyzer project is the easiest way to end up with a library...
Read more >analyzer | Dart Package
This package provides a library that performs static analysis of Dart code. It is useful for tool integration and embedding. End-users should use...
Read more >Create a NuGet package for your analyzer
If you are using a .NET Core or .NET Standard project for your analyzers consider using the support for creating NuGet packages present...
Read more >Code Analysis - Build and Deploy Libraries with Integrated ...
In this article, I'll explain how to bundle libraries and analyzers into NuGet packages for online deployment, showing how you can offer ...
Read more >Webpack Bundle Analyzer
Webpack plugin and CLI utility that represents bundle content as convenient interactive zoomable treemap. Latest version: 4.9.0, ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
What happens if you add
SkipGetTargetFrameworkProperties="True"
to the project reference? (https://gist.github.com/rainersigwald/1fbd21a24a41b9b7c6204cb9cfcbb1cf#disabling-targetframework-negotiation)I think nuget/home might be a better repository. NuGet owns the Pack task and pack gets all its information about dependencies from the csproj (actually assets file, I believe).
One thing you might want to try: https://docs.microsoft.com/en-us/visualstudio/msbuild/common-msbuild-project-items?view=vs-2019#projectreference