0

I have a question regarding Visual Studio 2010 publish feature which is used after you create a website (MVC framework) to push your dev changes to the live site.

I've never worked with MVC until a few weeks ago and I've noticed that before pushing the website code I have to change everywhere where I have localhost in the code and replace it with the domain name I'm pushing to. Then if I want to debug anything on my local machine I have to revert everything back to localhost from domain name.

Q: Is there a way to not do this back and front url changing?

Basically I think it boils down to needing a software package or sth that knows to deploy the website with production configuration.

Maybe have a local branch and a live branch? This involves merging files all the time.

Thanks :)

tereško
  • 58,060
  • 25
  • 98
  • 150
Adrian
  • 5,603
  • 8
  • 53
  • 85

1 Answers1

2

I am not sure it works with MVC, but one approach we use for web services development is to use the web.config transformations.

This means that the normal development stuff is in Web.config and we have separate configurations depending on the deployment environment Web.staging.config and Web.production.config.

Peter K.
  • 8,028
  • 4
  • 48
  • 73