How to get static resources from assembly's referenced assembly

174 views Asked by At

I got an assembly, created by System.CodeDomCompiler at runtime. The compiled assembly use a referenced assembly. Further i declare CodeDomAssembly as my compiled assembly at runtime, and RefAssembly as the referenced assembly used by CodeDomAssembly.

In the RefAssembly is a static class called KeyHavester with static List and static propertys/methods. The CodeDomAssembly contains WPF-forms. I call these forms like this:

RefType = CodeDomAssembly.GetType("formname");
CodeDomAssembly.CreateInstance(.....);
MethodInfo = RefType.GetMethod("ShowDialog");
bool? dialogresult = (bool?)MethodInfo.Invoke(RefType , new object[] { });

Okay so far it works.. After the form returns with a dialogresult, there are colleced keys in KeyHavester Class. The static class KeyHavester hold all the keys and is a referenced assembly to the CodeDomAssembly. So i thought this should be accessable like this:

RefType = CodeDomAssembly.GetType("KeyHavester"); //static class in RefAssembly
MethodInfo = RefType.GetMethod("GetKeys"); //GetKeys() return a List<string> 

All i get is RefType == null. So how to access the static KeyHavester Class in the RefAssembly trough the CodeDomAssembly?

Does the RefAssembly need a public Token? RefAssembly = {FunktionBibliothek, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null}

How i get this to work?

0

There are 0 answers