views:

26

answers:

3

Hello,

I have published an asp.net application to a sub directory of my IIS application. I know that the web.config must exist at the root for several of the properties to work. So I have moved my web.config to the root of the application. I get the following error:

Could not load type 'ProjectName.myTypeName'.

I suspect that not having the web.config in the same directory as this aspx file is causing the issue. How do I config this so that my web.config can live in the root while the aspx file lives where I need it to?

Thanks!

-Nick

A: 

Check that the dll it is looking for exists in the website bin directory and is of the correct version.

Oded
A: 

Make the subdirectory a virtual directory and keep your web.config in the subdirectory

TheGeekYouNeed
+1  A: 

The application loads types from the /bin directory at the root of the web application. If your types are not in that directory, it won't be able to create instances of them. You have a few options:

  1. Create an application/virtual directory from the sub-directory.
  2. Move the required assemblies to the /bin directory of the main application.
  3. Add your sub directory to the probing path of the application.
Matthew Abbott
The assemblies have to be in the root as well - at least this works best for my project. Thank you sir.
Nick