views:

207

answers:

1

How would one use .net reflection to determine the type of the executing assembly, by type I mean dll or exe. Currently its possible to do something like:

Assembly.GetExecutingAssembly().CodeBase.ToLower.EndsWith(".exe")

But it seems like something better could exist that does not need to do a string comparison, i.e. comparing the assemblies module name would also fall into this category.

A: 

Not 100% sure about that, but I think that Assembly.EntryPoint is null for DLLs.

ybo