app-config

WCF service not working after program update

I have recently added a WCF service reference to my program. When I perform a clean install of this program, everything seems to work as expected. But, when I install the program on a client which already has a previous version (without the new service reference) installed, I get a exception telling me the default endpoint for this parti...

Where i put the Connectionstring with numerous client?

Hi everybody, i will develop utility program for a company with more than 1000 client and the program must be win application with .Net because my program will act with another program. What is your suggest for place of app.config? one scenario: We put the app.config on the server that configured once and write a windows service for it t...

Problems with Web.config and App.config

Intro: Normally we store ConnectionStrings and some other settings (<appSettings> <add key...) in the Web.config or App.config. My scenery: Web application using factory pattern with direct injection to read data providers. In the web.config I have the key that tells me which DLL (provider) will I use to retrieve my data. I can h...

Assembly specific settings not loading at runtime

Hello, I am developing a .NET 3.5 Windows Forms app. I have two projects, the UI and a Library. UI uses strongly typed settings that are stored, as usually, in the app.config file. I read them using UI.Properties.Settings class (generated by Visual Studio). Library uses its own strongly typed Settings (the Settings.settings file that ...

.NET version downgrade generates app.config. Do I need it?

Recently had to downgrade a project from .NET 3.5 to .NET 2.0 because it turns out that the target boxes will not have .NET 3.5 on them. When I did so (in VS2008), it created an app.config file in each project with this snippet of XML: <startup><supportedRuntime version="v2.0.50727"/></startup> Is this necessary? Do I need to ship t...

How do you instruct NUnit to load an assembly's dll.config file from a specific directory?

If an assembly contains an app.config file, ConfigurationManager will load it as long as it is in the same directory as the NUnit project that is executing through NUnit-Gui. To illustrate consider the following folder structure. + TestFolder testProject.nunit + AssemblyAFolder assemblyA.dll assemblyA.dll.config + A...

Differences between App.Config and Web.Config?

when building a desktop app in wpf can you read documentation of problems and safely subsititute 'app.config' when people's answer's refer to 'web.config'? if so are there any glaring GOTCHAS you have to look out for? tnx ...

Duplicate keys in App.Config does not throw exception

I discovered this by chance when I have a duplicate key/value pairs in my app.config file for a .NET 2.0 console app. To my surprise, it works and the app reads the latest pair. I was pulling my hair when trying to figure out why I could not fetch the correct value of a key (cause I did not realise a similar key with an old value was low...

Securing passwords in config problem.

My .NET WinForms application connects to ftp server and downloads a file. To do that a password for the connection is required. The password should be stored in a configuration file, but it should be encrypted. The only solutions to do that that I've found include either securing whole config section (which is no use for me as in the app...

app.config for unit test assembly: how to make the appsettings 'file' attribute work?

I need to read a setting from the appsettings section (defined in app.config) in a unit test. We're using mstest in this project. Say this is the app.config: <configuration> <appSettings> <add key="MyAppSetting" value="MyAppSettingValue"/> </appSettings> </configuration> Here's the corresponding test, which passes in this setup:...

Why does it matter which order settings are in app.config

I had a problem with WCF test, and the problem was solved when I moved to the top of system.servicemodel. My question is, why does this matter? Doesn't .NET read the XML by the field names? <system.serviceModel> <behaviors> <serviceBehaviors> <behavior name="MyServiceTypeBehaviors"> <serviceMetadata httpGetEnabled="true" ...

Is it possible to install an assembly into the GAC as some sort of 'linked assembly'?

Hello, I'm trying to deploy some sort of framework and therefore need to register some assemblies in the GAC. The interesting part is: These GAC assemblies should only be used by the framework developer, the client apps should not use these GAC assemblies but the ones in their local directories (the GAC assemblies could be of a differe...

Does web.config override any app.configs?

If I have a web application (with its own web.config) and a .dll it uses happens to have its own app.config which settings file wins when there is a conflict? ...

.NET C# executable is not reading config dynamically

In my app.config i got something like: <appSettings configSource="AppSettings.config"/> I would have expected the application to read the settings dynamically from AppSettings.config but i doesn't... Am i wrong here? ...

Storing of settings without database

I need to store a list of columns/datatype pairs as app settings. The amount of column/datatype pairs will be around 50 - 100, but could be more. I cannot store these in a table due to client requirements. There will be UI for the user to add/edit/delete from the list. I was initially thinking of a delimited string stored in app.config....

C# log4net: getting the logfile name through code?

How can I get the log file name in code? (So I can print it to the console) My log file is define like this in app.config: <appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender"> <file value="logfile" /> ... ...

How can I change what App.config gets renamed to?

I have an App.config file in my project that gets copied to NameOfExe.exe.config at build time. The users of my software will need to edit this file at times, but they may not be familiar with how .NET does things (or how computers do things in general). I think using a file name like that might confuse them, with the .exe.config extensi...

web.config and app.config confusion

I have a DLL that references a web service. The block it has put into the app.config is (I have changed the names but you'll get the idea): <applicationSettings> <DLLName.My.MySettings> <setting name="DLLName_WebReferenceName_ASMXName" serializeAs="String"> <value>http://URL/Filename.asmx&lt;/value&g...

Temporary Import of Configuration Settings at Runtime?

I'm writing a plugin user control for an in-house screen management system. My BO layer is built on CSLA, and I'm using CSLA'a ObjectFactory to invoke my data layer. A further bit of complexity is that I'm using the CslaObjectFactoryLoader app setting to have two sets of factory loaders: one for my test data layer and another for my li...

Configuration.Save() in .Net 3.5 does not work in Deploy/Release mode

Hi, As suggested on msdn social forum, http://social.msdn.microsoft.com/Forums/en-US/netfxbcl/thread/ab59671a-f0a3-4182-ba5b-7fa17f0a6118?prof=required I turned off the the Visual Studio hosting process and verified that the changes are saved to MyApp.exe.config file instead of MyApp.vhost.exe.config file when still running under Debug...