[英]Package Manager Console Automation using DTE in Visual Studio
I am trying to automate the Package Manager Console window in Visual Studio 2012. I am DTE object to achieve the same.我正在尝试自动化 Visual Studio 2012 中的包管理器控制台窗口。我是 DTE 对象来实现相同的目标。 By using below code line I am able to open the Package Manager Console window.通过使用下面的代码行,我可以打开包管理器控制台窗口。
DTE.ExecuteCommand("View.PackageManagerConsole");
Now I want to pass few parameter to this window.现在我想向这个窗口传递几个参数。 Basically below parameter I want to pass基本上低于我想传递的参数
add-migration 'migrationName'
I also want to pass the default project name to the PMC window.我还想将默认项目名称传递给 PMC 窗口。
Please help me to achieve this functionality.请帮我实现这个功能。
Thanks!谢谢!
The best way for running a script in package manager console is parameter passing into it.在包管理器控制台中运行脚本的最佳方式是向其中传递参数。
var script = "function global:SaveAll {write-host \"All files saved.\"} SaveAll";
_ObjDTE.ExecuteCommand("View.PackageManagerConsole", script);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.