app-config

Custom Config Section Property is not a configuration element

孤街醉人 提交于 2019-12-10 17:29:20
问题 I need another set of eyes on this problem. I am getting a ConfigurationErrorsException was unhandled "Property 'exportClientSettings' is not a ConfigurationElement." The exception is thrown when I call ExportClientConfiguration.GetSection(); Here is my code: App.config <configSections> <section name="exportClientConfiguration" type="ClientConversionUtilityBroker.ConfigurationModels.ExportClientPathConfiguration.ExportClientConfiguration, ClientConversionUtilityBroker"/> </configSections>

.NET assembly binding, can I map an assembly to a version in another assembly?

纵然是瞬间 提交于 2019-12-10 17:12:46
问题 Good Morning, Is it possible to map assembly requests to the version within another assembly? For instance our product uses NHibernate 3.2. We are moving to NServiceBus 3.2.2. For DBSubscription storage it uses NHibernate and it's baked in version of NHibernate which is 3.3 in NServiceBus.NHibernate. How can I map requests for NHibernate 3.2.0.2002 to NServiceBus.NHibernate which is 3.3... <assemblyIdentity name="NHibernate" publicKeyToken="aa95f207798dfdb4" culture="neutral" />

Changes in App.config do not reflect after restarting the application

家住魔仙堡 提交于 2019-12-10 15:58:49
问题 I am using an app.config file to store the dynamic parameters of my application. The problem is, when I change a value in app.config file, and start the application, it doesn't load the new value from config file. Seems like the values in app.config file are being read and embedded in exe file only at compile time! This is how I read the config file: public class Helper { static Helper() { Foo = ConfigurationManager.AppSettings["Foo"]; } public static string Foo { get; set; } } Am I missing

How to read basicHttpBinding defined in app.config file

瘦欲@ 提交于 2019-12-10 15:28:35
问题 I'm trying to figure out how to read how to read basicHttpBinding section defined in app.config file. I attempted to do it like I did the endpoint address but it does not work. Here is how I did my endpoint address: private EndpointAddress EndPointAddy { get { var config = ConfigurationManager.GetSection("system.serviceModel/Client") as ServiceModelSectionGroup; foreach (ChannelEndpointElement endpoint in config.Client.Endpoints) { Uri address = endpoint.Address; if (address != null) { return

How to read configSections

假如想象 提交于 2019-12-10 15:25:04
问题 I've set up some custom config sections in my App.Config, such that I now have a configSection that looks like this. <configSections> <section name="Section1" type="ConfigSections.MySection, MyNamespace"/> <section name="Section2" type="ConfigSections.MySection, MyNamespace"/> <section name="Section3" type="ConfigSections.MySection, MyNamespace"/> </configSections> What I want to do is to read this section in code in order to find out at runtime what sections I have. I have tried: var

How to read multiple values in C# app.config file?

依然范特西╮ 提交于 2019-12-10 15:05:07
问题 I want to read the following app.config file.. How to read it? Do I need to change anything in order to read the file ?? <?xml version="1.0" encoding="utf-8" ?> <configuration> <Users> <add username = "Dinesh" password ="Password" domain ="MyCompany" /> <add username = "Kumar" password ="Password" domain ="MyCompany" /> </Users> </configuration> 回答1: I think you should implement a section. I made some sample code that might be exactly what you want: using System.Collections.Generic; using

How do I redirect assembly binding to the current version or higher?

此生再无相见时 提交于 2019-12-10 14:58:38
问题 Even though my references have Specific Version set to false , I'm getting assembly binding errors because the target machine has a higher version. How do I specify the current version or higher to avoid the following error when some target machines might have version 1.61.0.0 while others have 1.62.0.0 or higher? System.IO.FileLoadException: Could not load file or assembly 'ServerInterface.NET, Version=1.61.0.0, Culture=neutral, PublicKeyToken=151ae431f239ddf0' or one of its dependencies.

App.Config Custom configuration section problem

纵饮孤独 提交于 2019-12-10 14:56:37
问题 I've created a custom config section for my application. For some reason Visual Studio 2010 isn't picking up and of my custom properties. I'm getting warnings similar to this for all the "add" keys: Could not find schema information for the element 'urlFilterSection' CONFIG FILE: <configSections> <section name="urlFilterSection" type="BotFinderApp.Models.UrlFilterSection, BotFinder" /> </configSections> <urlFilterSection> <urlFilterCollection> <add url="urlhere.com.au" numberOfIpsToExtract=

How to override settings.settings variable by app.config variable

非 Y 不嫁゛ 提交于 2019-12-10 14:45:58
问题 How can I change (or override) a settings.settings variable by adding a variable to the app.config on production? Is this possible anyway? 回答1: You have to directly reference the applicationSettings you're trying to override and explicitly specify the property that has a replaced value. <configuration> <!-- section definitions for all elements in <configuration> tag --> <configSections> <!-- section group, meaning: there will be a <applicationSettings> tag in you configuration-->

Where does the Nuget Get-Project -All | Add-BindingRedirect get its version numbers?

心已入冬 提交于 2019-12-10 13:35:16
问题 I'm trying to synchronize all of the DLL versions in my solution with many projects. I noted that my app.config contains several assembly binding redirects like so: <dependentAssembly> <assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-4.0.2.1" newVersion="4.0.2.1" /> </dependentAssembly> However, as best I can tell via the NuGet package manager, there are no packages that need consolidation