Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Distributed Applications / February 2004

Config Application Block: can you override settings at local dev boxes?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mike Hennessy - 25 Feb 2004 19:23 GMT
I am putting together our configuration managment plan for my company, and I
really like the CMAB for this solution. I want to utilize a central SQL
storage DB for each of our environements, and then have all our .NET
projects use this mechansim.

A question/need we have is to allow a developer to override those config
settings at his local box. If you have a local config with the same name
config names, will the CMAB use those local settings over the central
storage settings? Similiar to how ASP.NET will use the local web.config,
then the machine.config?

Thanks for any info on this topic.
richlm - 25 Feb 2004 20:24 GMT
"Out of the box" I am pretty sure it does not.

But you do get the source code when you install CMAB, and the component is
designed to be extensible.
For example you could write a new "Custom Configuration Storage Provider"
which provides the features you are looking for.
The .chm help file includes basic information on how to do this.
My guess is it would be a case of cut/paste from the standard providers - or
perhaps just calling either one of them directly using a simple routing
algorithm.

There's also a community workspace on GotDotNet dedicated to CMAB (hosted by
the team responsible for building app blocks) - I am sure they would like to
hear your ideas:
http://www.gotdotnet.com/community/workspaces/Workspace.aspx?id=01875f69-9358-43
7b-a8ae-fa4bf2e3080f

(if the link fails search workspaces for "configuration")

> I am putting together our configuration managment plan for my company, and I
> really like the CMAB for this solution. I want to utilize a central SQL
[quoted text clipped - 8 lines]
>
> Thanks for any info on this topic.
Yan-Hong Huang[MSFT] - 26 Feb 2004 08:31 GMT
Hello Mike,

Thanks for posting in the group.

Surely we can do it from CMAB. Just like what Rich said, we can plug our
own Configuration Storage Provider (CSP) and Data Protection Provider (DPP)
implementations. The CMAB provides an extensible framework into which you
can plug your own CSP and DPP. Coupled with the ability to define your own
CSH, this means that you can store any data in any repository and support
any security implementation.

By the way, I am not quite understand your concerns here.
"If you have a local config with the same name config names, will the CMAB
use those local settings over the central storage settings?"

CMAB is an application block which provides us a simple and quick way to
read/write settings of our application. If that developer loads the
application setting from his local config file instead of the central SQL
place. Surely only the local setting works for him. If I have anything
misunderstood, please feel free to post here.

Have a good day.

Best regards,
Yanhong Huang
Microsoft Community Support

Get Secure! ?C www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.
Mike Hennessy - 26 Feb 2004 14:02 GMT
Hi YahHong, thanks for the reply. I now understand that we could create our
own CSP for this....just a little more work.

As for my question, let me explain the scenario. We have multiple dev teams
working on multiple dev projects. I'm looking to create a "standard" way
that all our .NET projects should implement storing/using config settings. I
like the ability via CMAB to provide a single SQL storage facililty, and a
single method for reading/writing those settings.
But let's consider a specific config setting for a database DSN called
"MarketingDSN".

Since we have multiple environments, I would have a separate config database
for each one...we don't want to be sharing resources across environements.
So, in this central config db, I would have our MarketingDSN config setting.
all Developers would use the CMAB, and would know the MarketingDSN setting
is defined and can be used in that environemnt, so they don't need to create
that setting themselves.

In their code, they would have ConfigurationManager code like this:
string marketingdsn = (string)ConfigurationManager.Items["MarketingDSN"])

Now, by default, we would want this to read from the central config db.
However, let's say the developer, on his local box needs to change that
setting for some testing to a "testing" marketingDSN. We don't want him to
change the central setting...other's would be using it. Instead, it would be
great if , in his web.config, if he created an appsetting called
"MarketingDSN", this value would be used. So the CMAB would look locally,
and if the value was there, use that one, otherwise, use the central one.

Does that help? I'm assuming very possible with some small tweaks to the
CMAB.

Thanks again,
Mike

> Hello Mike,
>
[quoted text clipped - 25 lines]
> Get Secure! ?C www.microsoft.com/security
> This posting is provided "AS IS" with no warranties, and confers no rights.
Yan-Hong Huang[MSFT] - 27 Feb 2004 03:00 GMT
Hi Mike,

Surely it can be done by customizing CMAB. However, I think we could define
a Macro in the code behind. And write two code block to read setttings from
different sources. Just like in C++,

#ifdef _USELOCALSETTING
......
#elseif
.....
#endif

So we can easily change config setting source from local to central place
by defining this Macro in project. It should be a much easier way to
achieve what you need.

Does that answer your question? :)

Best regards,
Yanhong Huang
Microsoft Community Support

Get Secure! ?C www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.