My fellow dotNetters, I need your advice on what should be a simple process that VS 2010 & IIS Express makes complicated. I’m trying to keep a production branch and a dev branch on my laptop. Yes, I know multiple branches are a pain in the butt, but it is a fact of life.
The project is web forms (yes I know that MVC is cooler), VS 2010, IIS Express and SQL Server 2008. So, I figured this would be an easy process when I do a production release:
- Check-in code & tag it in subversion
- Update my prod code directory from the tagged version in subversion. Compile app and find what I didn’t check-in correctly. I call this the oh-sh!t phase.
- Apply DB updates from local dev DB to local prod DB.
- Run unit & smoke tests, aka, run nUnit.
- Problem: The web app defined in the solution file & is tied to the port in the IIS Express config file, “C:\Users\[name]\Documents\IISExpress\config\applicationhost.config”. So, even though there’s 2 separate physical paths on my laptop, the solution file is locked to a port in another config file. Argh!
1: Project("{E24C65DC-...}") = "localhost", "http://localhost:8082", "{ACF39ED5-...}"
2: ProjectSection(WebsiteProperties) = preProjectYou just have to “learn” that the port # in the solution file magically ties to the port # in the IIS Express config file. Bleh.
So intelligent fellows, how have you solved this situation?
Options that I thought about
- Use separate virtual machines – this just seems like overkill. Why do I need a separate OS per code branch? I want a more Java-ish solution that doesn’t require configs all over the place; I want a one-stop solution!
- Update the solution files – Yuck! Each time I update the “prod” branch from the tagged prod version, I have to remember to go update the port # in the solution file. Guess how often this will be forgotten…
- Maintain 2 solution files inside the project – Yucky, yuck! The idea is to keep 2 solutions files; one for dev and one for prod. Maybe worse than #2, because each time I add another project or other solution item, I have to update the other solution file.
- Please, please someone have a better idea!!!!!!!
What I’m doing now
I’m using option #2 above and it is painful. I can test prod fixes in one branch and update the repository (trunk or branch) with the changes. It isn’t a huge deal to remember to change the port in the solution, but I have to remember to NEVER check-in the prod branch solution file and each time I overwrite it, I have to manually edit it. There just has to be a cleaner way.
This is posted here, and I have posted a work around as well, please visit the site and up the issue as well as indicate you can reproduce it. The more people who comment, the sooner microsoft will issue a fix:
http://connect.microsoft.com/VisualStudio/feedback/details/734319/vs2010-iis-express-does-not-allow-branched-project-to-use-same-or-share-ports
Thanks; I went and up’d the vote.