How to set up different web server config for different team members in Visual Studio Asp.net Project?

Viewed 48

I have a different developer, besides me, working on a Asp.net project (.net 4.5) on Visual Studio. The problem is that I use http://localhost/MyProject as my local server url, while he uses http://localhost:51123, probably because default port is already taken by another server.

The problem is when he commits a change to .csproj file, it change this configuration for me , and i have to change it back. And he's probably having the same problem when I change.

Is there a way for us to use different webserver, while allowing us to commit changes do .csproj file? (For when we add a new class or page, for instance).

How do you deal with that in your projects?

1 Answers

You can have 2 entries in appsettings configuration like

"AWebserver" : "AProject", "BWebserver" : "BProject"

where the url is passed use the Configuration object to read from the appsettings with your particular server key. It will make it a bit easy to as you only have to change the key that is being passed in the configuration object.

Related