Rob,
You are right about the reflection. When I say through Interop I mean how
my class is actual called. I have a .Net dll with a very simple class that
is setup for interop. The simple class internal uses reflection to create a
class from a string to use for some calculations and returns a result. This
is where my problems comes in. The CreateInstance always returns null.
Hopefully I've cleared up the confusion.
Thanks,
Eric
[quoted text, click to view] "Robert Jordan" <robertj@gmx.net> wrote in message
news:dj87ae$ih6$03$1@news.t-online.com...
> Eric,
>
>> The classname is prefixed with the full namepsace. This class does
>> have a public constructor with no parameters. This all works if I call
>> it from another .Net application so I'm pretty sure I'm compiling and
>> creating the Instance correctly. I'm just having problems when I go
>> through interop.
>
> What do you mean with "through interop". CreateInstance is actually
> reflection.
>
> Rob
>
>
>>
>> Thanks,
>>
>> Eric
>>
>>
>>
>> "Robert Jordan" <robertj@gmx.net> wrote in message
>> news:dj864n$9hk$04$1@news.t-online.com...
>>
>>>Eric,
>>>
>>>
>>>> The Compiler.Errors.Count = 0. I also checked the temp diectory an a
>>>> dll is created. Is there anything else I should check?
>>>
>>>Check the class name. It should include the name space as well.
>>>Does the class have a public ctor?
>>>
>>>Rob
>>>
>>>
>>>
>>>>Thanks,
>>>>
>>>>Eric
>>>>
>>>>
>>>>"Robert Jordan" <robertj@gmx.net> wrote in message
>>>>news:dj81bi$bba$05$1@news.t-online.com...
>>>>
>>>>
>>>>>Eric,
>>>>>
>>>>>
>>>>>
>>>>>>I have a .Net class in a dll that compiles code on the fly.
>>>>>>Everything is working great from all .Net applications. I'm now
>>>>>>trying to make this class Interopable. I don't receive any erros
>>>>>>after calling CompileAssemblyFromSource but when I try to create a
>>>>>>instance of my class
>>>>>>(CompiledAssembly.CreateInstance(targetClassName)) I get a null value
>>>>>>returned. No exceptions or other errors are reported. Has anyone
>>>>>>tried compiling code on the fly in an Interop class? I'm starting to
>>>>>>think maybe it's a security issue but I thought I would have gotten an
>>>>>>exception. This one has caused me problems for days.
>>>>>
>>>>>Check the Errors property of the compiler object to see
>>>>>whether the assembly has been generated at all.
>>>>>
>>>>>Rob
>>>>
>>>>
>>