app-config

SubSonic connection string for SQLite

I'm writing a desktop app which needs a simple persistence layer - I found out about SubSonic and it's capability to work with SQLite. However I need to keep the database file in user's AppData folder and don't know how to put such value into app.config - I don't want to use absolute paths. Can app.config somehow access enviroment varia...

Remote Codebase

I have a dll. That dll is uploaded on a server. I want that each time the application starts to get the "latest" dll from the server, so I've used the following code in my app.config. Why isn't it working? here is the app.config file: <configuration> <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> <depe...

Is there a standard way to deploy an application with SQL Server express?

In Winforms or WPF Is there a standard way to deploy an application with SQL Server express? Is there a standard way to create a local SQL Server express database and also update the app.config connectionStrings settings during an application install? ...

Clearing the log associated with a tracelistener after each run ?

I'm using TextWriterTraceListener for logging, which is being configured into the app using app.config as shown below. <?xml version="1.0" encoding="utf-8" ?> <configuration> <system.diagnostics> <trace autoflush="true" indentsize="100" > <listeners> <add name="myListener" type="System.Diagnostics.TextWriterTraceLi...

Clickonce and app.config

Hi, I am installing a WPF Application using the ClickOnce deployment. There are certain settings in the app.config that need to be changed after the Application is installed. Although the app.config exists in the deployment folder as assemblyname.exe.config.deploy , after installing the application I can't seem to find it on the client m...

A question about WCF when using app.config

I am a beginner of WCF,I write a simple example of it,and the app.config files of my application as follows: Host: <services> <service name="WCFService.Service.CalculatorService" behaviorConfiguration="calculatorBehavior"> <host> <baseAddresses> <add baseAddress="http://10.1.9.210:8080/GeneralCalculator"/&gt;...

Powershell Calling .NET Assembly that uses App.config

Hi, I have a Powershell script that is loading a .NET assembly (.EXE in my case) and calling a public method that uses the app.config to pull an encrypted connection string. The script dynamically copies the assembly's exe.config over to the Powershell ($pshome) folder as powershell.exe.config and is able to run from my development box...

C# Plugin to use its own app.config

Hi all, I finally managed to build a working solution of a plugin architecture with help of some guys over here, but now a new problem arises. My hosting application uses it's app.config file for some defaults for the executing assembly (which is a Windows Service). Each plugin should be able to load it's own settings from a separate ...

SubSonic and app.config in Windows Form

As it should be the file app.config in an application Windows Form so that the given access classes her they generate automatically in the build? ...

anonymous functions in unity via config file

I've been using unity with interfaces, but sometimes created an interface only to use a single method in a single class; and used unity as my IoC framework. But then I saw this post: http://codebetter.com/blogs/karlseguin/archive/2009/05/08/making-the-untestable-testable-with-anonymous-methods-and-dependency-injection.aspx which made m...

How do I read/write App.config settings with PowerShell?

I'd like to use PowerShell as part of our automated build process to update an App.config file while deploying into our test environment. How can I do this? ...

app.config

Hello, for an easiness of my application I would need to have "runtime" element of app.config in separate file. Tried something like <runtime file="runtime.conf" /> and also <runtime configFile="runtime.conf" /> and in runtime.conf I have: <runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> ..........

How to get configuration element

Helo Can anybody explain me how to get configuration element from .config file. I know how to handle attributes but not elements. As example, I want to parse following: <MySection enabled="true"> <header><![CDATA[ <div> .... </div> ]]></header> <title> .... </title> </MySection> My c# code looks like this so far: public cla...

Is there any way to add sections to .config files that will not be parsed by ConfigurationManager.

Hello I don't want to create separate configuration file for my app but store the data in the web.config. I just want to put some XML there and manually parse it because current implementation of ConfigurationManager isn't appropriate for my case. However, without dummy classes and properties I can't add my XML there without getting ...

.Net Encryption

Similar questions have been asked here, but their answers are not enough to me. What I would like to know is the definite approach to encrypting connection strings in a config file. Here are my questions: Using machine-level encryption, can't anybody accessing my server write a little .Net program to read the contents of the connectio...

Detect win or web forms

Any reliable elegant way of detecting whether the current app is a win or web forms (or other) application? We have a common config class which needs to open either app.config or web.config. Currently, I'm catching ArgumentException when I try OpenExeConfiguration but it's not very elegant and might mask other issues. ...

dynamic Userconifg question

I'm working on a program that will sort files based on extension I currently use a internal dictionary to store the extension/location .jpg / c:\blab blab\my documents\my pictures .mp3 / c:\blab blab\my documents\my music .gno / c:\familytree etc I would like to make this program less specific to me and allow users to configure wh...

Can't get nhibernate config section out though configuration manager.

I'm trying to to setup Memcached 2nd level caching. I've followed what documentation I could find, including downloading the project from SVN and looking at how it is configured in their test project, and ended up with this in my app.config. <configuration> <configSections> <section name="memcache" type="NHibernate.Caches.MemCache...

ConfigurationManager.RefreshSection not refreshing as expected

I have implemented a custom section in my app.config file and am accessing it using ConfigurationSection and ConfigurationElement. When the application starts all data is retrieved correctly. If I manually change the values in the app.config file then my application later calls ConfigurationManager.RefreshSection I still receive the or...

app.configs and MSTest Project - null reference for a connection string

When I try to run Unit Tests (mstest) I run into this issue. The line of code: _mainCnStr = System.Configuration.ConfigurationManager. ConnectionStrings["main"].ConnectionString; Comes back as a null reference It doesn't do this in the main UI project when I run it. What is the right method to get this connection str...