[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.interop

Problems registering C# COM object manually

miikka.laakso

11/23/2006 8:27:00 AM

Whenever I try to use the class (in the normal C++) from the COM object
I get the "Class not registered" error. I have tried to register the
object with commands "regasm.exe MyModule.dll" and "regasm.exe
MyModule.dll /codebase" but neither of them doesn't work.

What is the correct way to register C# COM object class manually?

7 Answers

Jigar Mehta

11/23/2006 2:29:00 PM

0

Hello,

The correct way to register the C# assembly for interop is,
1. to put the assembly in GAC and register it.
2. to put anywhere other than GAC and register with /codebase option.

For your problem, it seems that you will have to register the assembly
with /tlb option like,
regasm.exe /codebase /tlb <assemblyname>

And import that TLB file while compiling your application.

Let me know if that does not work.

regards,
jigar

On Nov 23, 1:27 pm, miikka.laa...@kaannos.com wrote:
> Whenever I try to use the class (in the normal C++) from the COM object
> I get the "Class not registered" error. I have tried to register the
> object with commands "regasm.exe MyModule.dll" and "regasm.exe
> MyModule.dll /codebase" but neither of them doesn't work.
>
> What is the correct way to register C# COM object class manually?

miikka.laakso

11/24/2006 8:54:00 AM

0

Hi

I have imported the typelibrary and actually I don't have any problems
with it on my developing machine, but when I try to use it in my
testing machine (x64) it says that the "Class it not registered".

I should have all needed dlls, and all other dlls are registered
properly. My dlls reside on different path than the executable, but
shouldn't codebase attribute solve this?

My dll is not used for general purposes, so it might not be wise to
install it to GAC?


Jigar Mehta kirjoitti:

> Hello,
>
> The correct way to register the C# assembly for interop is,
> 1. to put the assembly in GAC and register it.
> 2. to put anywhere other than GAC and register with /codebase option.
>
> For your problem, it seems that you will have to register the assembly
> with /tlb option like,
> regasm.exe /codebase /tlb <assemblyname>
>
> And import that TLB file while compiling your application.
>
> Let me know if that does not work.
>
> regards,
> jigar
>
> On Nov 23, 1:27 pm, miikka.laa...@kaannos.com wrote:
> > Whenever I try to use the class (in the normal C++) from the COM object
> > I get the "Class not registered" error. I have tried to register the
> > object with commands "regasm.exe MyModule.dll" and "regasm.exe
> > MyModule.dll /codebase" but neither of them doesn't work.
> >
> > What is the correct way to register C# COM object class manually?

Jigar Mehta

11/24/2006 1:27:00 PM

0

Hello,

Can you try registering your C# component on deployment box with /tlb option?

=============
Regards,
Jigar Mehta

> Hi
>
> I have imported the typelibrary and actually I don't have any problems
> with it on my developing machine, but when I try to use it in my
> testing machine (x64) it says that the "Class it not registered".
>
> I should have all needed dlls, and all other dlls are registered
> properly. My dlls reside on different path than the executable, but
> shouldn't codebase attribute solve this?
>
> My dll is not used for general purposes, so it might not be wise to
> install it to GAC?
>
> Jigar Mehta kirjoitti:
>
>> Hello,
>>
>> The correct way to register the C# assembly for interop is,
>> 1. to put the assembly in GAC and register it.
>> 2. to put anywhere other than GAC and register with /codebase option.
>> For your problem, it seems that you will have to register the
>> assembly
>> with /tlb option like,
>> regasm.exe /codebase /tlb <assemblyname>
>> And import that TLB file while compiling your application.
>>
>> Let me know if that does not work.
>>
>> regards,
>> jigar
>> On Nov 23, 1:27 pm, miikka.laa...@kaannos.com wrote:
>>
>>> Whenever I try to use the class (in the normal C++) from the COM
>>> object I get the "Class not registered" error. I have tried to
>>> register the object with commands "regasm.exe MyModule.dll" and
>>> "regasm.exe MyModule.dll /codebase" but neither of them doesn't
>>> work.
>>>
>>> What is the correct way to register C# COM object class manually?
>>>


miikka.laakso

11/27/2006 1:19:00 PM

0

Hi

With the win 32 (development) machine I can register the C# Com object
with command "regasm MyModule.dll /tlb:/my/typelib/path /codebase"
without any problem.

There has been different dll versions of the same module on the test
machine (x64) which might not be unregistered properly. Is there way to
clean registry from these false entries?

Jigar Mehta kirjoitti:

> Hello,
>
> Can you try registering your C# component on deployment box with /tlb option?
>
> =============
> Regards,
> Jigar Mehta
>
> > Hi
> >
> > I have imported the typelibrary and actually I don't have any problems
> > with it on my developing machine, but when I try to use it in my
> > testing machine (x64) it says that the "Class it not registered".
> >
> > I should have all needed dlls, and all other dlls are registered
> > properly. My dlls reside on different path than the executable, but
> > shouldn't codebase attribute solve this?
> >
> > My dll is not used for general purposes, so it might not be wise to
> > install it to GAC?
> >
> > Jigar Mehta kirjoitti:
> >
> >> Hello,
> >>
> >> The correct way to register the C# assembly for interop is,
> >> 1. to put the assembly in GAC and register it.
> >> 2. to put anywhere other than GAC and register with /codebase option.
> >> For your problem, it seems that you will have to register the
> >> assembly
> >> with /tlb option like,
> >> regasm.exe /codebase /tlb <assemblyname>
> >> And import that TLB file while compiling your application.
> >>
> >> Let me know if that does not work.
> >>
> >> regards,
> >> jigar
> >> On Nov 23, 1:27 pm, miikka.laa...@kaannos.com wrote:
> >>
> >>> Whenever I try to use the class (in the normal C++) from the COM
> >>> object I get the "Class not registered" error. I have tried to
> >>> register the object with commands "regasm.exe MyModule.dll" and
> >>> "regasm.exe MyModule.dll /codebase" but neither of them doesn't
> >>> work.
> >>>
> >>> What is the correct way to register C# COM object class manually?
> >>>

Jigar Mehta

11/27/2006 2:27:00 PM

0

Hello,

Yes, you can use regasm /u <assembly name> OR regasm /unregister <assembly
name> for unregistering the assembly.

=============
Regards,
Jigar Mehta

> Hi
>
> With the win 32 (development) machine I can register the C# Com object
> with command "regasm MyModule.dll /tlb:/my/typelib/path /codebase"
> without any problem.
>
> There has been different dll versions of the same module on the test
> machine (x64) which might not be unregistered properly. Is there way
> to clean registry from these false entries?
>
> Jigar Mehta kirjoitti:
>
>> Hello,
>>
>> Can you try registering your C# component on deployment box with /tlb
>> option?
>>
>> =============
>> Regards,
>> Jigar Mehta
>>> Hi
>>>
>>> I have imported the typelibrary and actually I don't have any
>>> problems with it on my developing machine, but when I try to use it
>>> in my testing machine (x64) it says that the "Class it not
>>> registered".
>>>
>>> I should have all needed dlls, and all other dlls are registered
>>> properly. My dlls reside on different path than the executable, but
>>> shouldn't codebase attribute solve this?
>>>
>>> My dll is not used for general purposes, so it might not be wise to
>>> install it to GAC?
>>>
>>> Jigar Mehta kirjoitti:
>>>
>>>> Hello,
>>>>
>>>> The correct way to register the C# assembly for interop is,
>>>> 1. to put the assembly in GAC and register it.
>>>> 2. to put anywhere other than GAC and register with /codebase
>>>> option.
>>>> For your problem, it seems that you will have to register the
>>>> assembly
>>>> with /tlb option like,
>>>> regasm.exe /codebase /tlb <assemblyname>
>>>> And import that TLB file while compiling your application.
>>>> Let me know if that does not work.
>>>>
>>>> regards,
>>>> jigar
>>>> On Nov 23, 1:27 pm, miikka.laa...@kaannos.com wrote:
>>>>> Whenever I try to use the class (in the normal C++) from the COM
>>>>> object I get the "Class not registered" error. I have tried to
>>>>> register the object with commands "regasm.exe MyModule.dll" and
>>>>> "regasm.exe MyModule.dll /codebase" but neither of them doesn't
>>>>> work.
>>>>>
>>>>> What is the correct way to register C# COM object class manually?
>>>>>


miikka.laakso

11/28/2006 7:24:00 AM

0

Hi

I unregistered everything and added the assembly to the GAC, still the
problem remains.

Is there some different situations than class is not really registered
that might cause "Class not registered" error message (for example some
needed module is missing etc.)?

Jigar Mehta kirjoitti:

> Hello,
>
> Yes, you can use regasm /u <assembly name> OR regasm /unregister <assembly
> name> for unregistering the assembly.
>
> =============
> Regards,
> Jigar Mehta
>
> > Hi
> >
> > With the win 32 (development) machine I can register the C# Com object
> > with command "regasm MyModule.dll /tlb:/my/typelib/path /codebase"
> > without any problem.
> >
> > There has been different dll versions of the same module on the test
> > machine (x64) which might not be unregistered properly. Is there way
> > to clean registry from these false entries?
> >
> > Jigar Mehta kirjoitti:
> >
> >> Hello,
> >>
> >> Can you try registering your C# component on deployment box with /tlb
> >> option?
> >>
> >> =============
> >> Regards,
> >> Jigar Mehta
> >>> Hi
> >>>
> >>> I have imported the typelibrary and actually I don't have any
> >>> problems with it on my developing machine, but when I try to use it
> >>> in my testing machine (x64) it says that the "Class it not
> >>> registered".
> >>>
> >>> I should have all needed dlls, and all other dlls are registered
> >>> properly. My dlls reside on different path than the executable, but
> >>> shouldn't codebase attribute solve this?
> >>>
> >>> My dll is not used for general purposes, so it might not be wise to
> >>> install it to GAC?
> >>>
> >>> Jigar Mehta kirjoitti:
> >>>
> >>>> Hello,
> >>>>
> >>>> The correct way to register the C# assembly for interop is,
> >>>> 1. to put the assembly in GAC and register it.
> >>>> 2. to put anywhere other than GAC and register with /codebase
> >>>> option.
> >>>> For your problem, it seems that you will have to register the
> >>>> assembly
> >>>> with /tlb option like,
> >>>> regasm.exe /codebase /tlb <assemblyname>
> >>>> And import that TLB file while compiling your application.
> >>>> Let me know if that does not work.
> >>>>
> >>>> regards,
> >>>> jigar
> >>>> On Nov 23, 1:27 pm, miikka.laa...@kaannos.com wrote:
> >>>>> Whenever I try to use the class (in the normal C++) from the COM
> >>>>> object I get the "Class not registered" error. I have tried to
> >>>>> register the object with commands "regasm.exe MyModule.dll" and
> >>>>> "regasm.exe MyModule.dll /codebase" but neither of them doesn't
> >>>>> work.
> >>>>>
> >>>>> What is the correct way to register C# COM object class manually?
> >>>>>

Jigar Mehta

11/28/2006 4:37:00 PM

0

Hello,

If you unregistered and then re-registered, then also the problem persists,
then I think there is possibility that your TLB file (on the development
machine is not lilnked to the latest TLB file..

Can you tell me by which way you are using your TLB file? I mean are you
using relative path to import the TLB file? Sometimes this happens if you
have wrong TLB file referenced in your project. If you can check this and
let me know.

=============
Regards,
Jigar Mehta

> Hi
>
> I unregistered everything and added the assembly to the GAC, still the
> problem remains.
>
> Is there some different situations than class is not really registered
> that might cause "Class not registered" error message (for example
> some needed module is missing etc.)?
>
> Jigar Mehta kirjoitti:
>
>> Hello,
>>
>> Yes, you can use regasm /u <assembly name> OR regasm /unregister
>> <assembly name> for unregistering the assembly.
>>
>> =============
>> Regards,
>> Jigar Mehta
>>> Hi
>>>
>>> With the win 32 (development) machine I can register the C# Com
>>> object with command "regasm MyModule.dll /tlb:/my/typelib/path
>>> /codebase" without any problem.
>>>
>>> There has been different dll versions of the same module on the test
>>> machine (x64) which might not be unregistered properly. Is there way
>>> to clean registry from these false entries?
>>>
>>> Jigar Mehta kirjoitti:
>>>
>>>> Hello,
>>>>
>>>> Can you try registering your C# component on deployment box with
>>>> /tlb option?
>>>>
>>>> =============
>>>> Regards,
>>>> Jigar Mehta
>>>>> Hi
>>>>>
>>>>> I have imported the typelibrary and actually I don't have any
>>>>> problems with it on my developing machine, but when I try to use
>>>>> it in my testing machine (x64) it says that the "Class it not
>>>>> registered".
>>>>>
>>>>> I should have all needed dlls, and all other dlls are registered
>>>>> properly. My dlls reside on different path than the executable,
>>>>> but shouldn't codebase attribute solve this?
>>>>>
>>>>> My dll is not used for general purposes, so it might not be wise
>>>>> to install it to GAC?
>>>>>
>>>>> Jigar Mehta kirjoitti:
>>>>>
>>>>>> Hello,
>>>>>>
>>>>>> The correct way to register the C# assembly for interop is,
>>>>>> 1. to put the assembly in GAC and register it.
>>>>>> 2. to put anywhere other than GAC and register with /codebase
>>>>>> option.
>>>>>> For your problem, it seems that you will have to register the
>>>>>> assembly
>>>>>> with /tlb option like,
>>>>>> regasm.exe /codebase /tlb <assemblyname>
>>>>>> And import that TLB file while compiling your application.
>>>>>> Let me know if that does not work.
>>>>>> regards,
>>>>>> jigar
>>>>>> On Nov 23, 1:27 pm, miikka.laa...@kaannos.com wrote:
>>>>>>> Whenever I try to use the class (in the normal C++) from the COM
>>>>>>> object I get the "Class not registered" error. I have tried to
>>>>>>> register the object with commands "regasm.exe MyModule.dll" and
>>>>>>> "regasm.exe MyModule.dll /codebase" but neither of them doesn't
>>>>>>> work.
>>>>>>>
>>>>>>> What is the correct way to register C# COM object class
>>>>>>> manually?
>>>>>>>