VSS web.config multiple.

Y

yurps

Hello I have a couple of developers working on a web app.
They all need to be able to change their local copy of the web.config
file to run against their local databases. The copy in VSS needs to
point to the main application database. But only one copy of
web.config can be check-out at once, and undo checkout overwrites the
changes from VSS.

What can I do.
 
B

Brock Allen

When you get the code from VSS, make the file read/write (so uncheck the
readonly flag). I do this in windows (not anything in VS.NET), so then any
modifications won't trigger a checkout.
 
G

Guest

If you're using the AppConfig section for the connection string, you can
use user.config files which are not in VSS. Just on the dev machines. Specify

the section in web.config (which is in VSS) like that:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings file="user.config">
<add key="YourConnectionString" value="YourProdOrStagingConnectionStringValue"/>
</appSettings>
</configuration>

Place a user.config in the same folder like the web.config on the dev machines.

The user.config looks like that:

<?xml version="1.0" encoding="utf-8"?>
<appSettings file="user.config">
<add key="YourConnectionString" value="YourLocalConnectionStringValue"/>
</appSettings>

As long as a user.config is available, the config values from the user.config

are taken. If no user.confiig is in place, the values from the web.config
are taken (can say as a fallback).
That works for the appSettings section only but - of course - you can create
a similar mechanism for your own sections.

Cheers,
Joachim
 
B

Brock Allen

This just leads him down the same path if the user.config is checked in.
At the end of the day, you'll have to somehow edit the file without checking
it out. This means you'll have to do something manually (outside of VS.NET).
 
J

Joachim Roppert

"...which are not in VSS." means that the User.config MUST NOT be checked
in to VSS.
 
J

Joe Masters

Enable multiple checkouts and have the developers leave it checked out. When
it really changes, they'll need to get the latest and then checkout again to
edit it so it points to the proper locations.

I don't know if it's covered here or not, but you might try perusing the
first two articles at:

http://msdn.microsoft.com/ssafe/technical/articles.asp

Joe
 
Y

yurps

Thanks for all the recommendations all !

The multiple check-out seems to be a bit dangerous,
it is a shame that this cannot be specified on a per file
basis.
 
M

Martin Venter

Hi

I had the same problem.
Here is what you do.

Change this in the web.config file:
<appSettings>
....
</appSettings>
to
<appSettings file="user.config">
....
</appSettings>

Now each developer needs to create a user.config file. This file should not
be checked into source safe.
The user.config file should look like this:
<?xml version="1.0" encoding="utf-8"?>
<appSettings>
....
</appSettings>

Regards,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top