modifying app.config during runtime

Posts   
 
    
tvoss avatar
tvoss
User
Posts: 192
Joined: 07-Dec-2003
# Posted on: 24-May-2005 19:32:11   

Are devs modifying app.config during runtime for the first time setup of a user app?

Or how do we programmatically get connection info from user and then apply so LLBL can use it?

TIA

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39749
Joined: 17-Aug-2003
# Posted on: 25-May-2005 10:22:41   

Modifying the app.config file at runtime is not recommended. (it's not even possible without hacks in .NET 1.1, it is in 2.0 though). Is the problem that you need storage for the connection info ? You could try encrypted xml files or other storage solutions, you read them once, set the DbUtils.ActualConnectionString (or pass it to the adapter constructor if you're using adapter).

Frans Bouma | Lead developer LLBLGen Pro
tvoss avatar
tvoss
User
Posts: 192
Joined: 07-Dec-2003
# Posted on: 26-May-2005 18:43:55   

No, the problem is that I need to gather input from the user regarding their sql installation.

I find you can write to the files: app.config and myapp.exe.config fine, if you have the permissions, and then instruct the user to restart app for settings to take effect.

I was just wondering how people using LLBL are doing deployment without having a sophisticated custom scripting setup program.

Are there any other concerns with distribution that you can tip me to?

Don't usually have to deploy apps much.

By the way, is my picture showing up? I can't tell because my firewall doesn't let me see local content over the internet.

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39749
Joined: 17-Aug-2003
# Posted on: 27-May-2005 11:21:07   

tvoss wrote:

No, the problem is that I need to gather input from the user regarding their sql installation.

Ah, during setup / deployment ... simple_smile

Are there any other concerns with distribution that you can tip me to?

Well, avoid the GAC if you don't have to use it. Most of the time, the GAC can be avoided by simply keeping the assemblies of the application in the application folder.

Deployment is some sort of black art as it seems disappointed It requires a lot of testing on various setups. Especially what will happen if the user doesn't have enough access rights to the system components the setupprogram has to make changes to (like registry etc.). Or what happens if the user installs on a network share...

By the way, is my picture showing up? I can't tell because my firewall doesn't let me see local content over the internet.

It shows up fine simple_smile

Frans Bouma | Lead developer LLBLGen Pro