使用 Visual Studio 扩展修改 app.config 文件

发布于 2024-07-13 07:16:30 字数 300 浏览 5 评论 0原文

我正在尝试创建一个 Visual Studio 扩展(加载项或 VSPackage),它将执行以下操作:

1)查找当前解决方案中的所有选定项目。 2) 获取每个项目的app.config或web.config文件的访问权限并修改它。

我已经能够找出加载项和 VSPackage 的步骤 1。 我还没有找到执行步骤 2) 的方法。 有谁有可以帮助我完成步骤 2) 的博客/文档吗?

另外,您会为这样的项目推荐哪种可扩展性选项? 加载项还是 VSPackage?

谢谢,

阿玛格

I am trying to create a Visual Studio Extension (either Add-In or VSPackage) that will do the following:

1) Find all selected projects in the current solution.
2) Obtain access to each project's app.config or web.config file and modify it.

I have been able to figure out step 1 for both an Add-In and a VSPackage. I haven't managed to figure out a way to do step 2). Does anyone have pointers to a blog / documentation that can help me complete step 2) ?

Also, which extensibility option would you recommend for such a project? An Add-In or a VSPackage?

Thanks,

armahg

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

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

发布评论

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

评论(1

攒一口袋星星 2024-07-20 07:16:31

既然您已经选择了项目,为什么不检查项目目录是否有 web.config/app.config 文件以及它们是否存在然后编辑它们? 它们只是 xml 文件。

Since you have the selected projects, why just don't check if project directory has web.config/app.config files and if they exist then edit them? They are just xml files.

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