在安装NuGet软件包期间是否可以修改VS项目文件? [英] Is it possible to modify VS project file during NuGet package installation?

查看:64
本文介绍了在安装NuGet软件包期间是否可以修改VS项目文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个自定义MSBuild任务并将其作为NuGet软件包分发.要启用我的任务,应修改Visual Studio项目文件.

I'd like to create a custom MSBuild task and distribute it as a NuGet package. To enable my task, the visual studio proj file should be modified.

在安装NuGet软件包时是否可以将我的代码段添加到proj文件中?

Is it possible to add my code sections to the proj file when installing the NuGet package?

推荐答案

您可以使用Powershell进行此操作.可以卸载项目,编辑项目文件并重新加载项目.

You can do this using Powershell. It is possible to unload you project, edit the project file and reload the project.

Scott Hanselman在这里进行了此操作: http://channel9.msdn.com/Events/MIX/MIX11/FRM09

Scott Hanselman did this here: http://channel9.msdn.com/Events/MIX/MIX11/FRM09

如果找到满足您需求的软件包,则可以使用ZIP打开nuget软件包并查看powershell脚本.那是学习这些东西的一个很好的起点.

If you find a package that does what you want, you can open the nuget package using ZIP and see the powershell scripts. Thats a good starting point to learn that stuff.

希望有帮助

这篇关于在安装NuGet软件包期间是否可以修改VS项目文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆