最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Is there a way to install a nuget package only for development environment? - Stack Overflow

programmeradmin1浏览0评论

I installed HttpClientToCurl on my project to inspect and export some requests, but I don't want to bring unwanted dependencies on the project, I mean, it is only for debuggind purpuse and no reference of such library should end in production code.

So I'm asking if in nuget there is something like the npm i --save-dev to save a library as a dependency but only for development, and it wont end in the published package.

I read that the most similar idea is marking the PackageReference as PrivateAssets

<PackageReference Include="HttpClientToCurl" Version="2.0.6">
    <PrivateAssets>all</PrivateAssets>
</PackageReference>

Is that true? I mean if I add PrivateAssets=all wouldn't the package installer still add the HttpClientToCurl library but without exporting it?

发布评论

评论列表(0)

  1. 暂无评论