|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Reflection.Emit questionWhen creating types with Reflection.Emit, is it possible to define
namespaces? I've just begun to delve into this functionality and I saved one of my dynamic assemblies to disk. Then I referenced it in a project and viewed it in the object browser. The types I created were directly underneath the assembly icon in the tree view as opposed to there being a namespace icon. Ultimately, I'm trying to reference a type I've created in this dynamic assembly by specifying its type name as a string and using...oh, damn. I just remembered reading about Type.GetType() and how it can't return types from dynamic assemblies that haven't been saved to disk. Crap. Well, just for curiosity's sake, does anyone know the answer to the first question? In article <eKYYLXk7GHA.***@TK2MSFTNGP03.phx.gbl>, i.get@enough.spam
says... > When creating types with Reflection.Emit, is it possible to define I think you just create the entire class name with a namespace. So if > namespaces? I've just begun to delve into this functionality and I saved one > of my dynamic assemblies to disk. Then I referenced it in a project and > viewed it in the object browser. The types I created were directly > underneath the assembly icon in the tree view as opposed to there being a > namespace icon. you wanted a namespace called "JJ" and a class called "Auto", you'd emit a class called "JJ.Auto".
Show quote
"Patrick Steele" <patr***@mvps.org> wrote in message Bingo! Worked perfectly. I never would have thought of such a simple thing.news:MPG.1f9898b66c7f0c269896af@msnews.microsoft.com... >> When creating types with Reflection.Emit, is it possible to define >> namespaces? I've just begun to delve into this functionality and I saved >> one >> of my dynamic assemblies to disk. Then I referenced it in a project and >> viewed it in the object browser. The types I created were directly >> underneath the assembly icon in the tree view as opposed to there being a >> namespace icon. > > I think you just create the entire class name with a namespace. So if > you wanted a namespace called "JJ" and a class called "Auto", you'd emit > a class called "JJ.Auto". |
|||||||||||||||||||||||