By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,034 Members | 1,777 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,034 IT Pros & Developers. It's quick & easy.

VSS web.config multiple.

P: n/a
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.

Nov 19 '05 #1
Share this Question
Share on Google+
7 Replies


P: n/a
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.

-Brock
DevelopMentor
http://staff.develop.com/ballen
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.


Nov 19 '05 #2

P: n/a

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

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.


Nov 19 '05 #3

P: n/a
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).

-Brock
DevelopMentor
http://staff.develop.com/ballen
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
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.


Nov 19 '05 #4

P: n/a

"...which are not in VSS." means that the User.config MUST NOT be checked
in to VSS.
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).

-Brock
DevelopMentor
http://staff.develop.com/ballen
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
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.


Nov 19 '05 #5

P: n/a
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
"yurps" <yu***@yahoo.co.uk> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
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.

Nov 19 '05 #6

P: n/a
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.
Joe Masters wrote:
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
"yurps" <yu***@yahoo.co.uk> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
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.


Nov 19 '05 #7

P: n/a
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,

"yurps" <yu***@yahoo.co.uk> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...
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.
Joe Masters wrote:
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
"yurps" <yu***@yahoo.co.uk> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
> 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.
>

Nov 19 '05 #8

This discussion thread is closed

Replies have been disabled for this discussion.