TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Mari R
NA
3
0
Problem with a constructor
Sep 23 2005 9:42 AM
I'm trying to create a dynamic proxy. I have define a typebuilder : AppDomain myDomain = Thread.GetDomain(); AssemblyName assemblyName = new AssemblyName(); assemblyName.Name = "Intercep"; asmBuilder = myDomain.DefineDynamicAssembly( assemblyName,AssemblyBuilderAccess.RunAndSave); modBuilder = asmBuilder.DefineDynamicModule(asmBuilder.GetName().Name, false); typeBuilder = modBuilder.DefineType (asmBuilder.GetName().Name + ".__Proxy" + interfaceType.Name + targetType.Name, TypeAttributes.Class | TypeAttributes.Public, targetType.BaseType, new Type [] {interfaceType, typeof EmitedInfo)}); fbTarget = typeBuilder.DefineField ("target", typeof(object), FieldAttributes.Private); fbIface = typeBuilder.DefineField ("iface", typeof (Type), FieldAttributes.Private); Type[] types =new Type [2]; types[0] = typeof(object); types[1] = typeof(Type); ConstructorBuilder Ctor = typeBuilder.DefineConstructor(MethodAttributes.Public,CallingConventions.Standard, types); And then when i try this type= typeBuilder.CreateType(); an invalid operation exception I would appreciate any kind of help, thank you very much.
Reply
Answers (
0
)
what am I doing wrong with this control?
Nested repeaters - Dont show parent if child is empty