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

Question about different buils/compiles (dev, test, production enviroment) (Help needed !)

P: n/a
In our company, i have three servers;

1) a development server (mine only - here i make daily changes and test my
stuff)
2) a test server (for the users to test milestone builds - changes weekly)
3) production server (for when a new build is fully tested, and stable)

The problem is that the connectionstring in the web.config, should be
replaced with something else, for each of the enviroments.

Another problem is that, i use wsdl.exe to generate proxy classes to
communicate with my webservices. And these have the "this.Url" property
hardcoded to the webservice (starting with the development enviroment -
since that's the first release).

How can I;

1) Easily choose between a Development, Test, Production, so that the the
data in the web.config corresponds to what i want ?
2) Easily change a week old build of my exe, which has build in proxy
classes to the webservices, to point at another webservice ?

I'm looking for a solution that's easy to use from inside .NET, so i don't
have to manage ugly .bat files or something like this.

Thanks.

PS : I know i can put different keys into web.config, and make contants in
my code, but this means i have to recompile. I don't want this, i just want
to change an entire application from the state of (for example)
"development" to "test" with the 'click of a button' :-)
Nov 15 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
1. Strange. Why and where do you have the URL in web.config file? If you
REALLY need url references in web config why didn't you use relative paths?
2. Change the proxy constructor to Service(string ServerURL) and modify
this.url = "http://webserver/blablabla"; to this.url = ServerURL +
"blablabla";
Then, on client side you can store the ServerURL string in a file or
something, to retrieve it when the client application starts, and change it
whenever you want to switch to another server.
--
Horatiu Ripa

"Benne Smith" <do**@write.to.me.directly.com> wrote in message
news:3f*********************@news.dk.uu.net...
In our company, i have three servers;

1) a development server (mine only - here i make daily changes and test my
stuff)
2) a test server (for the users to test milestone builds - changes weekly)
3) production server (for when a new build is fully tested, and stable)

The problem is that the connectionstring in the web.config, should be
replaced with something else, for each of the enviroments.

Another problem is that, i use wsdl.exe to generate proxy classes to
communicate with my webservices. And these have the "this.Url" property
hardcoded to the webservice (starting with the development enviroment -
since that's the first release).

How can I;

1) Easily choose between a Development, Test, Production, so that the the
data in the web.config corresponds to what i want ?
2) Easily change a week old build of my exe, which has build in proxy
classes to the webservices, to point at another webservice ?

I'm looking for a solution that's easy to use from inside .NET, so i don't
have to manage ugly .bat files or something like this.

Thanks.

PS : I know i can put different keys into web.config, and make contants in
my code, but this means i have to recompile. I don't want this, i just want to change an entire application from the state of (for example)
"development" to "test" with the 'click of a button' :-)

Nov 15 '05 #2

P: n/a
Hi, and thanks for your reply.

The "this.Url" is in the generated proxy class (wsdl.exe), not in the
web.config. And if i manually have to update this url, it really a bommer,
because I generate this proxy class, every time i extend my webservice (many
times a day).

In the web.config (the webservices) is located the connectionstrings, they
also change for each enviroment.

I see your idea, but it's not nearly flexible enough.

If you have more ideas, please post more.

Thanks !

:-) Benne

"Horatiu Ripa" <un****@businessco.us> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
1. Strange. Why and where do you have the URL in web.config file? If you
REALLY need url references in web config why didn't you use relative paths? 2. Change the proxy constructor to Service(string ServerURL) and modify
this.url = "http://webserver/blablabla"; to this.url = ServerURL +
"blablabla";
Then, on client side you can store the ServerURL string in a file or
something, to retrieve it when the client application starts, and change it whenever you want to switch to another server.
--
Horatiu Ripa

"Benne Smith" <do**@write.to.me.directly.com> wrote in message
news:3f*********************@news.dk.uu.net...
In our company, i have three servers;

1) a development server (mine only - here i make daily changes and test my stuff)
2) a test server (for the users to test milestone builds - changes weekly) 3) production server (for when a new build is fully tested, and stable)

The problem is that the connectionstring in the web.config, should be
replaced with something else, for each of the enviroments.

Another problem is that, i use wsdl.exe to generate proxy classes to
communicate with my webservices. And these have the "this.Url" property
hardcoded to the webservice (starting with the development enviroment -
since that's the first release).

How can I;

1) Easily choose between a Development, Test, Production, so that the the data in the web.config corresponds to what i want ?
2) Easily change a week old build of my exe, which has build in proxy
classes to the webservices, to point at another webservice ?

I'm looking for a solution that's easy to use from inside .NET, so i don't have to manage ugly .bat files or something like this.

Thanks.

PS : I know i can put different keys into web.config, and make contants in my code, but this means i have to recompile. I don't want this, i just

want
to change an entire application from the state of (for example)
"development" to "test" with the 'click of a button' :-)


Nov 15 '05 #3

P: n/a
You can create different configurations like Debug and Release let say,
Development,Production,Testing

Than you must define for each configuration Conditional Compilation
Constants (in Project Properties) (let say also
Development,Production,Testing)

then define in code some variables depending on the configuration

in c# is like that

#if (Production)
public static String ConnectionString="some connection string...";
#endif

#if (Development)
public static String ConnectionString="other connection string...";
#endif

Then choose the configuration you want and make a build

You also can make different configurations file for each configuration and
set them from configuration properties

Hope this helps

Dan Cimpoiesu

"Benne Smith" <do**@write.to.me.directly.com> wrote in message
news:3f*********************@news.dk.uu.net...
Hi, and thanks for your reply.

The "this.Url" is in the generated proxy class (wsdl.exe), not in the
web.config. And if i manually have to update this url, it really a bommer,
because I generate this proxy class, every time i extend my webservice (many times a day).

In the web.config (the webservices) is located the connectionstrings, they
also change for each enviroment.

I see your idea, but it's not nearly flexible enough.

If you have more ideas, please post more.

Thanks !

:-) Benne

"Horatiu Ripa" <un****@businessco.us> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
1. Strange. Why and where do you have the URL in web.config file? If you
REALLY need url references in web config why didn't you use relative paths?
2. Change the proxy constructor to Service(string ServerURL) and modify
this.url = "http://webserver/blablabla"; to this.url = ServerURL +
"blablabla";
Then, on client side you can store the ServerURL string in a file or
something, to retrieve it when the client application starts, and change

it
whenever you want to switch to another server.
--
Horatiu Ripa

"Benne Smith" <do**@write.to.me.directly.com> wrote in message
news:3f*********************@news.dk.uu.net...
In our company, i have three servers;

1) a development server (mine only - here i make daily changes and test my
stuff)
2) a test server (for the users to test milestone builds - changes weekly) 3) production server (for when a new build is fully tested, and
stable)
The problem is that the connectionstring in the web.config, should be
replaced with something else, for each of the enviroments.

Another problem is that, i use wsdl.exe to generate proxy classes to
communicate with my webservices. And these have the "this.Url" property hardcoded to the webservice (starting with the development enviroment - since that's the first release).

How can I;

1) Easily choose between a Development, Test, Production, so that the
the data in the web.config corresponds to what i want ?
2) Easily change a week old build of my exe, which has build in proxy
classes to the webservices, to point at another webservice ?

I'm looking for a solution that's easy to use from inside .NET, so i don't have to manage ugly .bat files or something like this.

Thanks.

PS : I know i can put different keys into web.config, and make
contants in my code, but this means i have to recompile. I don't want this, i just

want
to change an entire application from the state of (for example)
"development" to "test" with the 'click of a button' :-)



Nov 15 '05 #4

P: n/a
hi dan thanks for your reply,

Ah ok ! that helped to understand the configuration changes. but i'll still
need external bat files to generate my webservice proxyclasses to different
url locations (dev, test, prod). everything can't re accomplished from
inside the development enviroment, right ?

an example;

if i change the configuration to Development, and compile, i would like it
to autogenerate proxy classes (wsdl.exe) to a certain url (another url than
Test and Prod).

Thanks !

:-) Benne

"Dan Cimpoiesu" <da**********@gmx.net> wrote in message
news:eW**************@TK2MSFTNGP11.phx.gbl...
You can create different configurations like Debug and Release let say,
Development,Production,Testing

Than you must define for each configuration Conditional Compilation
Constants (in Project Properties) (let say also
Development,Production,Testing)

then define in code some variables depending on the configuration

in c# is like that

#if (Production)
public static String ConnectionString="some connection string...";
#endif

#if (Development)
public static String ConnectionString="other connection string...";
#endif

Then choose the configuration you want and make a build

You also can make different configurations file for each configuration and
set them from configuration properties

Hope this helps

Dan Cimpoiesu

"Benne Smith" <do**@write.to.me.directly.com> wrote in message
news:3f*********************@news.dk.uu.net...
Hi, and thanks for your reply.

The "this.Url" is in the generated proxy class (wsdl.exe), not in the
web.config. And if i manually have to update this url, it really a bommer,
because I generate this proxy class, every time i extend my webservice

(many
times a day).

In the web.config (the webservices) is located the connectionstrings, they also change for each enviroment.

I see your idea, but it's not nearly flexible enough.

If you have more ideas, please post more.

Thanks !

:-) Benne

"Horatiu Ripa" <un****@businessco.us> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
1. Strange. Why and where do you have the URL in web.config file? If you REALLY need url references in web config why didn't you use relative

paths?
2. Change the proxy constructor to Service(string ServerURL) and modify this.url = "http://webserver/blablabla"; to this.url = ServerURL +
"blablabla";
Then, on client side you can store the ServerURL string in a file or
something, to retrieve it when the client application starts, and change
it
whenever you want to switch to another server.
--
Horatiu Ripa

"Benne Smith" <do**@write.to.me.directly.com> wrote in message
news:3f*********************@news.dk.uu.net...
> In our company, i have three servers;
>
> 1) a development server (mine only - here i make daily changes and test
my
> stuff)
> 2) a test server (for the users to test milestone builds - changes

weekly)
> 3) production server (for when a new build is fully tested, and

stable) >
> The problem is that the connectionstring in the web.config, should
be > replaced with something else, for each of the enviroments.
>
> Another problem is that, i use wsdl.exe to generate proxy classes to
> communicate with my webservices. And these have the "this.Url"

property > hardcoded to the webservice (starting with the development enviroment - > since that's the first release).
>
> How can I;
>
> 1) Easily choose between a Development, Test, Production, so that the the
> data in the web.config corresponds to what i want ?
> 2) Easily change a week old build of my exe, which has build in

proxy > classes to the webservices, to point at another webservice ?
>
> I'm looking for a solution that's easy to use from inside .NET, so i

don't
> have to manage ugly .bat files or something like this.
>
> Thanks.
>
> PS : I know i can put different keys into web.config, and make

contants
in
> my code, but this means i have to recompile. I don't want this, i just want
> to change an entire application from the state of (for example)
> "development" to "test" with the 'click of a button' :-)
>
>



Nov 15 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.