Go Back   TechArena Community > Software > Software Development
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Reply
 
Thread Tools Search this Thread
  #1  
Old 06-10-2009
Member
 
Join Date: Jun 2009
Posts: 92
Loading a configuration file

I have a pretty simple problem: I develop a DLL in C# that is used by several programs. This DLL must use a user configuration file serialized to disk. The problem is that for the moment each time a function needs a variable configuration, it serializes the file. I seek an easy way to load the configuration into memory once and for all and thus be able to access at will. What is the best method for loading a configuration file?
Reply With Quote
  #2  
Old 06-10-2009
Member
 
Join Date: May 2008
Posts: 685
Re: Loading a configuration file

Did you tried to use a resource file (resx)? In VS, you can save your conf in a "resource file". This is an xml file (the extension is .resx). As technology is integrated with .Net, I guess maybe it runs better multiple access by several programs. Because your problem, I understand, is that your conf file should be serialized and deserialized at each access for the correct version, which is heavy.
Reply With Quote
  #3  
Old 06-10-2009
Member
 
Join Date: May 2008
Posts: 2,383
Re: Loading a configuration file

I do not understand your stories of serialization. If you trigger a disk access each time you access a parameter and you deserialize your file every time it's a matter of implementation, the file format and where there is nothing to see. You can certainly read the serialized file to launch the program and loaded into memory once and for all values therein.
__________________
The FIFA Manager 2009 PC Game
Reply With Quote
  #4  
Old 06-10-2009
Member
 
Join Date: Feb 2008
Posts: 1,848
Re: Loading a configuration file

First make sure that .NET account has Full Read/Write Access to the root as well as check that the web.config is not in readOnly mode. Now just follow the below steps to load a configuration file:

1. In the Choose an installation option pane, click Load Configuration. This option is located under Custom Components.
2. In the Open dialog box, select or browse to the Setup configuration file that you want to open.
3. Double-click to choose the file.
4. Setup now shows the Customize the installation page. You can further modify the list of components to install, or click Next to proceed to the Specify parameters pane, where you can further configure settings for one or more components.
Reply With Quote
Reply

  TechArena Community > Software > Software Development
Tags: , , ,



Thread Tools Search this Thread
Search this Thread:

Advanced Search


Similar Threads for: "Loading a configuration file"
Thread Thread Starter Forum Replies Last Post
WD 1002FAEX-00Z3A0 very slow on loading file Loverface Hardware Peripherals 5 28-08-2011 03:54 PM
Where can I find gateway configuration file Jaxine Networking & Security 5 13-01-2010 11:41 AM
Loading content of a text .txt file using jQuery Gap meer Software Development 3 04-08-2009 07:16 PM
Configuration File named.conf Gunner Operating Systems 2 25-03-2009 03:00 PM
Error Loading dll file: Specified module could not be found Bull50 Operating Systems 3 21-02-2009 12:57 PM


All times are GMT +5.5. The time now is 05:07 PM.