Creating an appdomain
Messages   Related Types
This message was discovered on microsoft.public.dotnet.framework.clr.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.
Post a new message to this list...

Alok
I want to execute two instances of a c# windows app exe in two different
domains.
If I simply execute the exe twice, the windows form does not seem to be
showing twice as i would expect.
However I think it should be possible if I execute the assembly in separate
domains.

Please let me know if it is possible. And if not then why its not possible.

Thanks.
Alok.

Reply to this message...
 
    
Girish bharadwaj
Check out AppDomainSetup class overview in MSDN.

"Alok" <Click here to reveal e-mail address> wrote in message
news:Click here to reveal e-mail address...
[Original message clipped]

Reply to this message...
 
    
Ian Griffiths (VIP)
"Alok" wrote:
[Original message clipped]

The best way to do this is to run them in two different processes.

If you try to run the application in two different AppDomains inside the
same process you may hit problems. The comments at the end of this post
indicate some of the problems:

http://weblogs.asp.net/asanto/archive/2003/05/21/7327.aspx

If I remember correctly, calling Application.Exit in one domain took out all
the AppDomains in the process if you are running v1.0 of .NET. (I've not
tried it recently, so I'm not sure what happens in the current version.
Also, if memory serves, the code in question had one Win32 thread that ended
up participating in Windows Forms stuff in multiple AppDomains. You might
have more luck if you used one thread per 'application'. But I'm not really
sure - I'd avoid it to be honest.)

[Original message clipped]

Are you actually just running the EXE twice? Normally that works. If it
doesn't, it's usually because the code has been written explicitly to
prevent the application from being run more than once. If that's the case,
explicitly creating multiple AppDomains isn't going to help you...

--
Ian Griffiths - http://www.interact-sw.co.uk/iangblog/
DevelopMentor - http://www.develop.com/

Reply to this message...
 
 
System.AppDomainSetup
System.Windows.Forms.Application




Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
 
 Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us - Terms of Use - Privacy Policy - www.dotnet247.com