简体   繁体   English

在 Visual Studio 中使用 DTE 的包管理器控制台自动化

[英]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.

相关问题 如何从外部 DTE 检索 IVsDebugger 以在 Visual Studio 2019 中实现自动化 - How to retrieve IVsDebugger from external DTE for automation in Visual Studio 2019 使用Visual Studio DTE分析源代码 - Using Visual Studio DTE to analyze source code 在 Visual Studio 中为 ASP.NET MVC 使用 package 管理器控制台安装 Package 时面临问题 - Facing issue while installing Package using package Manager console in Visual Studio for ASP.NET MVC 在扩展中以编程方式访问visual studio的powershell控制台(包管理器控制台) - Access the powershell console (package manager console) of visual studio programmatically in an extension 什么是Visual Studio DTE? - What is the Visual Studio DTE? Package Manager Console Visual Studio 2019 返回新行 - Package Manager Console Visual Studio 2019 Returns New Line 从visual studio命令提示符运行nuget包管理器控制台 - Run nuget package manager console from visual studio command prompt 使用 DTE 激活 Visual Studio 的输出窗口 - Activate Visual Studio's Output window using DTE 如何使用NuGet软件包管理器控制台在Visual Studio 2012 Pro上安装OpenPop.NET? - How can i install OpenPop.NET on my visual studio 2012 pro using the NuGet package manager console? 如何从Visual Studio中的包管理器控制台调用针对SQL Azure的update-database? - How to call update-database from package manager console in Visual Studio against SQL Azure?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM