sab669
sab669

Reputation: 4104

IIS And Multiple Projects with the same Project URL?

If I open up IIS and expand Sites -> Default Web Site, I have 3 items which I've converted to applications:

MyApp_Branch_01

MyApp_Branch_02

MyApp_Branch_03

All 3 of these applications use the same AppPool. Their physical path corresponds to 3 unique directories on my physical drive; C:\inetpub\wwwroot\MyApp_Branch_01, ...02, ...03.

As you can probably guess, each directory contains a separate branch of our application in SVN. 01 is for doing builds, 02 is bug fixes & works-in-progress, 03 is for more "experimental" long-term projects. Each of these branches use different database connections. However, for all 3 of these, if I right click the build project and go to Properties, under the Web tab all 3 projects have the same value for the Project URL setting: they all point to http://localhost/MyApp.

I had just built the MyApp_Branch_03 project and ran it. A coworker came over and asked some questions, so I had to open up MyApp_Branch_01.sln. I didn't build it, I didn't run it; I just opened it in Visual Studio. Meanwhile, I left MyApp_Branch_03 debugging / running in my browser.

After helping my coworker, I returned to what I was doing... But now whenever I set a breakpoint in a controller, it would open up the file from MyApp_Branch_01 instead of the 03 file in which I set the breakpoint.

I don't understand why / how this happens? How does IIS determine which set of DLLs to serve when you have multiple solution files which use the same url?

Upvotes: 0

Views: 1259

Answers (1)

yakya
yakya

Reputation: 5220

It's not about IIS determining which set of DLLs to serve. When you open a solution, Visual Studio automatically changes the physical path of WebSites if IISUrl element in your csproj file matches any WebSite in your Local IIS.

Upvotes: 2

Related Questions