如何添加exe作为参考VS 2010 [英] How to ADD exe as reference VS 2010

查看:96
本文介绍了如何添加exe作为参考VS 2010的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我的问题是:



如何添加exe作为参考?



更多解释

我怀疑使用Visual Studio 2010 如何添加 exe作为参考;

以下是我实际尝试做的事情的一部分:



要将其嵌入到您自己的应用中,只需参考EXE好像它是来自Visual Studio中的应用程序的DLL。

它应该显示在Visual Studio的工具箱窗口中。




我真的不知道我是否以正确的方式添加它。



我试着按照这篇文章的说明去做:

基于Windows窗体的HTML输出文本编辑器 [ ^ ]

但是它无效。



i'm请求帮助,因为我是VS 2010的新手。



你知道答案吗?

So my questions is:

How do i add an exe as reference?

More explanation:
Im having a doubt of how to add an exe as reference using Visual Studio 2010;
Here is a part of what im actually trying to do:

To embed it into your own app, simply reference the EXE as if it were a DLL from your app in Visual Studio.
It should show up in the Toolbox Window in Visual Studio.


I dont really know if im adding it the correct way.

Im trying to do it as explained in this post:
A Windows Forms based text editor with HTML output[^]
But its not working.

i´m asking help because im new to VS 2010.

Do you know the answer?

推荐答案

对于你引用的情况,说明是错误的。



首先是一个小信息。该可执行文件是针对.Net 4.0 Full Framework编译的。您将需要使用VS2010或更高版本,并将您的应用程序设置为使用完整框架而不是客户端。



您可以将可执行文件的控件添加到工具箱中右键单击工具箱并选择选择项目,然后在.Net选项卡下面点击浏览按钮。然后导航到存储文件的位置并将其选中。然后它应该显示在您的工具箱中,名称为编辑器。我建议你右键单击Toolbox-General选项卡或添加一个新选项卡,以便更容易找到添加控件。
For the case that you have referenced, the instructions are wrong.

A little info first. That executable was compiled against the .Net 4.0 Full Framework. You will need to use VS2010 or higher and set your application to use the full framework and not the client.

You can add the control for the executable to your toolbox by right clicking on the toolbox and selecting "choose items" and then clictthe "Browse" button under the ".Net Tab". Then navigate to where you stored the file and selct it. It should then show up in your Toolbox with the name "editor". I suggest that you right click on the Toolbox-General tab or add a new tab so that you can locate the add control more easily.


First embedding vs。 引用



如果你想能够在EXE中使用类似于它的DLL,那么你想要参考它。



如果你想将EXE作为资源包含在你的应用程序中,也许你可以在客户端上重新发布它,那么你想要嵌入它。



我认为你的意思是参考



您所遵循的说明是引用托管可执行文件的正确方法。 托管可执行文件 [ ^ ]是使用 .NET语言创建的窗口[ ^ ]并编译为CIL [ ^ ]。



我觉得你试图引用一个非托管代码的EXE。这是可能的,但是非常不同,并且使用 native interop
First embedding vs. referencing.

If you want to be able to use classes in the EXE as if it were a DLL, then you want to reference it.

If you want to include the EXE as a resource inside your application, perhaps so you can redistribute it on the client, then you want to embed it.

I think you mean reference.

The instructions that you are following is the correct way to reference a managed executable. A managed executable[^] is one that was created using a .NET language[^] and compiled to CIL[^].

I have a feeling that you are trying to reference an EXE that is not managed code. This is possible, but is very different, and uses native interop.


在项目的引用中引用可执行文件是一回事(你必须这样做)。如果您没有更改默认布局,则必须在右侧,解决方案资源管理器中完成。



如果您需要要使用此可执行文件中定义的某些控件,您必须将这些控件添加到左侧的工具箱中:

右键单击工具箱内部,然后选择选择元素。 ..';然后去搜索你想要添加/使用的控件。



希望这有帮助。
Referencing the executable in the project's references is one thing (that you have to do). If you did not change the default layout, it has to be done on the right side, in the Solution Explorer.

If you want to use some controls that are defined in this executable, then you have to add these controls to the toolbox, which is on the left side:
Right click inside the Tool Box, and choose 'Choose elements...'; then go and search for the controls you want to add/use.

Hope this helps.


这篇关于如何添加exe作为参考VS 2010的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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