3

I want to make changes to my web.config file but I dont want to check it out (as I really dont want to accidently check it in).

How can I do this? I unchecked 'read-only' in the file properties but this didn't help. Any ideas?

Exitos
  • 29,230
  • 38
  • 123
  • 178
  • 2
    Why do you want/need to make changes to it? If it is to do some personal configuration, like which database to develop against, the common way to handle this is to check in a `.config.template` file, and leave the actual `.config` file out of source control altogether. Then, in a pre-build step, check if the file exists and if not, copy from the template. That way, every developer has his/her personal copy of that file. – Lasse V. Karlsen Oct 26 '11 at 12:10
  • I work in a large company and I cant make this change, good advice but I had already thought of that and the answer was a clear resounding corporate NO. :-) – Exitos Oct 26 '11 at 12:37
  • 1
    Are you using Visual Studio 2010? Then use web.config transforms, and have a "Local" configuration, which would give you a web.local.config to play with (and maybe not check in). – John Saunders Oct 26 '11 at 15:47
  • @JohnSaunders is right, this is a great way to do it. We do that and it works wonderfully. – Nick Nieslanik Oct 27 '11 at 15:43
  • Using local config doesnt work. VS never transfrorms the web config for local debug even if I tell it to use that. Only publishing transforms the web.config – Piotr Kula Nov 10 '14 at 14:25

2 Answers2

3

You have to disable checking out files when you start editing them. This can be done via the source control part of the Visual Studio Configuration dialog.

PVitt
  • 11,500
  • 5
  • 51
  • 85
1

I tend to use the T4 template in which you can generate the local web.config based on some rules, so each developer has its own local customized web.config - or all devs use the same web.config that is different than the one you ship.

Ewald Hofman
  • 12,688
  • 3
  • 39
  • 44