How to reference external assemblies from an ASP.NET web site - asp.net

I need to reference external assemblies from a dozen asp.net web sites. These assemblies won't be in the GAC, but will be located in a location relative to the web site ("..\..\dlls\release").
From what I understand, Visual studio doesn't have an explicit assembly reference, or way to link a web site to an external .csproj or .dll library. (Unlike a web project).
These sites are sample projects for the open-source image-resizing HttpModule http://imageresizingin.net/.
I don't want to make users run a .bat file to copy the dlls into each /bin folder.
Is there some secret hints file I can use to let visual studio know where to look?
I'm working on dynamic assembly resolution, but that won't help visual studio at all, just hosted versions of the site.

Add the assemblies' full names to the <compilation> element of Web.config, and put them in the GAC on your dev machine.

Related

Why is VS 2013 copying ASP.NET MVC 4 web.config to bin and renaming?

I just noticed that during a build, Visual Studio 2013 is copying the web.config from the root of my ASP.NET MVC 4 web app project into the bin folder and renaming it for the resulting web app DLL with a .config extension. It's a straight copy because the files have the same timestamp.
I'm familiar with the build doing this for app.config files in executable Windows/console projects, but why is it doing it for a web app that will depend on web.config at runtime?
As best as I can tell, the config file in the bin folder does nothing except to allow you to keep settings that are needed for that DLL in a handy place should you decide to incorporate that DLL into a larger project. In that case you would probably want to merge the config file into the hosting apps config file.
Here's a related question that may give some more insight. What use has the default (assembly).dll.config file for .NET-Assemblies?

visual studio 2005 compile website

How can I compile website (not web project) using visual studio 2005?
Whenever I compile, those dll for the website app_code is not found in my website bin folder, but instead, in a temporary dll folder (C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files).
Is there anyway for me to have the compiled dll in the bin folder?
you can use publish web site feature:
In the publish Properties, check "Use fixed naming and single page assemblies".

How to add reference to Microsoft.Office.Interop.Word.dll while copying an asp.net app from dev server to test server

I am referencing Microsoft.Office.Interop.Word.dll in my asp.net web application at development server.
No i need to move this app from development server to testing server.
I can't see the dll in the bin folder of the app as it is pointing to GAC.
How should i reference the above specified dll in testing server?
Do we need to do anything with web.config?
Please advice.
Thanks,
Ram
Visual Studio uses different sets of the PIAs on the development computer. These different sets of assemblies are in the following locations:
A folder in the program files directory.
These copies of the assemblies are used when you write code and build projects. Visual Studio installs these assemblies automatically.
The global assembly cache.
These copies of the assemblies are used during some development tasks, such as when you run or debug projects that target the .NET Framework 3.5. Visual Studio does not install and register these assemblies; you must do this yourself.
Link
If not found DLL you have to download from internet....

In Asp.Net 2.0 web site project and Assembly Reference?

Where is the information about the Referenced Assembly kept in an Asp.Net 2.0 Web Site project. Since, there is no .csproj file here we don't know where to look for this. We are facing problems because of multiple version of log4Net being referenced and want to remove one of them.
The only information a website has is the fact that the DLL exists in the bin directory of the website. When you add an external DLL to a project, that DLL is copied into the bin, and a .refresh file is added that provides Visual Studio with the path to the original DLL, so that it can refresh the DLL when it changes.
As far as I know, the assembly tag in web.config is only for GAC assemblies that are added to a project, not external DLLs.
As to your specific problem, if you have class libraries, it is possible that one of those references a different version of the DLL. It is also possible that you have multiple websites and one of them has a .refresh file that is pointing to a different version of the DLL.
In the web.config file under "assembly" tag

Using references in ASP.NET with Visual Studio and TFS

I am working with Team Foundation Server and Visual Studio 2008 for the first time. I had a web site project that was done with Visual Web Developer Express, which I have converted to a solution containing a Web Application Project, setup for TFS source control, etc etc.
TFS was having issues checking in/uploading some of my referenced DDLs, specifically AjaxControlToolKit, saying things like /bin/AjaxControlToolKit.pdb couldn't be found. I removed the reference, deleted everything it had in /bin (it had created lots of folders like /ar, /cs, /de, etc etc along with other files like /bin/AjaxControlTookKit.dll), then re-added the reference to AjaxControlToolKit. It will now upload, and works fine locally, but it didn't re-create anything in /bin. I have other references that work fine and have info in /bin (ie: /References/LinqKit.dll and /bin/LinqKit.dll) I cannot do a build on the server yet, but locally it works. So, will this work when its built on the server? Why didn't it recreate anything in the /bin folder? Is that something to do with Visual Web Developer Web Site vs Visual Studio Web Application/Solution? Any info is appreciated! Thanks.
References are references, not copies of the assemblies. Where are the assemblies you're trying to work with?
Typically, you'll want to check in third-party assemblies that you are not maintaining source. You'll then want to change the file references to point to the version from source control.
Of course, this means that all your developers and build machines will need to maintain the same folder structure on disk.

Resources