Thread: How to register .NET COM server without opening command prompt window

  1. #1
    Registered User
    Join Date
    Nov 2008
    Posts
    3

    Question How to register .NET COM server without opening command prompt window

    hi. all.

    i regist my DLL COM server with 'regasm /codebase my.dll' in a command prompt window.

    but, i want to regist my.dll after finish my setup program automatically and silently.

    'silently' means not openning command prompt windows.

    help me... plz..

  2. #2
    Registered User
    Join Date
    Dec 2007
    Posts
    2,675
    Go to MSDN and look up the System.Configuration.Installer namespace.

  3. #3
    Registered User
    Join Date
    Nov 2008
    Posts
    3

    Unhappy

    rags_to_riches, thanks for your reply..
    I have tried to use System.Configuration.Installer namespace like your recomends.
    however, I don't found out solution of this problem yet.
    Code:
    try
    {
    	string regasmPath = System.Runtime.InteropServices.RuntimeEnvironment.GetRuntimeDirectory() + "regasm.exe";
    
    	string[] commandLineOptions = new string[2] { "/codebase", @"c:\my.dll"  };
    
    	AssemblyInstaller myAssemblyInstaller = new
    				AssemblyInstaller(regasmPath, commandLineOptions);
    
    	myAssemblyInstaller.UseNewContext = false;
    
    	myAssemblyInstaller.Install(null);
    
    }
    catch (Exception ex)
    {
    	System.Diagnostics.Debug.WriteLine(ex.Message);
    }
    I wonder why this code not working without exception..

  4. #4
    Sweet
    Join Date
    Aug 2002
    Location
    Tucson, Arizona
    Posts
    1,820
    Maybe you need a / in front of the regasm.exe
    Woop?

  5. #5
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    Quote Originally Posted by prog-bman View Post
    Maybe you need a / in front of the regasm.exe
    Pretty much...

  6. #6
    Registered User
    Join Date
    Nov 2008
    Posts
    3

    Smile

    OOPS.... it's my mistake..

    thank you, all...
    Last edited by sweetier; 11-12-2008 at 07:22 PM.

  7. #7
    Banned master5001's Avatar
    Join Date
    Aug 2001
    Location
    Visalia, CA, USA
    Posts
    3,685
    Do I really get included in "all" when all I did is point out that some person's "guess" was simply correct? I should hope not.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. SDL Window opening with Console Window
    By carrotcake1029 in forum Windows Programming
    Replies: 2
    Last Post: 12-23-2008, 03:32 PM
  2. server client application - (i really need your help)
    By sarahnetworking in forum C Programming
    Replies: 3
    Last Post: 03-01-2008, 10:54 PM
  3. System
    By drdroid in forum C++ Programming
    Replies: 3
    Last Post: 06-28-2002, 10:12 PM
  4. opengl code not working
    By Unregistered in forum Windows Programming
    Replies: 4
    Last Post: 02-14-2002, 10:01 PM
  5. Winamp Vis if anyone can help
    By Unregistered in forum Windows Programming
    Replies: 6
    Last Post: 01-27-2002, 12:43 AM

Tags for this Thread