I Have a two days of "googleing" and "msdning". All information i have is how to get short name if you have strong, have an assembly loaded or something else like this. But there is no information on how to load( or just get Full name, to load using it ) the assembly when you have only short name. Assembly.Load wants FullName, Assembly.LoadPartial are deprecated and does not work. So i some in a confuse...
Asked
Active
Viewed 1,077 times
2 Answers
2
Heh...the question was stupid...i try to load "System.Math" (select this just for test) as an Assembly, but this was a class...So when i try to load System.IO.Compression it loads successfuly.
Assembly a = Assembly.LoadWithPartialName("System.IO.Compression");
textBox1.AppendText( Environment.NewLine + a.GetName().Name );

EugenOS
- 31
- 6
0
I know this question is quite old, but for other people who might be led here by Google:
Assembly.Load seems to work with the short assembly name (no version, culture or public key token) too, at least in my case.
An alternative could be:
Assembly assembly = AppDomain.CurrentDomain
.GetAssemblies()
.SingleOrDefault(assembly => assembly.GetName().Name == myAssemblyName);
Please note the security constraints on Assembly.GetName.

M.H.
- 1
- 1