473,775 Members | 2,434 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Reading an application's configuration file

I've hunted for a while so I'm hoping someone can shed some light on
this problem for me.

I have an application (not a web-app, in fact this is an installed
service) that relies upon its application configuration file to provide
it with sensitive information. In this case, the application is
talking to a website that requires credentials that are not the same as
the user that the application runs as (again, its installed as a
service).

I wanted to create a protected section inside of my file which is
foo.exe.config. I tried first by leveraging what was already available
in aspnet_regiis, but none of the options I gave it ever resulted in it
changing the configuration file (I did name it web.config just for
kicks with no luck). So I decided if that wouldn't work, the next best
thing would be to write a small app that reads the configuration file
and protects the sections I want. This actually works well, to a
degree...

The configuration file has specific section handlers. Well those
handlers are part of the assembly that is the executable that I am
configuring. In 90% of the cases, the tool that configures these apps
does not reside in the same location as the tool that it is trying to
configure. The result that the configuration loads, I reference a
section and I get an exception because it cant resolve the type needed
to handle the custom section. If I move the config tool to the same
location as the target executable it works as expected. I'd prefer not
to go down the road of trying to make CAS do what I want since that
would entail minimally ensuring that CAS includes the target executable
path as part of the search criteria.

What bugs me is that the MSDN documentation indicates that when
"designer" apps fail to load a section, they fallback to
DefaultSection. This would make life trivial for me if I could
actually have it fallback to this type. Does anyone know if you can
programmaticall y do this?

== Jaxx

Aug 31 '06 #1
0 1313

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
4740
by: Amy L. | last post by:
I have a basic console application that uses a app.exe.config file for all the application settings. The application through several revisions now has over 100 options that are set in the app.exe.config file. We decided to create a Windows Application that will configure this file. Is there any easy way to have have this configuration application read the other applications app.exe.config file so that the values can be accessed through...
1
2858
by: Paul Fi | last post by:
I have this problem with .NET remoting: my remote class is called RemoteHandler which implements an interface called IEazyRemoting which has only one method to be implemented which is my server configuration file looks like this: <configuration> <system.runtime.remoting> <application> <service>
2
2091
by: jassi | last post by:
Hi, i have an app.config file as follows : <?xml version="1.0" encoding="utf-8"> <configuration> <appSettings> <add key="button1.Text" value="cc1"/>
2
2748
by: Tony Jones | last post by:
Is it possible for me to create a class library DLL and have it read it's configuration settings from the web.config of the ASP.NET application referencing it? IE - if I call ConfigurationSettings.GetConfig("somesection") in one of the base class dll methods, will it/can it return the settings from the web.config? For example, I would like to create a base class library of utility classes that can be used with any ASP.NET application....
10
9471
by: Ryan | last post by:
I've created a custom configuration section that inherits (naturally) from System.Configuration.ConfigurationSection. The configuration section is working 99% fine, however I keep coming across a ConfigurationErrorException whenever I do the following: 1. Modify and save the section in code using the System.Configuration.Configuration.Save(). 2. Refresh teh section using ConfigurationManager.RefreshSection 3. Encrypt the section,...
0
4005
by: tmsprowl | last post by:
Greetings! I was wondering if someone could help me with a problem I'm having. My department is just one of many within my organization. My organization has control over the network domain, but my department has a couple of web servers of our own that are part of my organization's domain. I am trying to read LDAP information on my organization's domain controller from a web application on one of my department's servers. I have been...
0
8186
by: Lucky | last post by:
Hi guys, I've got a problem under reading settlings from App.config file. I've used System.Configuration to reach to the "User Settings" and "Application Settings" sections. the problem is now I'm not able read the property defined under this section. those are like this User Settings -Testing Application Settings -Test
3
3866
by: Peter K | last post by:
Hi I need to be able to supply some relatively complex configuration to an application. The application will either run in a web context (with a web.config file, or as a application with an app.config). The only configuration reading I have used before is AppSettings and I have also used Spring Framework. It is more the type of configuration that Spring uses I am looking at now.
1
2591
by: MasterLalit | last post by:
Hi, i am using a app.config file in my console application. App.config code--> <configuration> <configSections> <section name="enterpriseLibrary.ConfigurationSource" type="Microsoft.Practices.EnterpriseLibrary.Common.Configuration.ConfigurationSourceSection, Microsoft.Practices.EnterpriseLibrary.Common, Version=3.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" /> </configSections> <enterpriseLibrary.ConfigurationSource...
0
9621
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10106
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10046
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9915
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8939
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6717
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5484
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4014
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3611
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.