I think (not 100% sure though) that you can write settings using
ConfigurationManager without actually having to commit any changes to hard-drive
/ app.config. So, you can store settings in separate cofig file, then use
ConfigurationManager to create an in-memory setting that CSLA can read.
Sergey Barskiy
Senior Consultant
office: 678.405.0687 |
mobile: 404.388.1899
Microsoft Worldwide Partner of the Year | Custom
Development Solutions, Technical Innovation
From: Marjon
[mailto:cslanet@lhotka.net]
Sent: Monday, June 16, 2008 2:02 AM
To: Sergey Barskiy
Subject: [CSLA .NET] Allowing users to change dataportalto application
server mode
We
are writing an application were the user can choose to use an application
server or not. This information is stored within the app.config of the project.
However, we are in the process of getting the application certified for use
with Windows Vista (to get some Microsoft Partner Points) and the app.config
file can not be changed by a normal user (only admin) which is presenting a
problem for us.
We can move the database connection and number of other settings that can
change out into their own settings.config file stored within a writable path on
the system, however, if we move the csla settings then we would need to change
CSLA itself. This we want to avoid if at all possible.
I was curious if anyone else has ran into this problem and how they have solved
it, or what approach you would take. The other alternative is to write a
seperate application which can escalate permsissions, but this would be a bit
of a pain with our current setup.
Thanks,
Marjon
How about using this technique:
In the app.config file set:
<appSettings file="user.config">
Then in the file user.config you can set:
<?xml version="1.0" encoding="utf-8" ?>
<appSettings>
<add key="ConnectionString" value="data source=myDBServer;database=MyDB;uid=someUser;password=somePwd" />
</appSettings>
Joe
Copyright (c) Marimer LLC