Michael Sander
9/10/2008 1:05:00 PM
Hello ng,
i've created a interface IDynamicInterface in an dynamic assembly that uses
another interface IBaseInterface.
If IBaseInterface is created in the same dynamic assembly it is shown in
Class Viewer as base type of IDynamicInterface.
If IBaseInterface is defined in some other assembly it is not shown.
Anyone knows how to solve this issue?
Regads,
Michael
string fileName = "assembly.dll";
AssemblyName aName = new
AssemblyName(Path.GetFileNameWithoutExtension(fileName));
AssemblyBuilder aBuilder =
AppDomain.CurrentDomain.DefineDynamicAssembly(aName,
AssemblyBuilderAccess.Save);
ModuleBuilder mBuilder = aBuilder.DefineDynamicModule(aName.Name, fileName);
TypeBuilder tBuilder = mBuilder.DefineType("IDynamicInterface",
TypeAttributes.Public | TypeAttributes.Interface | TypeAttributes.Abstract);
tBuilder.AddInterfaceImplementation(typeof(IBaseInterface));
tBuilder.CreateType();
aBuilder.Save(fileName);