Lewis
Lewis

Reputation: 23

Project load wrong web.config file

I am using Visual Studio 2008 for .net project.

I have configured to use IIS as debug 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

Upvotes: 2

Views: 5099

Answers (4)

Sunil
Sunil

Reputation: 11

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

Upvotes: 1

EdmundYeung99
EdmundYeung99

Reputation: 2511

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.

Upvotes: 0

rick schott
rick schott

Reputation: 20617

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

Upvotes: 0

Darren Kopp
Darren Kopp

Reputation: 77627

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.

Upvotes: 0

Related Questions