简体   繁体   English

如何使用NuGet从Visual Studio Project文件读取/写入设置?

[英]How to read\write settings from a Visual Studio Project file using NuGet?

I'm interested in creating a NuGet package for a documentation tool I'm writing. 我对为正在编写的文档工具创建NuGet包感兴趣。 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. 为此,我需要能够从Project的.csproj.vbproj文件中读取一些设置,以获取由编译器生成的Xml文档文件的路径。 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? 如果是这样,是否有任何相关文档或示例?

Using PowerShell script, you can access the rich VS DTE object model. 使用PowerShell脚本,可以访问丰富的VS DTE对象模型。 This allows your package to do all kind of things that NuGet doesn't have specific features for. 这使您的程序包可以执行NuGet没有特定功能的所有事情。 Look at this help topic for some info on using init.ps1 or install.ps1 . 请查看此帮助主题,以获取有关使用init.ps1install.ps1一些信息。

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

相关问题 如何配置Visual Studio项目以从Nuget安装依赖项 - How to configure Visual Studio project to install dependencies from Nuget nuget 包不从 Visual Studio 项目读取程序集版本 - nuget pack doesn't read assembly version from Visual Studio project 从Visual Studio 2010项目文件为多个框架目标构建NuGet包 - Build NuGet package for multiple framework targets from Visual Studio 2010 project file 安装项目Visual Studio和Nuget - Setup project Visual Studio and Nuget 如何使用 Visual Studio Community 2022 中的 nuget 和 Visual Studio 代码安装同步融合 javascript? - How to install syncfusion javascript using nuget from visual studio community 2022 and visual studio code? 在不使用Visual Studio的情况下将nuget包添加到项目文件中 - Add nuget package into project file without Visual Studio 从nuget安装包将项目添加到Visual Studio 2015中的解决方案 - Installing package from nuget adds project to solution in Visual Studio 2015 如何在Visual Studio中使用OpenCV Nuget包发布我的C#项目? - How to publish my C# project using OpenCV Nuget packages in Visual Studio? 如何在Visual Studio中删除NuGet与项目的“关联”? - How do I remove NuGet “association” with the project in Visual Studio? 如何将 nuget 与 Visual Studio 一起用于 phpproj 类型的项目 - How to use nuget with Visual Studio for phpproj type project
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM