创建Visual Studio实例 [英] Create an Instance of Visual Studio

查看:101
本文介绍了创建Visual Studio实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我的C#应用​​程序有以下代码来创建

Visual Studio的实例。


系统。 Type type = System.Type.GetTypeFromProgID(" VisualStudio.DTE。

8.0");

Object obj = System.Activator.CreateInstance(type,true);

EnvDTE80.DTE2 dte8Obj =(EnvDTE80.DTE2)obj;

MessageFilter.Register();

dte8Obj.MainWindow.Visible = false;


此代码在安装了Visual Studio的PC中正常工作,但没有

只在安装了Framework的PC上工作。

如何在只安装了框架的PC上完成这项工作?


我使用的是Visual Studio 2005


谢谢

miztaken

Hi,
My C# application have a following code to create an instance of
Visual Studio.

System.Type type = System.Type.GetTypeFromProgID("VisualStudio.DTE.
8.0");
Object obj = System.Activator.CreateInstance(type, true);
EnvDTE80.DTE2 dte8Obj = (EnvDTE80.DTE2)obj;
MessageFilter.Register();
dte8Obj.MainWindow.Visible = false;

This code work ok in the PC with Visual Studio Installed but doesnt
work in the PC with only Framework installed.?

How can i make this work in PC with only framework installed?

I am using Visual Studio 2005

Thank You
miztaken

推荐答案

On Sun,2008年8月24日00:08:21 -0700,miztaken< ju ** ********@gmail.com>

写道:
On Sun, 24 Aug 2008 00:08:21 -0700, miztaken <ju**********@gmail.com>
wrote:

[...]

此代码在PC中正常工作Visual Studio安装但没有

只在安装了Framework的PC上工作。


如何在只安装了框架的PC上完成这项工作?
[...]
This code work ok in the PC with Visual Studio Installed but doesnt
work in the PC with only Framework installed.?

How can i make this work in PC with only framework installed?



也许我对你的问题遗漏了一些东西,但是...


如果你没有安装Visual Studio后,你根本无法创建一个

的实例。这就是安装它的意思:你复制产品运行所需的代码

(包括

应用程序可能支持的任何COM自动化)。这就是整个安装点。


Pete

Maybe I''m missing something about your question, but...

If you don''t have Visual Studio installed, you simply cannot create an
instance of it. That''s what it means to install it: you copy the code
that is required for the product to run (including any COM automation the
application might support). That''s the whole point of installation.

Pete


如果您没有安装Visual Studio,那么你根本无法创建一个*
If you don''t have Visual Studio installed, you simply cannot create an *

的实例。 *这就是安装它的意义:你复制产品运行所需的代码*

(包括任何COM自动化*

应用程序可能支持)。 *这是整个安装点。
instance of it. *That''s what it means to install it: you copy the code *
that is required for the product to run (including any COM automation the*
application might support). *That''s the whole point of installation.



所以你的意思是我要让我的客户安装Visual Studio IDE来运行我的应用程序吗?

这似乎不是可行的解决方案..


如果此代码

System.Type type = System.Type.GetTypeFromProgID(" VisualStudio.DTE。

8.0");

Object obj = System.Activator.CreateInstance(type,true);

EnvDTE80.DTE2 dte8Obj =(EnvDTE80.DTE2)obj;

MessageFilter.Register();

dte8Obj.MainWindow.Visible = false;


需要Visual Studio安装然后我们如何发货呢?


谢谢

miztaken

So do you mean i have to ask my client to install visual studio IDE to
run my application?
This doesn''t seem to be feasible solution..

If this code
System.Type type = System.Type.GetTypeFromProgID("VisualStudio.DTE.
8.0");
Object obj = System.Activator.CreateInstance(type, true);
EnvDTE80.DTE2 dte8Obj = (EnvDTE80.DTE2)obj;
MessageFilter.Register();
dte8Obj.MainWindow.Visible = false;

required Visual Studio installed then how can we ship it?

Thank You
miztaken


不,要求用户使用Visual Studio似乎不可行。那你为什么要这样做呢?你想让他们用IDE做什么?


" miztaken" < ju ********** @ gmail.comwrote in message

新闻:aa ******************** ************** @ p31g2000 prf.googlegroups.com ...
No, requiring users to have Visual Studio does not seem feasible. Why are
you doing this then? What do you want them to do with the IDE?

"miztaken" <ju**********@gmail.comwrote in message
news:aa**********************************@p31g2000 prf.googlegroups.com...

如果你没有安装Visual Studio ,你根本无法创建一个

的实例。这就是安装它的意思:你复制产品运行所需的代码

(包括

应用程序可能支持的任何COM自动化)。这就是整个安装点。
If you don''t have Visual Studio installed, you simply cannot create an
instance of it. That''s what it means to install it: you copy the code
that is required for the product to run (including any COM automation the
application might support). That''s the whole point of installation.



所以你的意思是我要让我的客户安装Visual Studio IDE来运行我的应用程序吗?

这似乎不是可行的解决方案..


如果此代码

System.Type type = System.Type.GetTypeFromProgID(" VisualStudio.DTE。

8.0");

Object obj = System.Activator.CreateInstance(type,true);

EnvDTE80.DTE2 dte8Obj =(EnvDTE80.DTE2)obj;

MessageFilter.Register();

dte8Obj.MainWindow.Visible = false;


需要Visual Studio安装然后我们如何发货呢?


谢谢

miztaken

So do you mean i have to ask my client to install visual studio IDE to
run my application?
This doesn''t seem to be feasible solution..

If this code
System.Type type = System.Type.GetTypeFromProgID("VisualStudio.DTE.
8.0");
Object obj = System.Activator.CreateInstance(type, true);
EnvDTE80.DTE2 dte8Obj = (EnvDTE80.DTE2)obj;
MessageFilter.Register();
dte8Obj.MainWindow.Visible = false;

required Visual Studio installed then how can we ship it?

Thank You
miztaken

这篇关于创建Visual Studio实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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