What does "Add Reference" actually do?
-
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.
-
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.
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.
-
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.
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
-
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
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.
-
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.
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