471,321 Members | 1,662 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,321 software developers and data experts.

Assembly class changed without keeping compatibility in .NET 2 ?

WT
Hello,
I am migratingcode from .NET 1.1 to 2 (Raibow project) and in this code we
where storing assembly name in database just to be able to load it
dynamically later.
Code in the register method was
// Get Assembly name

string assemblyName = portalModule.GetType().BaseType.Assembly.CodeBase;
assemblyName = assemblyName.Substring(assemblyName.LastIndexOf('/') +1);
//Get name only

this code was giving the simple assembly name

this has been broken in .NET 2 as we get the name of the temporary assembly
generated by compiler, each call gives a different name.

How to get the ability to get dynamically the name of an assembly ?

Thanks for help.

CS
Jan 18 '06 #1
1 1054
To get the assembly name from current executing application in .NET 2.0,
you may use following code:

System.Reflection.Assembly.GetExecutingAssembly(). FullName

Hope this help,

Luke Zhang

Jan 19 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

10 posts views Thread by Simon Wallis | last post: by
3 posts views Thread by Atul Godbole | last post: by
10 posts views Thread by jojobar | last post: by
4 posts views Thread by Tiraman | last post: by
6 posts views Thread by Nak | last post: by
2 posts views Thread by john | last post: by
21 posts views Thread by phpCodeHead | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.