If the assembly in question is a library, I want to be able to load it
into memory before creating a class out of it. This is for a system that
sends messages of various types over MSMQ in serialized XML with no way
of guaranteeing that the listener will already have the assembly loaded.

The only assemblies we could guarantee would be running are the
executable and the messaging library (aka GOURMET.) Since message types
are defined in the executable, GOURMET, and third-party libraries, we're
trying to avoid trying to load either GOURMET or the executable at
runtime (when they are guaranteed to already be loaded.)

--Jekke

-----Original Message-----
From: Discussion of advanced .NET topics.
[mailto:[EMAIL PROTECTED] On Behalf Of Eric Means
Sent: Wednesday, January 04, 2006 4:42 PM
To: ADVANCED-DOTNET@DISCUSS.DEVELOP.COM
Subject: Re: [ADVANCED-DOTNET] Is this System.Assembly an executable or
a library?


System.IO.Path.GetExtension(Assembly.GetModules()[0].FullyQualifiedName)
would work similarly.

>From a practical perspective, I'm not sure there's much difference
between
an EXE assembly and a DLL assembly, except that the EXE contains a shim
to
kick off the .Net core and start the EXE's Main() function. Out of
curiousity, why do you need to know?

On 1/4/06, David Lanouette <[EMAIL PROTECTED]> wrote:
>
> I doubt that this is the best way, but...
>
>         if (Assembly.GetExecutingAssembly().Location.EndsWith(".dll"))
>             Console.WriteLine("Dll");
>         else
>             Console.WriteLine("exe");
>
>
>
>
>
> On 1/4/06, Jekke Bladt <[EMAIL PROTECTED]> wrote:
> > All--
> >
> > Is there a straightforward way to determine from an Assembly object
> > whether it is an executable or a library?
> >
> > TIA
> >
> > --Jekke
> >
> > ===================================
> > This list is hosted by DevelopMentor(r)  http://www.develop.com
> >
> > View archives and manage your subscription(s) at
> http://discuss.develop.com
> >
>
>
> --
> ______________________________
> - David Lanouette
> - [EMAIL PROTECTED]
>
> ===================================
> This list is hosted by DevelopMentor(r)  http://www.develop.com
>
> View archives and manage your subscription(s) at
> http://discuss.develop.com
>



--
Eric Means
[EMAIL PROTECTED]
http://www.randomtree.org/eric/

===================================
This list is hosted by DevelopMentor(r)  http://www.develop.com

View archives and manage your subscription(s) at
http://discuss.develop.com

===================================
This list is hosted by DevelopMentor®  http://www.develop.com

View archives and manage your subscription(s) at http://discuss.develop.com

Reply via email to