简体   繁体   English

StyleCop.Analyzers Nuget 依赖项

[英]StyleCop.Analyzers Nuget Dependencies

I have created a Nuget package on a private Azure Artifacts environment, that houses a custom configuration for StyleCop.Analyzers so that the configuration for coding standards can be centralised.我在私有 Azure Artifacts 环境中创建了一个 Nuget 包,其中包含 StyleCop.Analyzers 的自定义配置,以便可以集中编码标准的配置。 This all works absolutely fine and can be installed in other projects with no issue.这一切都非常好,可以毫无问题地安装在其他项目中。

I have a separate class library which is being built into a Nuget package, and this project utilises my custom StyleCop package.我有一个单独的类库,它被内置到 Nuget 包中,这个项目利用了我的自定义 StyleCop 包。 This package also builds correctly, but in the list of dependencies is my custom StyleCop.Analyzers package.这个包也可以正确构建,但在依赖项列表中是我的自定义 StyleCop.Analyzers 包。 This means that everywhere the class library gets installed, the custom StyleCop.Analyzers package will be installed as well.这意味着在安装类库的任何地方,都会安装自定义 StyleCop.Analyzers 包。 I don't feel this is correct as it is purely a development-scoped package and should not be included as an actual dependency.我认为这是不正确的,因为它纯粹是一个开发范围的包,不应作为实际依赖项包含在内。

The class library does not feature a .nuspec file, everything is handled through the .csproj and some Azure Pipeline's wizardry.类库没有.nuspec文件,一切都通过.csproj和一些 Azure Pipeline 的魔法来处理。 Is the dependency chain correct, or is there something that can be done to ensure that the custom StyleCop.Analyzers package is not listed as a dependency?依赖链是否正确,或者是否可以采取一些措施来确保自定义 StyleCop.Analyzers 包未列为依赖项?

事实证明,如果您将<devDependency>true</devDependency>节点添加到.nuspec文件,则依赖项不会发送到使用它的包。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM