开发者

Project load wrong web.config file

I am using Visual Studio 2008 for .net project.

I have configured to use IIS as debu开发者_高级运维g web server in the project property page.

I have two projects under c:\project, project1 and project 2. I can run project 1 with no problem. However when I try to run project 2 I got an error message, saying the web.config file is missing binary file from bin folder. The server is trying to load the web.config file from project1 instead of project2.

I have checked the virtual path settings and project settings and could not find anything wrong.

Does anyone have such experience?

I could not find useful information on google.

Thanks, Lewis


I found out that ON IIS manager, Default Web Site -> Basic Setting -> Physical path was set to perticular project.

I've changed it to C:\inetpub\wwwroot now when I run individual applicaiton they go and pick up correct config files


Make sure that project1 is an application whose base folder is the project1 directory and that project2 is an application whose base folder is the project2 directory. sounds like project1 is an application pointing to c:\project.


EDIT: How are your directories defined in IIS? If they are virtual directories, they must be defined as applications, otherwise it will try to use the root web.config.

Try this:

  • Shutting down all instance of Visual Studio
  • Stopping IIS (iisreset or restart the WWW service)
  • Delete everything in this directory: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files
  • Open your projects back up


I also had this problem, it turned out I had mistakenly set up my website incorrectly in IIS.

I was pointing my default website to files for project 1, while a sub-application inside the default website was pointing to files for project 2, which was of course inheriting the web.config of project 1.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜