Where are Web Application Project Assembly references stored?

ぃ、小莉子 提交于 2019-12-01 15:24:40

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>

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.

Those "missing" dlls are probably in the Global Assembly Cache and are available to all .NET applications.

You can add control references to the pages/controls section of web.config, which will apply to all pages in the application.

I had the same issue, deleting .vs folder in the directory of the project solved the issue for me as it forced the recreation of .suo file which (though bite code) had reference to the web.config file in the wrong directory

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!