app-config

How to deploy different App.config values (with WiX)

旧巷老猫 提交于 2019-12-12 13:36:19
问题 I've been looking for a best practice recommendation on how to deploy an application with a WiX installer for different values in its App.config file. For example. On my local development machine, I use App.config settings for our test environment: <configuration> <appSettings> <WorkingDirectory>C:\Working</WorkingDirectory> </appSettings> <connectionStrings> <add name="ApplicationEntities" connectionString="[TestingConnectionString]" providerName="System.Data.EntityClient" /> <

How to read an App.Config of a different application in C#

不打扰是莪最后的温柔 提交于 2019-12-12 12:22:58
问题 I have a console application written in C# which uses an app.config file. This application is intended to be run on a server using the task scheduler. Now I want to develop a UI that reads and writes from and to the app.config. (Note that this config is not intended to replace the config file of the UI application.) But I'm struggling to read the settings from the file. Using the ConfigurationManager I'm able to open the config file, BUT I cannot access the configuration settings. This is the

Is there a way to split app/web.config into 2 files?

一个人想着一个人 提交于 2019-12-12 11:37:03
问题 I currently use app/web.config to store Connection Strings for my database, which means on upgrade we do not touch the config files to preserve those strings. However we now want to move to MVC5 and doing so requires all the library definitions to be updated within the app/web.config (we have both an App and a website with similar configuration). So is it possible to split these files into two files so that I can update the library definitions whilst keeping intact my existing infrastructure

configuring file for DLLs

你。 提交于 2019-12-12 11:34:25
问题 We are having application which load our custom DLLs (these DLLs are implementing some interface) on runtime from the root of the application and execute a method through reflection. If custom DLL have to read some value from config files then we have to copy these config settings into app.config file of the main application. Is there any way where each custom DLL will have own configuring file named .config and read its configuration settings from this files itself. 回答1: If you're on .NET 2

Unit test not reading App.config

血红的双手。 提交于 2019-12-12 11:18:11
问题 On a build machine running Visual Studio Pro 2013 12.0.21005.1, I have a unit test project that fails to read its App.config file properly (if at all). The following returns null: System.Configuration.ConfigurationManager.GetSection( "loggingConfiguration" ) It isn't just the logging configuration section that fails to get read; any attempt to read any section results in a null value. On my laptop running Visual Studio Pro 2013 12.0.31101.00 Update 4, the unit test project reads the App

Including a generic class in Unity App.Config file

无人久伴 提交于 2019-12-12 09:35:14
问题 I have a class of type ISimpleCache<IBrokeredDataObject> that I want to add as a type alias (then a type) in the App.Config file the line <typeAlias alias="ISimpleCacheOfIBrokeredDataObject" type="MyApplication.ISimpleCache<IBrokeredDataObject>, MyApplication" /> is obviously wrong due to the <>, however I'm not convinced escaping them; <typeAlias alias="ISimpleCacheOfIBrokeredDataObject" type="MyApplication.ISimpleCache<IBrokeredDataObject>, MyApplication" /> is correct either. I am

Sections must only appear once per config file! why?

五迷三道 提交于 2019-12-12 08:09:36
问题 I'm getting the following exeption: "Sections must only appear once per config file. See the help topic for exceptions. " my configuration file look like this : <configSections> <sectionGroup name="point.System"> <section name="singleInstanceCache" type="xyz.Point.System.Configuration.SingleInstanceCache, Point.System" /> </sectionGroup> <sectionGroup name="point.Services"> <sectionGroup name="xServices" type="xyz.Point.Messaging.PointServiceConfiguration.PointServices, Barcap.FIA.Point

How do I access a NameValueCollection (like Request.Form or ConfigurationManager.AppSettings) as a dynamic object?

为君一笑 提交于 2019-12-12 06:09:27
问题 Is there a way to access a NameValueCollection (like Request.Form or ConfigurationManager.AppSettings) as a dynamic object? I'd like to be able to do something like this: var settings = ConfigurationManager.AppSettings.AsDynamic(); var name = settings.Name; // ConfigurationManger.AppSettings["Name"] // but also settings.Name = "Jones"; // modify the original collection // and var form = Request.Form.AsDynamic(); var email = form.Email; // Request.Form["Email"] (this question is based on

Error while loading assembly on separated AppDomain

走远了吗. 提交于 2019-12-12 06:05:34
问题 My application creates multiple AppDomains and I manually configure the binding redirects via the SetConfigurationBytes method. I grab the config file, check for all assemblies installed on the private folder and then set the assemblyRedirect as on the example below. This is to ensure that I'll always use the shipped version of a given assembly: <dependentAssembly> <assemblyIdentity name="System.Net.Http" culture="neutral" publicKeyToken="b03f5f7f11d50a3a" /> <bindingRedirect oldVersion="0.0

Error:Could not Load File or Assembly Entity Framework 4.4.0.0 on opening application?

佐手、 提交于 2019-12-12 04:51:15
问题 I have created a setup project and installed on local machine. The application opens but connection to Database doesnt occurs it throws error as following screen shot. I am using Entity Framework 4.0 but it asks for EntityFramework 4.4.0 don't know why? i have built this setup with framework 4.0 default with some devexpress & telerik tools in project. NOTE: Their is no reference to Entity 4.4 but still it asks for 4.4 any idea? but reference to 4.0 is their in config file. config markup: <