0

Currently,

When I deploy to a development server, I use one connection string, but when I deploy to a live server, I have to comment out the development connection string and use a live connection string. I also have to do this with a sitemap, where I may have a menu item show up on the development server, but when I deploy to the live server and I don't want to show that menu item, I have to comment it out. Is there a way to currently display a different sitemap and use a different connection string based upon if you are on a development server or live server. I heard this is going to be addressed in .net 4.0?

Rupesh Yadav
  • 12,096
  • 4
  • 53
  • 70
Xaisoft
  • 45,655
  • 87
  • 279
  • 432

2 Answers2

1

""How to use different web.config in different environments" Would be a better title. We have a simialar question here : Using different Web.config in development and production environment

Also check out Visual Studio 2010: Multiple web.config versions

alt text

Community
  • 1
  • 1
Shoban
  • 22,920
  • 8
  • 63
  • 107
1

I can't comment on the sitemap but for the connection string I use the local Hosts file (C:\Windows\System32\Drivers\etc) to create an entry with the same domain name as my production SQL but point it to 127.0.0.1.

i.e. 127.0.0.1 db.mydomain.com

By using the same login credentials the connection string is the same for both the prod and the dev environments, nothing needs to change as the production platform picks up the SQL hostname as the correct production IP address. Works a treat :)

Lazarus
  • 41,906
  • 4
  • 43
  • 54