"Arne Vajhøj"<
[email protected]> skrev i meddelandet
On 22-07-2010 12:58, Tony Johansson wrote:
If I have an exe file that is using an assembly dll and this exe file
is
to
be run in an application domain do I then have to load this dll into
this
application domain ?
I mean if the exe file and the dll is located in the same folder will
the
exe file automatically use this dll which mean that I don't have to
load
the
dll explicitly into the application domian.
If you don't do anything special, then everything ends up in the
same app domain.
In general app domains (besides the default) is not something you use
that
often.
Arne
Hello!
I have done the following. I have created an exe file that is using an
assembly dll to just write something to the console.
the assembly dll have this code "Console.WriteLine("Running c-tor in
ClassLibrary1");"
I have a reference to this assembly dll in the project. I call this exe
file
that should echo something to the consolse for Test.exe and the assembly
dll
is called testdll.dll.
Now I have another exe file that have this code
static void Main(string[] args)
{
AppDomain d = AppDomain.CreateDomain("newDomain");
d.ExecuteAssembly("Test.exe");
}
This works good the assembly dll(testdll.dll) is automatically called
when
Test.exe is called.
So my question remain when do I have to use AppDomail.Load. The docs says
Loads an Assembly into this application domain.
I can't see any point why this AppDomain.Load exist because you can use
this
command
d.ExecuteAssembly("Test.exe");
to have Test.exe execute without having to use any kind of load command
even
if this Test.exe is using other assembly dll
this will automatically be called just as my example show.