Quantcast
Channel: Active questions tagged nuget-package - Stack Overflow
Viewing all articles
Browse latest Browse all 3067

What is the best way to include a development dependency into the nuget package without referencing it in the actual project

$
0
0

In advance: although I have not tried it out yet, as far as I know, a workaround for my problem is adding a full .nuspec file to the project and setting some extra properties in .csproj for msbuild.

I have an API project that included analyzers related to the API's usage, but I had to separate them. The analyzer still references the API project and uses types from the latter. Hence I can't add a project reference from the API to the analyzer, as it would result in a cyclic reference indifferent from the asset control. Neither can I add the analyzer to the API project as a package reference as it is not the one that should be analyzed. Those to be analyzed are the clients consuming the API. I want to add the analyzer package as a development dependency, but only for them.

I already have such a thing for other reasons:

<Target Name="SetNuSpecProperties" BeforeTargets="GenerateNuspec"><PropertyGroup><NuspecProperties>$(NuspecProperties);Version=$(Version);...;</NuspecProperties></PropertyGroup></Target>

But these are all flat properties. The dependencies is a list. On top of that, it will contain autogenerated dependencies.

Is there a way to inject a dependency in that list from within the .csproj?


Viewing all articles
Browse latest Browse all 3067

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>