开发者

Publish ASPX to sub directory of application [Cannot Load Type]

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开发者_C百科 in the root while the aspx file lives where I need it to?

Thanks!

-Nick


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.


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


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜