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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. Assistance with converting application to library

Assistance with converting application to library

Scheduled Pinned Locked Moved C#
csharpdotnetvisual-studiocomhelp
5 Posts 3 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
    b_girl
    wrote on last edited by
    #1

    Hello, I've found an article on here that describes how to mask keyed in characters for inputting passwords: ConsolePasswordInput[^] At the bottom of this article it states that it's an application (obviously) but it can be easily converted into a library. I'd love to convert it into a library but I have no idea how to do this. I'm relatively new to C#. I'm currently running MS Visual Studio 2005 with .Net Framework 2.0 I was thinking I could start a new Class Library project and just paste in the required code, but I believe that will create a .dll file. I believe that once my application makes use of this library it will have to register itself, and I was trying to avoid having my application register anything. If anyone is able to help or even just point me in the right direction, I would greatly appreciate it. Please let me know if you need anymore information!

    B A 2 Replies Last reply
    0
    • B b_girl

      Hello, I've found an article on here that describes how to mask keyed in characters for inputting passwords: ConsolePasswordInput[^] At the bottom of this article it states that it's an application (obviously) but it can be easily converted into a library. I'd love to convert it into a library but I have no idea how to do this. I'm relatively new to C#. I'm currently running MS Visual Studio 2005 with .Net Framework 2.0 I was thinking I could start a new Class Library project and just paste in the required code, but I believe that will create a .dll file. I believe that once my application makes use of this library it will have to register itself, and I was trying to avoid having my application register anything. If anyone is able to help or even just point me in the right direction, I would greatly appreciate it. Please let me know if you need anymore information!

      B Offline
      B Offline
      BoneSoft
      wrote on last edited by
      #2

      A Class Library project will produce a DLL. By registering, I assume you're talking about registering the DLL to the GAC... Which isn't necessary. You can create a new class library project, and paste in the necessary code. Then have your application reference that DLL (or project if you have both projects in the same solution) to use the classes in the library. If you don't want to do that, you can paste the necessary code into your application's project instead, which will work just the same, it just won't be usable by other projects. Does that help?


      Try code model generation tools at BoneSoft.com.

      1 Reply Last reply
      0
      • B b_girl

        Hello, I've found an article on here that describes how to mask keyed in characters for inputting passwords: ConsolePasswordInput[^] At the bottom of this article it states that it's an application (obviously) but it can be easily converted into a library. I'd love to convert it into a library but I have no idea how to do this. I'm relatively new to C#. I'm currently running MS Visual Studio 2005 with .Net Framework 2.0 I was thinking I could start a new Class Library project and just paste in the required code, but I believe that will create a .dll file. I believe that once my application makes use of this library it will have to register itself, and I was trying to avoid having my application register anything. If anyone is able to help or even just point me in the right direction, I would greatly appreciate it. Please let me know if you need anymore information!

        A Offline
        A Offline
        arow69d
        wrote on last edited by
        #3

        You are correct that it would create a .dll. You dont have to register it, however, unless you want to, but is usually unnecessary unless you plan on a lot of apps accessing it. Just compile the dll and add a reference to it in your projects. It will be copied and distributed with your app (in the app folder) without registering. If you do decide to register your dll, just create a strong name with the sn.exe utility (from the .NET SDK command prompt) to create a key pair, then assign that to your [assembly:KeyName] attribute of the .dll (assemblyInfo.cs/vb). Then recompile and use gacutil.exe (.NET SDK command prompt) to register the dll in the GAC. Only do this if it is absolutely necessary, however. HTH. Aaron Dilliard

        B 2 Replies Last reply
        0
        • A arow69d

          You are correct that it would create a .dll. You dont have to register it, however, unless you want to, but is usually unnecessary unless you plan on a lot of apps accessing it. Just compile the dll and add a reference to it in your projects. It will be copied and distributed with your app (in the app folder) without registering. If you do decide to register your dll, just create a strong name with the sn.exe utility (from the .NET SDK command prompt) to create a key pair, then assign that to your [assembly:KeyName] attribute of the .dll (assemblyInfo.cs/vb). Then recompile and use gacutil.exe (.NET SDK command prompt) to register the dll in the GAC. Only do this if it is absolutely necessary, however. HTH. Aaron Dilliard

          B Offline
          B Offline
          b_girl
          wrote on last edited by
          #4

          Thank you both for your help - I'm going to give this a try tomorrow :) Now that I know a dll doesn't have to be registered, it should all be ok!

          1 Reply Last reply
          0
          • A arow69d

            You are correct that it would create a .dll. You dont have to register it, however, unless you want to, but is usually unnecessary unless you plan on a lot of apps accessing it. Just compile the dll and add a reference to it in your projects. It will be copied and distributed with your app (in the app folder) without registering. If you do decide to register your dll, just create a strong name with the sn.exe utility (from the .NET SDK command prompt) to create a key pair, then assign that to your [assembly:KeyName] attribute of the .dll (assemblyInfo.cs/vb). Then recompile and use gacutil.exe (.NET SDK command prompt) to register the dll in the GAC. Only do this if it is absolutely necessary, however. HTH. Aaron Dilliard

            B Offline
            B Offline
            b_girl
            wrote on last edited by
            #5

            Just thought I'd let you all know that I managed to get the library working successfully. Thank you for all your help :-D

            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