.NETGURU
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




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification