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. How to make custom/own BASE classes

How to make custom/own BASE classes

Scheduled Pinned Locked Moved C#
csharpdotnettutorial
4 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.
  • F Offline
    F Offline
    Felix Nielsen
    wrote on last edited by
    #1

    Hi I have a new class witch I want to make "public" for the .NET framework, I have tried to use the "gacutil", but when I try to compile a new calls file using my "namespace" it fails. Thanks

    J 1 Reply Last reply
    0
    • F Felix Nielsen

      Hi I have a new class witch I want to make "public" for the .NET framework, I have tried to use the "gacutil", but when I try to compile a new calls file using my "namespace" it fails. Thanks

      J Offline
      J Offline
      James T Johnson
      wrote on last edited by
      #2

      To use an assembly that is in the GAC you still must reference the assembly. What seems to be a pain is that you can't just reference it and let it find it in the GAC you have to specifically tell it where to look for your assembly. What I did was I made a copy of my assembly and placed it in the same directory as my source, I then added a reference to that (using VS.NET or the /r: compiler switch). Once the code is compiled (and the assembly is in the GAC) you no longer need the local copy of the assembly. Now when you run your code, if the assembly isn't located in the current directory it will search the GAC for it. HTH, James Sonork ID: 100.11138 - Hasaki "My words but a whisper -- your deafness a SHOUT. I may make you feel but I can't make you think." - Thick as a Brick, Jethro Tull 1972

      F 1 Reply Last reply
      0
      • J James T Johnson

        To use an assembly that is in the GAC you still must reference the assembly. What seems to be a pain is that you can't just reference it and let it find it in the GAC you have to specifically tell it where to look for your assembly. What I did was I made a copy of my assembly and placed it in the same directory as my source, I then added a reference to that (using VS.NET or the /r: compiler switch). Once the code is compiled (and the assembly is in the GAC) you no longer need the local copy of the assembly. Now when you run your code, if the assembly isn't located in the current directory it will search the GAC for it. HTH, James Sonork ID: 100.11138 - Hasaki "My words but a whisper -- your deafness a SHOUT. I may make you feel but I can't make you think." - Thick as a Brick, Jethro Tull 1972

        F Offline
        F Offline
        Felix Nielsen
        wrote on last edited by
        #3

        Hi James, And THX :) (again) It works great :) But let's say I want to be able to add the "reference" from the GAC with VS. Even though I have added the DLL to GAC, the listbox don't have my DLL? My question is really how do I re-distribute my application without changing to much - it would be great if xcopy and maybe GACUtil was the only task. If I copy my DLL to the webapp's BIN folder, and add the Reference it displays a full path(URL), and If I copy the webapplication to another URL - it would fail right? Thanks Felix

        J 1 Reply Last reply
        0
        • F Felix Nielsen

          Hi James, And THX :) (again) It works great :) But let's say I want to be able to add the "reference" from the GAC with VS. Even though I have added the DLL to GAC, the listbox don't have my DLL? My question is really how do I re-distribute my application without changing to much - it would be great if xcopy and maybe GACUtil was the only task. If I copy my DLL to the webapp's BIN folder, and add the Reference it displays a full path(URL), and If I copy the webapplication to another URL - it would fail right? Thanks Felix

          J Offline
          J Offline
          James T Johnson
          wrote on last edited by
          #4

          Felix Nielsen wrote: But let's say I want to be able to add the "reference" from the GAC with VS. Even though I have added the DLL to GAC, the listbox don't have my DLL? It seems odd, but VS.NET doesn't show assemblies that are in the GAC. Instead it shows assemblies from a few pre-defined locations. The best place to put such an assembly would be $windows_dir\Microsoft.NET\Framework\$dotnet_version\ Then VS.NET will see your assembly and add it to the list. Now the question you need to ask yourself is "What about my assembly warrants making it available to everyone?" 9 times out of 10 there isn't really any reason to put something in the GAC. The GAC should be used for assemblies that other people/companies will want to use in their products where the size of the assembly is large enough to warrant not keeping a local version. Felix Nielsen wrote: If I copy my DLL to the webapp's BIN folder, and add the Reference it displays a full path(URL), and If I copy the webapplication to another URL - it would fail right? Nope, VS.NET references everything relative to the project directory. So if you place an assembly in your bin directory the project file stores it as "bin\myAssembly.dll". If it can't find it there, it will begin a search to find it in other locations too. I don't recall what those locations are off the top of my head though. HTH, James Sonork ID: 100.11138 - Hasaki "My words but a whisper -- your deafness a SHOUT. I may make you feel but I can't make you think." - Thick as a Brick, Jethro Tull 1972

          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