Re: access the calling user's config info from a dll?
- From: "Barry Mossman" <NOSPAM@xxxxxxxxxx>
- Date: Tue, 18 Jul 2006 09:47:07 +1000
"Norman Yuan" <NotReal@xxxxxxxxxxx> wrote in message
news:%23Aj$QZCqGHA.3288@xxxxxxxxxxxxxxxxxxxxxxx
You should not read exe's app settings directly from inside dll's code.
DLL, by its nature, is code module that seperates from exe code with
consideration that it could be used by other exes (of course that are other
reasons to use dll).
If you do the app.cofg reading inside dll code, you physically tie the dll
with certain exe, the dll's reuseability is go partially or completely,
even different version of the same exe may break the dll.
Thanks for your help Norman.
As you say there are many reasons to use DLL's, and not all of them are
aimed at achieving reuse. I am trying to isolate my BO's from the
unnecessary risk that could be caused by all the minor expected changes to
the UI. Tying this dll to the exe isn't a great concern to me.
If I printed all the helptext associated with the new v2 user config
facilities (ApplicationSettingBase and ConfigurationManager classes and all
their members etc) I am sure that it would take more than a ream of paper.
It seems a deficiency to me that the new facilities don't allow for a dll to
easily access and update it's caller's config information. I did get
OpenMappedExeConfiguration method going, but can't get at the config
information in a type safe manner, and I got confused about permission and
locking considerations.
Again, I'd never read user/app config in dll. If you need to process
information from *.config in the dll code, you can always read them from
the calling exe app and pass the data itself to a dll object to process it
(and return back the changed data and save to *.config by the exe).
I implemented your suggestion re an interface class. I am quite pleased with
it, although my UI now has to include some complexity that I was hoping to
encapsulate into the BO dll. I guess that I will thank you if I ever reuse
the dll.
Thanks again for your help.
Barry Mossman
.
- References:
- access the calling user's config info from a dll?
- From: Barry Mossman
- Re: access the calling user's config info from a dll?
- From: Norman Yuan
- access the calling user's config info from a dll?
- Prev by Date: WinForm Single Instance App errors out with AccessViolationException
- Next by Date: Re: access the calling user's config info from a dll?
- Previous by thread: Re: access the calling user's config info from a dll?
- Next by thread: How could I achieve this?
- Index(es):
Relevant Pages
|