Reputation: 1809
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.
Upvotes: 1
Views: 365
Reputation: 17162
Not 100% sure about that, but I think that Assembly.EntryPoint
is null for DLLs.
Upvotes: 1