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@kaannos.com - 24 Nov 2006 08:54 GMT
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,
>
[quoted text clipped - 20 lines]
> >
> > What is the correct way to register C# COM object class manually?
Jigar Mehta - 24 Nov 2006 13:26 GMT
Hello,
Can you try registering your C# component on deployment box with /tlb option?
=============
Regards,
Jigar Mehta
> Hi
>
[quoted text clipped - 35 lines]
>>>
>>> What is the correct way to register C# COM object class manually?
miikka.laakso@kaannos.com - 27 Nov 2006 13:19 GMT
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,
>
[quoted text clipped - 43 lines]
> >>>
> >>> What is the correct way to register C# COM object class manually?
Jigar Mehta - 27 Nov 2006 14:27 GMT
Hello,
Yes, you can use regasm /u <assembly name> OR regasm /unregister <assembly
name> for unregistering the assembly.
=============
Regards,
Jigar Mehta
> Hi
>
[quoted text clipped - 55 lines]
>>>>>
>>>>> What is the correct way to register C# COM object class manually?
miikka.laakso@kaannos.com - 28 Nov 2006 07:23 GMT
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,
>
[quoted text clipped - 64 lines]
> >>>>>
> >>>>> What is the correct way to register C# COM object class manually?
Jigar Mehta - 28 Nov 2006 16:36 GMT
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
>
[quoted text clipped - 74 lines]
>>>>>>> What is the correct way to register C# COM object class
>>>>>>> manually?