简体   繁体   中英

VS2013 Solution Switching

I have been running across an annoying behavior after updating to the latest visual studio for a few weeks now and wanted to see if anyone else is experiencing the same issues and/or knows how to avoid them.

It goes like this

  1. Open TEST solution
  2. Fix bug in TEST branch, checkin, merge to dev ect.
  3. Close TEST solution
  4. Open DEV solution
  5. Wonder why nothing in Dev is right for about 40 minutes

Or this

  1. Find bug in DEV
  2. Update class library code to do some more correct thing
  3. Fire up the debugger to verify changes
  4. Wonder why the obvious change in #2 isn't working

It seems like what's going on is:

  1. When trying to debug DEV code IIS Express still is running a copy of Test.
  2. Changes to dependent libraries aren't always reflected in the code that's being debugged

What I've been doing to switch branches

  1. Stop IIS
  2. Shut down VS
  3. Delete IIS Express temp files located at: C:\\Users\\myuser\\AppData\\Local\\Temp\\Temporary ASP.NET Files
  4. Re-open VS
  5. Back to coding

Any ideas? I wasn't having the same troubles in VS2012

(This answer assumes you are using a VCS that checks out branches to different folders, like TFS, but not GIT).

This appears to be a new bug in VS2013 (and still present in Update 2)... the issue is that the IISExpress applicationhost.config file is not updated to point to the location of your new branch.

You can manually update the file (located at Documents\\IISExpress\\config) or you can continue doing things like deleting the temp files which sometimes causes the file to get updated).

h/t: http://www.ninjacrab.com/2013/09/24/iis-express-misdirection/

For example, given this config entry for the original branch/file location

  <site name="Website" id="2">
    <application path="/" applicationPool="Clr2IntegratedAppPool">
      <virtualDirectory path="/" physicalPath="C:\Users\myuser\Documents\Path\To\Original\Website" />
    </application>
    <bindings>
      <binding protocol="http" bindingInformation="*:54473:localhost" />
    </bindings>
  </site>

You can just edit the physicalPath to reflect the location of the new branch.

      <virtualDirectory path="/" physicalPath="C:\Users\myuser\Documents\Path\To\New\Website" />

I've been seeing this issue as well, well almost 100% the same. My env just stops communicating with my services (ones also in my project) and continues to throw errors about not finding my user record in the db, which 100% exists. So I run a little bat file I wrote to delete all the VS & IIS express cache, which usually get's me back up and running. Sometimes I have to reboot and repeat the process again before I'm fully operational though.

I feel your pain re this issue, but I'm so happy to see you reporting it. I was so torn as to how to begin to triage the problem without knowing if it was due to code, or a 2013/IIS express combo. It's so hard to triage this issues when all you can say for certain is that stuff just doesn't work all the time.

I have my fingers crossed with you, in the hopes that someone can shed a bit of light on at least how to begin to analyze the components in order to narrow in on the cause of this.

您可以打开两个Visual Studio窗口,在任务栏中单击Visual Studio图标,然后可以同时打开两个不同的解决方案,如果有两个屏幕,则每个屏幕上可以有一个。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM