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. Web Development
  3. ASP.NET
  4. What does "Add Reference" actually do?

What does "Add Reference" actually do?

Scheduled Pinned Locked Moved ASP.NET
questioncsharpasp-netvisual-studio
5 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.
  • G Offline
    G Offline
    GregStevens
    wrote on last edited by
    #1

    I am working on a project developing an ASP.NET (1.1) web application. However, I am not using the Visual Studio.NET front-end design application. I'm simply using notepad to create .ASPX, .VB, and other related documents. When I want to write a pre-compiled visual basic class, I use the command-line vbc.exe compiler, and place the output DLL in the /bin/ folder. Up to this point, this has worked fine for me. Now, I am trying to use a third-party COM module with the site (simplechart.net). I have installed the module on the server. Now, in the instructions that come with the simplechart.net module, I am told: "In the Solution Explorer, Right-click on References and select Add Reference. Select the COM tab in the resulting Add Reference dialog. Scroll down to the SimpleChart Toolkit 2.1, highlight it and click Select." But.... I don't use the Visual Studio.NET front end. So my question is this: What is it that this "Add Reference" process really DOES, in the background? Can I do the same thing manually, without going in to Visual Studio.NET? ---Greg p.s. please don't reply with "Why would you want to do that?" and go on to extoll the virtues of using the Visual Studio.NET application. I am first interested in whether or not it is possible (whether or not you think it's advisable) to do without.

    P 1 Reply Last reply
    0
    • G GregStevens

      I am working on a project developing an ASP.NET (1.1) web application. However, I am not using the Visual Studio.NET front-end design application. I'm simply using notepad to create .ASPX, .VB, and other related documents. When I want to write a pre-compiled visual basic class, I use the command-line vbc.exe compiler, and place the output DLL in the /bin/ folder. Up to this point, this has worked fine for me. Now, I am trying to use a third-party COM module with the site (simplechart.net). I have installed the module on the server. Now, in the instructions that come with the simplechart.net module, I am told: "In the Solution Explorer, Right-click on References and select Add Reference. Select the COM tab in the resulting Add Reference dialog. Scroll down to the SimpleChart Toolkit 2.1, highlight it and click Select." But.... I don't use the Visual Studio.NET front end. So my question is this: What is it that this "Add Reference" process really DOES, in the background? Can I do the same thing manually, without going in to Visual Studio.NET? ---Greg p.s. please don't reply with "Why would you want to do that?" and go on to extoll the virtues of using the Visual Studio.NET application. I am first interested in whether or not it is possible (whether or not you think it's advisable) to do without.

      P Offline
      P Offline
      Pete OHanlon
      wrote on last edited by
      #2

      Add Reference tells the compiler what DLLs to include when building; as well as this - it also tells Visual Studio .NET how to handle things as far as Intellisense is concerned (not that this bit concerns you). Anyway - you can achieve what you need by using /reference:mydll.dll in the cs.exe command line you are going to use.

      Deja View - the feeling that you've seen this post before.

      G 1 Reply Last reply
      0
      • P Pete OHanlon

        Add Reference tells the compiler what DLLs to include when building; as well as this - it also tells Visual Studio .NET how to handle things as far as Intellisense is concerned (not that this bit concerns you). Anyway - you can achieve what you need by using /reference:mydll.dll in the cs.exe command line you are going to use.

        Deja View - the feeling that you've seen this post before.

        G Offline
        G Offline
        GregStevens
        wrote on last edited by
        #3

        First of all, thank you for your reply, it was very helpful! One follow-up question, though: What if I want to make use of the Class (that is defined in the DLL) in a code-behind page? Since I'm not compiling the code in the code-behind page, I wouldn't be using cs.exe and wouldn't have an opportunity to use /reference, correct? Or am I misunderstanding how/when to use the /reference option? Thanks again for your help! ----Greg

        P 1 Reply Last reply
        0
        • G GregStevens

          First of all, thank you for your reply, it was very helpful! One follow-up question, though: What if I want to make use of the Class (that is defined in the DLL) in a code-behind page? Since I'm not compiling the code in the code-behind page, I wouldn't be using cs.exe and wouldn't have an opportunity to use /reference, correct? Or am I misunderstanding how/when to use the /reference option? Thanks again for your help! ----Greg

          P Offline
          P Offline
          Pete OHanlon
          wrote on last edited by
          #4

          Sorry it's taken me so long to get back to you, but the answer is that you wouldn't need to use the /reference here. This is only to add a reference to an external assembly.

          Deja View - the feeling that you've seen this post before.

          G 1 Reply Last reply
          0
          • P Pete OHanlon

            Sorry it's taken me so long to get back to you, but the answer is that you wouldn't need to use the /reference here. This is only to add a reference to an external assembly.

            Deja View - the feeling that you've seen this post before.

            G Offline
            G Offline
            GregStevens
            wrote on last edited by
            #5

            Hmm.... I'm not sure you understand. I'm still trying to make use of a class name in the external assembly, but I'm trying to make use of it in a code-behind page, rather than a compiled class. Specifically, I have installed an external assembly called SimpleChart, which gives me a file called SimpleChart4.dll. Then, in a code-behind page I say: Imports SimpleChart4 which is the name of the namespace, and is the line used in all of their example code. However, it gives me an error, telling me that it doesn't recognize the type. In theory, if I had the Visual Studio.NET application, I could click on "Add Reference", choose the "COM" tab, and add a reference to the DLL, and then suddenly it should be able to recognize the SimpleChart4 namespace/type. However, since I do not use the Visual Studio.NET application, I'm wondering how to do this without.... ----Greg

            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