Clay Nichols
Clay Nichols

Reputation: 12139

How does an aspx page know where to "look" for DLLs it imports?

I want to change the Output path that a DLL in my MS Visual Web Developer 2010 Solution Imports but I'm wondering whether I need (and how) to tell it where that DLL has moved to.

Or does it know to look in a \bin\ sub-directory? (which is how it's organized now).

I looked in the .vb page and just see "Imports MyLibrary" but not reference to it's location.

(Sorry for the basic question, I've just taken this over from an ASPX programmer and I'm not very familiar w/ MS VWD)

Upvotes: 2

Views: 389

Answers (2)

ek_ny
ek_ny

Reputation: 10243

Here is my understanding:

  1. Code behind files will need to have references to the dll's whose classes they depend on. Those dll's can be in GAC, or they can be in the bin directory, or even in another directory. During compilation, the files will be copied to the bin directory (GAC dll's are not copied unless the reference specifies it)

  2. Code which is compiled on demand - (for instance .aspx pages or in the case of MVC .vbhtml pages) can use classes which the project does not have a reference to, as long as the dll can be found when that code is compiled. If the dll is in the bin directory, or a subdirectory of the bin directory, then it should be found.

In your case, the location of the library is probably not specified, because the project has a reference to that dll and it's located in a subdirectory of the bin directory.

Upvotes: 1

Mike Guthrie
Mike Guthrie

Reputation: 4059

This can be set by making modifications to the web.config file in the root of your web application. See the MSDN article on the <probing> element.

Additionally, the GAC can of course be used as a common source of DLLs.

Upvotes: 1

Related Questions