如何使用 NuGet 从 Visual Studio 项目文件读取\写入设置?

发布于 2024-10-07 09:33:53 字数 214 浏览 0 评论 0原文

我有兴趣为我正在编写的文档工具创建 NuGet 包。理想情况下,我希望用户不必以任何方式配置我的工具。为了做到这一点,我需要能够从项目的 .csproj.vbproj 文件中读取一些设置,以获取由编译器。我还需要向项目添加构建后步骤。

我浏览了他们的文档,但没有看到任何提及能够做到这一点。这可能吗?如果是这样,是否有任何可用的文档或示例?

I'm interested in creating a NuGet package for a documentation tool I'm writing. Ideally, I'd like the user to not have to configure my tool in anyway. In order to do this, I need to be able to read some settings from the Project's .csproj or .vbproj file to get the path of the Xml documentation file generated by the compiler. I also need to add a post-build step to the project.

I've looked through their documentation but I haven't seen any mention of being able to do this. Is this possible? If so, is there any documentation or examples of this available?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

落花浅忆 2024-10-14 09:33:53

使用 PowerShell 脚本,您可以访问丰富的 VS DTE 对象模型。这允许您的包执行 NuGet 没有特定功能的所有类型的操作。查看此帮助主题< /strong> 有关使用 init.ps1install.ps1 的一些信息。

Using PowerShell script, you can access the rich VS DTE object model. This allows your package to do all kind of things that NuGet doesn't have specific features for. Look at this help topic for some info on using init.ps1 or install.ps1.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文