PC Review


Reply
Thread Tools Rate Thread

How to access another application's config data?

 
 
Brad Wood
Guest
Posts: n/a
 
      22nd Nov 2005
I think it's possible to use the System.Configuration.ConfigXmlDocument
class to load a config file other than my application's, but I doubt
that's the recommended way since that class is documented as "not
intended to be used directly from your code".

In 2.0, there is a bunch of new stuff in the System.Configuration
namespace but nothing that looks like what I need.

Is there a proper way to do this?
 
Reply With Quote
 
 
 
 
JV
Guest
Posts: n/a
 
      22nd Nov 2005
You could always try just the good ol' XmlDocument class since it is an XML
file.


"Brad Wood" <bradley|.wood|@ndsu|.edu> wrote in message
news:(E-Mail Removed)...
>I think it's possible to use the System.Configuration.ConfigXmlDocument
>class to load a config file other than my application's, but I doubt that's
>the recommended way since that class is documented as "not intended to be
>used directly from your code".
>
> In 2.0, there is a bunch of new stuff in the System.Configuration
> namespace but nothing that looks like what I need.
>
> Is there a proper way to do this?



 
Reply With Quote
 
michaelmoser01@gmail.com
Guest
Posts: n/a
 
      22nd Nov 2005
I don't know much about your application, however it seems that the
applications are separated for a reason. So if one application wants
information from the other application, then the other application
should offer an interface to access that information. Don't go behind
the scenes. If this does not make sense? Can you describe your
applications or needs more? Or, let me know if you need advice on
creating the proper interface, service, ect.

 
Reply With Quote
 
Brad Wood
Guest
Posts: n/a
 
      22nd Nov 2005
Yeah, but I'm trying to avoid the DRY principle.

JV wrote:
> You could always try just the good ol' XmlDocument class since it is an XML
> file.

 
Reply With Quote
 
Brad Wood
Guest
Posts: n/a
 
      22nd Nov 2005
That makes sense in general, but in my situation it's just a matter of a
test suite needing access to some string literals (and I'd rather keep
them in one place).
Providing an interface for the test code would not be appropriate IMO.

(E-Mail Removed) wrote:
> I don't know much about your application, however it seems that the
> applications are separated for a reason. So if one application wants
> information from the other application, then the other application
> should offer an interface to access that information. Don't go behind
> the scenes. If this does not make sense? Can you describe your
> applications or needs more? Or, let me know if you need advice on
> creating the proper interface, service, ect.
>

 
Reply With Quote
 
Richard Grimes
Guest
Posts: n/a
 
      25th Nov 2005
Brad Wood wrote:
> That makes sense in general, but in my situation it's just a matter
> of a test suite needing access to some string literals (and I'd
> rather keep them in one place).
> Providing an interface for the test code would not be appropriate IMO.


If they are shared values then they should go in machine.config.

The idea behind the application config file (which has weaknesses as
well as strengths) is that it allows you to have XCOPY deployment, that
is, you deploy the app simply by copying its files.

If you share values between application files then you break XCOPY
deployment. Indeed, if you put those values in machine.config then XCOPY
deployment is also broken, but at least you know where the values should
be.

Richard
--
http://www.grimes.demon.co.uk/workshops/fusionWS.htm
http://www.grimes.demon.co.uk/workshops/securityWS.htm


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Why do I need to move config file to host when using Data Access B Mike Microsoft C# .NET 1 22nd Mar 2010 09:24 PM
appdata-local-Application Data-Application Data-Application Data infinitum ad nauseum. WHY keepout@yahoo.com.invalid Windows Vista General Discussion 15 16th Sep 2007 01:50 AM
Basic design question for a distributed application - How to access application's data JB Microsoft VB .NET 4 31st Aug 2007 07:39 PM
Can't Access application config file with APPSETTINGS through fire =?Utf-8?B?Sm9obiBCb3du?= Microsoft Dot NET Framework 1 24th Sep 2004 03:39 PM
Access Web.Config from a Console / Windows application christopher green Microsoft C# .NET 4 23rd Jun 2004 03:27 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:06 PM.