app-config

"Could not find endpoint element with name..."

Sorry for the long problem statement...I've spent two days debugging and have a lot of notes... I have a WCF data service and another process trying to connect to it as a client via TCP and/or HTTP. I have a VERY simple test client app that seems to connect fine, but the more complicated production app cannot connect (neither TCP or HT...

How to encrypt connection string in SubSonic 3.0

I use SubSonic v.3 for my data access and I want to know how can I encryption my connection string in App.config used by SubSonic. ...

WCF: programatically configuring the service with certificate

Here's the whole issue: I want to create WCF dll to access WCF services.... the only issue is, when I use the WCF DLL config file with an application that has it's OWN app.config file, the WCF DLL app.config file gets ignored....... I figure one way to fix this problem is to translate my app.config to code, but unfortunately I don't kn...

ConnectionStrings in app.config. What about security?

Is it really a Good Thing to put connection strings with passwords in the app.config file? It seems to me that the app.config is not encrypted in any way and the password information can be easily read. I have an app which accesses a database for which the intended end-user have no authentication. A group user/password is used. The ap...

Refresh/clear cache of app.config

I'm trying to get update values from app.config while it's running. I tried several methods but it still uses old values. How can I get correctly refresh it? I tried these but it didn't work: MessageBox.Show(Properties.Settings.Default.MyValue); Properties.Settings.Default.Reload(); Properties.Settings.Default.Upgrade(); Properties.Sett...

App.config <bindingRedirect/> for assembly with Strong Name and then use Short Name in C#

I think Title is not very suggestive in what I meant to ask, so theres is an example. I have this method that receives a name of System.Windows.Forms Control and then returns the type. (I need to use Version=2.0.0.0 of System.Windows.Forms) return Type.GetType("System.Windows.Forms." + name + ", System.Windows.Forms,Culture=neutral, Ve...

Add settings from another project to app.config

I have written an application in C# with a settings file (which is used to create an app.config file at compile time). This application uses a C# DLL which also has a settings file. I read the following from this post: If you build a project that references your DLL, you would add the same .settings file to that project and those s...

Deploy multiple configs or put everything in a single web config?

Our solution file contains many different projects including an ASP.NET MVC web app, a windows service, and several desktop applications. One project handles logging and has an app.config file containing a list of recipients to inform when something fatal has been logged. Concerning the deployment of our webapp, I was wondering if it...

Can an NUnit project load a separate *.config for each assembly that it loads?

If so, how? If not, what is the best workaround? Particularly, I'm trying to automate running unit tests in the GUI test runner on arbitrary developers' machines. ...

How to add custom sections inside custom section groups in app.config file at runtime ?

I want to dynamically add a custom section inside a custom sectiong group of the App.config for my .net application. I basically have 3 different environments which use the these custom sections and need to decide which one to have in my app.config file. I am currently able to edit the config file and add the custom sections and custom g...

Is it possible?

Hi We are thinking of moving some of the 'hard coded' settings out of our windows forms application and storing them in the sql database in a table called App_Settings. The reason for this is we have values currently hard coded into appsettings and app.config which can change over time, and it is much easier and faster to update the val...

Is there a way to not use the traditional .config files for ASP.NET?

I find Web.config xml pretty verbose. Do you know any initiative made in the way to enable cleaner config files, using YAML, or .rb files, anything that could suck less? EDIT: I already know that FubuMVC web framework, built on top of ASP.NET, tries to reduce a lot the amount of XML you need to put in that file in order to work properl...

Problem loading assembly via Reflection and accessing configuration

I'm trying to load a .NET assembly with Reflection (using the Assembly.LoadFrom method), and instantiate some types within this assembly. This all seems to work fine, but one type I'm trying to instantiate accesses the assembly's configuration within its type initializer: it does ConfigurationManager.GetSection(sectionName). The assemb...

CSharp self-hosted WCF App.config move to Program Data

I have a self hosted WCF service (using a Windows Service). The installer currently places all the exes into "program files". I am deploying the app.config file for the windows service because it contains the service endpoint information. how can I move that file (app.config) to "program data" (%appdata%) directory and have the exe sti...

A question about writing data to a custom section?

Hi guys, below is my class thanks to the article found at: URL: Derik Whittaker My Code: public class FavsSection : ConfigurationSection { public override bool IsReadOnly() { return base.IsReadOnly(); } public FavsSection() // default Constructor. { } [ConfigurationPro...

Windows Service cannot access Castle Windsor config data in app.config

Hi all I use Castle Windsor in a couple of web apps just fine by putting the config data in web.config. So when I decided to use it in a Windows Service I thought it would be a cinch. My app.config file looks like the following: <?xml version="1.0" encoding="utf-8" ?> <configuration> <configSections> <section name="castle" type=...

what is the name of the app.config of a winforms app? and how can i know that the app loaded that app.config ?

well i basically cant add an app.config file to my win forms project. and i dont know if the application actually uses it or no. i used "Add" > "New Item" > "Application Configuration File" but well i dont know if the app reads the data from the file or no. so how can i know that the app actually reads that file? thanks ...

How to tell C# which config file to use?

Possible Duplicate: Reading dll.config (not app.config!) from a plugin module. I have two different projects, say A and B. I need to use some classes of A in B. So I added a reference to A in B. When I tried to run the application, I stated getting Object reference set to null exception. On investigation, I found that when I a...

app.config assemblies

I have the following in my app.config. <configuration> <configSections> <sectionGroup name="FooGroup"> <section name="Foo" type="Bar.FooSection" allowLocation="true" allowDefinition="Everywhere" /> </sectionGroup> </config...

What's the best way to get data from the app.config?

For a long time I used: ConfigurationManager.ConnectionStrings["sqlconnectionstring"].ConnectionString to get the connection string from the app.config file <configuration> <connectionStrings> <add name="sqlconnectionstring" connectionString="Data Source=ggg;Initial Catalog =DB;User ID=sa;Password=sa" /> </connectionStr...