2

我想将 XSD 文件添加到 Nuget 包。当项目安装 Nuget 包时,该文件应包含在项目中,以便在项目的 app.config 文件中允许 Intellisense。

我可以很好地将 XSD 添加到 Nuget 包中,但我不知道如何使其显示在使用依赖项的项目中。

这可以做到吗?

FWIW 在项目的 app.config 文件中注入了一些额外的部分(通过 Nuget 的“转换”功能)。XSD 为这些额外的部分提供 Intellisense,Visual Studio 会自动选择项目(甚至解决方案)中包含的与 XML 元素声明的命名空间相匹配的 XSD 架构。

4

1 回答 1

0

Nuget 可以选择运行自定义安装 Powershell 脚本,以获取对正在安装包的项目的引用。

详细信息: http:
//docs.nuget.org/docs/creating-packages/creating-and-publishing-a-package#Automatically_Running_PowerShell_Scripts_During_Package_Installation_and_Removal

以下是一些使用示例: http:
//www.codeproject.com/Articles/209522/PowerShell-Script-Examples-for-NuGet-Packages

于 2013-03-01T12:46:12.943 回答