The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

import-bot (20211) [Avatar] Offline
#1
[Originally posted by zameerm]

Can't we access a shared assembly like a private assembly.
Just by giving "using publicassemblyname;" can't we access.
Right now I am using reflection API to load the assembly as shown below:
Assembly ObjAsm = Assembly.Load( "Utilities, Version=0.0.0.1, Culture=neutral,
PublicKeyToken=c34a7a1c2598dc8c ");
Type TypeAsm = ObjAsm.GetType("Utilities.Database");
MethodInfo callMethod = TypeAsm.GetMethod(strMethodName);
Object obj = Activator.CreateInstance(TypeAsm);
DataSet ds = (DataSet)callMethod.Invoke(obj, args);

If I try using like a private assembly it is not compiling.
I would be glad if someone can help me on this.
import-bot (20211) [Avatar] Offline
#2
Re: accessing a shared assembly
[Originally posted by fgrimes]

Zameer,

I'm not clear exactly what the difficulty is. In the example you give, you
are using reflection to reference the assembly at runtime, not compile-time.
Therefore the compilation error likely refers to something else. Please post
the error here and we'll take a look.

Regards,
Fergal