是否可以在一个解决方案中使用两个Main()? [英] Is it possible to have two Main() in one solution?

查看:179
本文介绍了是否可以在一个解决方案中使用两个Main()?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述




我是C#新手。我的应用程序(Solution)包含两个Windows应用程序

项目。他们创造了自己的.exe。输出意味着在一个解决方案中有2个Main()

方法。


是否可以这样做?如果有可能,项目A(A.exe)如何调用

项目B启动(B.exe)申请?


我可以'在项目A中添加项目引用以调用项目B,因为

项目B不包含.dll。


谢谢,

Hi,

I''m a C# newbie. My application (Solution) contains two Windows application
projects. They create their own ".exe" output that means there are 2 Main()
methods in one solution.

Is is possible to do this? If it''s possible, how Project A (A.exe) calls
Project B to start (B.exe) application?

I can''t add a project reference in Project A to call Project B because
Project B doesn''t contains .dll.

Thanks,

推荐答案

您可以使用Process.Start方法从A.exe运行B.exe
http://msdn.microsoft.com /library/de...tarttopic3.asp

ano写道:
You can use the Process.Start method to run B.exe from A.exe

http://msdn.microsoft.com/library/de...tarttopic3.asp
ano wrote:


我是'马C#新手。我的应用程序(Solution)包含两个Windows应用程序
项目。他们创造了自己的.exe。输出意味着在一个解决方案中有2个Main()
方法。

是否可以这样做?如果有可能,项目A(A.exe)如何调用项目B启动(B.exe)应用程序?

我不能在项目中添加项目引用A调用项目B,因为项目B不包含.dll。

谢谢,
Hi,

I''m a C# newbie. My application (Solution) contains two Windows application
projects. They create their own ".exe" output that means there are 2 Main()
methods in one solution.

Is is possible to do this? If it''s possible, how Project A (A.exe) calls
Project B to start (B.exe) application?

I can''t add a project reference in Project A to call Project B because
Project B doesn''t contains .dll.

Thanks,






对不起,我不是故意使用Process.Start运行B.exe。

我的意思是如何在项目A中调用项目B:Application.Run()。


谢谢。


" ad ********* @ gmail.com"写道:
Sorry I didn''t mean to run B.exe by using Process.Start.
I mean how to call Project B: Application.Run() in Project A.

thanks.

"ad*********@gmail.com" wrote:
你可以使用Process.Start方法从A.exe运行B.exe
http://msdn.microsoft.com/library/ de ... tarttopic3.asp

ano写道:
You can use the Process.Start method to run B.exe from A.exe

http://msdn.microsoft.com/library/de...tarttopic3.asp
ano wrote:


我是C#newbie 。我的应用程序(Solution)包含两个Windows应用程序
项目。他们创造了自己的.exe。输出意味着在一个解决方案中有2个Main()
方法。

是否可以这样做?如果有可能,项目A(A.exe)如何调用项目B启动(B.exe)应用程序?

我不能在项目中添加项目引用A调用项目B,因为项目B不包含.dll。

谢谢,
Hi,

I''m a C# newbie. My application (Solution) contains two Windows application
projects. They create their own ".exe" output that means there are 2 Main()
methods in one solution.

Is is possible to do this? If it''s possible, how Project A (A.exe) calls
Project B to start (B.exe) application?

I can''t add a project reference in Project A to call Project B because
Project B doesn''t contains .dll.

Thanks,







你不能。


你有一个带有两个独立可执行文件的解决方案。他们独立生活

其中一个。如果你想从

开始运行一个实例,你必须使用Process.Start。

否则,你为什么要运行B.App_Run?

-

Ignacio Machin,

ignacio.machin AT dot.state.fl.us

佛罗里达州运输部


" ano" < an*@discussions.microsoft.com>在消息中写道

新闻:是********************************** @ microsof t.com ...
Hi,

You cannot.

You have a solution with two separate executables. They live endependently
one of the other. If you want to start running an instance of one from the
other you have to use Process.Start.
Otherwise, why you want to run B.App_Run ?
--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"ano" <an*@discussions.microsoft.com> wrote in message
news:BE**********************************@microsof t.com...
抱歉,我不是故意使用Process.Start来运行B.exe。
我的意思是如何调用Project B:Application.Run()in项目A.

谢谢。

" ad ********* @ gmail.com"写道:
Sorry I didn''t mean to run B.exe by using Process.Start.
I mean how to call Project B: Application.Run() in Project A.

thanks.

"ad*********@gmail.com" wrote:
你可以使用Process.Start方法从A.exe运行B.exe
http://msdn.microsoft.com/library/ de ... tarttopic3.asp

ano写道:
You can use the Process.Start method to run B.exe from A.exe

http://msdn.microsoft.com/library/de...tarttopic3.asp
ano wrote:
>
>
>我是C#新手。我的应用程序(解决方案)包含两个Windows
>申请
>项目。他们创造了自己的.exe。输出意味着有2
>主要()
>一种解决方案中的方法。
>
>有可能这样做吗?如果有可能,项目A(A.exe)如何>电话
>项目B启动(B.exe)申请?
>
>我不能在项目A中添加项目参考来调用项目B,因为
>项目B不包含.dll。
>
>谢谢,
> Hi,
>
> I''m a C# newbie. My application (Solution) contains two Windows
> application
> projects. They create their own ".exe" output that means there are 2
> Main()
> methods in one solution.
>
> Is is possible to do this? If it''s possible, how Project A (A.exe)
> calls
> Project B to start (B.exe) application?
>
> I can''t add a project reference in Project A to call Project B because
> Project B doesn''t contains .dll.
>
> Thanks,




这篇关于是否可以在一个解决方案中使用两个Main()?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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