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 / Visual Studio.NET / General / November 2006

Tip: Looking for answers? Try searching our database.

My.Settings versus AppSettingsReader in solutions with multiple project config files

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
bri@northfieldbham.freeserve.co.uk - 24 Nov 2006 10:52 GMT
All,

I've trawled the net for an answer to this particular query and have so
far come up blank.

The situation is that I have a business object component (call it
Business.dll) which I want to use as part of a number of applications,
developed using VS2005. For the moment, I want to deploy it as part of
client applications which will also be developed with VS2005. However,
I also want to be able to control the configuration of the DLL
independently of the configuration of the EXE.

Within the Business solution file, I have an app.config file which is
created as a result of adding project settings. When I compile
Business.dll, Business.dll.config duly appears in the bin folder of the
Business project. When I include the project into a client application
solution (I reference the source code rather than a reference to a DLL)
and compile the client application, the Business.dll.config file is not
copied across.

Within the Business.dll.config, all references to application settings
are handled using the My.Settings namespace. However, it appears that
when the DLL is compiled within a composite application, the default
settings from the project Settings.settings file are used, whether or
not the Business.dll.config file is present. This is obviously not the
behaviour that was required or expected.

Am I doing something fundamentally wrong, for example do I need to
access the app.config files using the configuration manager to access
the business.dll.config file explicitly?

Any help or pointers in the right direction gratefully received.

Thanks,
Brian
Michel de Becdelièvre - 26 Nov 2006 11:25 GMT
> All,
>
> I've trawled the net for an answer to this particular query and have so
> far come up blank.
...
> Within the Business.dll.config, all references to application settings
> are handled using the My.Settings namespace. However, it appears that
[quoted text clipped - 11 lines]
> Thanks,
> Brian

The way I'm handling this kind of trouble is by including external config
files in App.config / Web.config :
for instance :

 <connectionStrings configSource="Base.config">
 </connectionStrings>

 <appSettings file="Commun.config">
 </appSettings>

I believe this comes with a price : automatic detection of file change is
disabled.

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.