Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / November 2006

Tip: Looking for answers? Try searching our database.

Problems registering C# COM object manually

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
miikka.laakso@kaannos.com - 23 Nov 2006 08:27 GMT
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 - 23 Nov 2006 14:29 GMT
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?

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.