Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where are Web Application Project Assembly references stored?

Where are assembly refernces stored for a web application?

In a Web Site, I see assembly tags written to the assembly node in the web.config when you add a reference. I am just curious as to how the Web Application Project makes the connection to get the correct local dll?

I manually add the reference and the application builds, but the dll is not imported into the BIN folder, and the assembly nodes are not created in the web config as they are in a Web Site. I do a solution search for the text 'assembly="SomeAssembly..." and no results are found.

I am just curious as I am trying to centralize updating assembly references as a 3rd party control vendor puts out hotfixes on a regular basis and we end up having to run around and update all the individual page refernces to the assembly. I was able to do this effectively in the Web Site project, but I am fairly new to Web Application Projects. Any advice or links would be appreciated. I guess I'm looking for tips on assembly & control reference management for ASP.NET Web Application Projects.

like image 380
Hcabnettek Avatar asked Jul 17 '09 17:07

Hcabnettek


People also ask

Where are references stored?

References in Word are stored on your computer's hard disk. If you want to work with them on another computer, follow these steps to find the file: Type% APPDATA% into the Start menu search box. Click on to the folder Roaming > Microsoft > Bibliography.

Where does Visual Studio keep the references?

When you make a reference to an assembly in your project, Visual Studio searches for the assembly in the following locations: The current project directory. (You can find these assemblies by using the Browse tab.) Other project directories in the same solution.

How do you add references to a Web application?

To add a Web Reference You can also open the Add Web Reference dialog box in the Solution Explorer pane by right-clicking References and selecting Add Web Reference.


2 Answers

Like most Visual Studio projects, references are kept in the project.

There are two kinds of reference:

Project References are references to another project in the same solution. They look like this:

<ProjectReference Include="..\VBClassLibrary1\VBClassLibrary1.vbproj">
  <Project>{045D7D9F-8E44-4C4B-95F8-620E86593C5B}</Project>
  <Name>VBClassLibrary1</Name>
</ProjectReference>

File references are references to an arbitrary file on disk:

<Reference Include="System.Core">
  <RequiredTargetFramework>3.5</RequiredTargetFramework>
</Reference>

If you expand the References folder and click on a reference, then look in the Properties window, you'll see that both kinds of reference have a "Copy Local" property. For project references it defaults to true, for file references to false (though maybe that's only if the file is in the GAC). Changing the default adds:

  <Private>False</Private>
like image 166
John Saunders Avatar answered Nov 16 '22 00:11

John Saunders


Since the assembly was not imported to the BIN folder, and your application works, I assume that it is stored in the GAC (global assembly cache) and marked as "copy local=false" in the reference properties. You don't see the reference to the assembly in the web.config, since your code behind assembly - YourApp.dll (which is always created for web-applications), contains a standard assembly reference to that assembly. When you run your application it loads the assembly from the GAC.

like image 23
Doron Yaacoby Avatar answered Nov 16 '22 00:11

Doron Yaacoby