Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Unregister an assembly?

Unregister an assembly?

Scheduled Pinned Locked Moved C#
csharphelptutorialquestionlearning
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    Bog
    wrote on last edited by
    #1

    I want to unregister an assembly from within a csharp app. Basically all I want to is the exact same thing as: regasm.exe /unregister (path to assembly) only from within my app. (The assembly I'm unregistering is not the app running it, it's a different assembly.) Also, I want to know how to register it again later, same as: regasm.exe /codebase (pathtoassembly) (I think what I'm stuck on is creating an "Assembly" class instance, since there's no constructor that just takes a file path as an arg. ) thanks "Outside of a dog, a book is Man’s best friend. And inside of a dog, it’s too dark to read." -Groucho Marx

    N 1 Reply Last reply
    0
    • B Bog

      I want to unregister an assembly from within a csharp app. Basically all I want to is the exact same thing as: regasm.exe /unregister (path to assembly) only from within my app. (The assembly I'm unregistering is not the app running it, it's a different assembly.) Also, I want to know how to register it again later, same as: regasm.exe /codebase (pathtoassembly) (I think what I'm stuck on is creating an "Assembly" class instance, since there's no constructor that just takes a file path as an arg. ) thanks "Outside of a dog, a book is Man’s best friend. And inside of a dog, it’s too dark to read." -Groucho Marx

      N Offline
      N Offline
      Nick Parker
      wrote on last edited by
      #2

      Under the System.Diagnostic namespace you will find a class called Process which contains a static method called Start which takes a file name as a parameter and your args as a second parameter. Something like this should do the trick:

      Process.Start(@"c:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Tools\vsvars32.bat",
      @"regasm.exe /unregister [path to your file] /silent");

      -Nick Parker

      B 1 Reply Last reply
      0
      • N Nick Parker

        Under the System.Diagnostic namespace you will find a class called Process which contains a static method called Start which takes a file name as a parameter and your args as a second parameter. Something like this should do the trick:

        Process.Start(@"c:\Program Files\Microsoft Visual Studio .NET 2003\Common7\Tools\vsvars32.bat",
        @"regasm.exe /unregister [path to your file] /silent");

        -Nick Parker

        B Offline
        B Offline
        Bog
        wrote on last edited by
        #3

        thanks, Ok, I knew this already actually, but I was hoping I could register an assembly from within dot net, like with the RegistrationServices class? Are you saying that I need to include regasm.exe in my installer for the application when it's deployed? It's a shame, tha seems kind of hackish.. "Outside of a dog, a book is Man’s best friend. And inside of a dog, it’s too dark to read." -Groucho Marx

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups