简体   繁体   English

Nuget:将文件添加到使用中的项目吗?

[英]Nuget: Add file to consuming project?

I would like to add an XSD file to a Nuget package. 我想将一个XSD文件添加到Nuget包中。 When a project installs the Nuget package, this file should be included in the project, in order to allow Intellisense in the project's app.config file. 当项目安装Nuget软件包时,此文件应包含在项目中,以便允许在项目的app.config文件中使用Intellisense。

I can add the XSD to the Nuget package just fine, but I don't know how to make it show up in the project that uses the dependency. 我可以将XSD添加到Nuget包中很好,但是我不知道如何在使用依赖项的项目中显示它。

Can this be done? 能做到吗?

FWIW There are some extra sections injected in the project's app.config file (via Nuget's "transform" capability ). FWIW(通过Nuget的“ transform”功能 ),在项目的app.config文件中注入了一些额外的部分。 The XSD offers Intellisense for those extra sections, and Visual Studio automatically picks up XSD schemas included in the project (or even solution) that match the declared namespace of the XML elements. XSD为那些多余的部分提供了Intellisense,Visual Studio会自动选择项目(甚至解决方案)中包含的与XML元素的声明名称空间匹配的XSD模式。

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

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