Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6084735
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:33:27+00:00 2026-05-23T11:33:27+00:00

Hi I am trying to develop a COM using C# and Visual Studio 2005

  • 0

Hi I am trying to develop a COM using C# and Visual Studio 2005

First I did the interface “CSharpServer.cs”

<code>
    using System;
    using System.Runtime.InteropServices;
    namespace CSharpServer
    {
       [ComVisible(true)]
       [Guid("DBE0E8C4-1C61-41f3-B6A4-4E2F353D3D05")]
       public interface IManagedInterface
       {
          int PrintHi();
       }

       [ComVisible(true)]
       [Guid("C6659361-1625-4746-931C-36014B146679")]
       public class InterfaceImplementation : IManagedInterface
       {
          public int PrintHi()
          {
             Console.WriteLine("Hello!");
             return 33;
          }
       }
    }
</code>

I compiled. The output is: csharp_server.dll. After, I did: regasm csharp_server.dll /tlb /codebase
The output is:

…
RegAsm : warning RA0000 : Registering an unsigned assembly with
/codebase can ca
use your assembly to interfere with other applications that may be
installed on
the same computer. The /codebase switch is intended to be used only
with signed
assemblies. Please give your assembly a strong name and re-register
it.
Types registered successfully …

1ª Question: I have to sign? How?

2ª Question: Removed by the author.

3ª Question: I can only run “regasm” command prompt by visual studio. Soon if I develop a COM component using C#, and distribute to the client, it also has to have visual studio installed? If the customer has just installed Delphi, and want to use component, it will have to install visual studio?

4ª Inside Visual Studio C#, I trying to add COM reference but says:

A reference to ‘csharp_server’ could
not be added. The ActiveX type library
‘xxx\csharp_server.tlb’ was exported
from a .NET assembly and cannot be
added as a reference. Add a reference
to the .NET assembly instead.
But in “. NET reference”. I can not see the component “csharp_server.”

What am I doing wrong or forgetting?

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T11:33:28+00:00Added an answer on May 23, 2026 at 11:33 am

    #1 Read up on sn.exe. Generate a strong name key file and then right-click your project in the solution explorer and edit its properties. Choose the “Signing” tab and add the key file. If your corporation has a key file you can delay-sign the assembly and then pass it to the keeper of the private key (you won’t have access to it because it is extremely locked-down because if it is public, anyone can sign app’s impersonating your company.) Don’t forget to open the “Properties” folder in solution explorer and edit the name/version/etc. of your assembly.

    #2 Are you saying you can use a DLL after you’ve deleted it? That’s hard to believe.

    #3 Installer packages such as Installshield have provisions for registering .NET assemblies as needed. Alternatively you can use regasm /regfile to generate a .reg that can be merged into the target registry. I really recommend either: 1) using a commercial tool to build your installer or 2) being a shining god of MSI technology, though. It is very difficult to write a correct installer with the SDK tools, and even with Wix.

    #4 has no workaround as far as I know. I guess Microsoft decided it was perverse to have a managed assembly access another managed assembly through a managed wrapper assembly on top of a COM interface wrapper implemented by the 2nd managed assembly. Maybe they didn’t want it to become a common way to get around the private/global assembly binding rules.

    Anyway, perhaps you could edit the type library such that it “fools” the managed wrapper generator (TlbImp.exe) into thinking it is a native COM type library, but is it really worth it? Most commercial applications with a public API have instructions for using the App’s API from COM and from managed clients, one or the other being a wrapper depending on the implementation of the Application. That technique has been working for many vendors, without issue, for years.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to develop a simple shopping cart and using http://jqueryui.com/demos/droppable/#photo-manager as the base.
I'm trying to develop my first site in ASP.Net using Web Forms. I have
I am trying to develop a COM object using C++ and ATL to be
Duplicate : https://stackoverflow.com/questions/135651/learning-unit-testing I'm trying to develop some software for my research group to
I am trying develop a basic referrer system to my Django website, system will
Im trying to develop my first ASP.NET MVC web app and have run into
I am trying to develop a .NET Web Project using NHibernate and Spring.NET, but
I'm trying to develop a little C# application (with MS Visual Express and SQL
I am trying to develop custom control in JSF 1.2 (using facelets). I followed
I’m trying to develop a Spring 3 MVC application using the Springsource Tool Suite/Eclipse

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.