app-config

Referencing App.config file through a .NET class library DLL in ColdFusion 9

我们两清 提交于 2019-12-11 10:24:03
问题 I'm currently developing DLLs in .NET that use Entity Framework to access our database. It is my understanding that DLLs do not have ties with the same App.config files as exe applications do. Through a good amount of research, I have learned that DLLs do not contain App.config and are best left agnostic(config) so the program using the DLL can determine the config. I'm receiving this error and am sure that the connection string is defined in my app.config: System.InvalidOperationException:

Get setting from C# App.config file

白昼怎懂夜的黑 提交于 2019-12-11 08:22:04
问题 I have an app.config file. It's from a sample given to me for an API I have to use... I want to get a setting from the file so that I can use the settings from there and not have to duplicate efforts. How can I get the words "FindMe", "LocalMachine" and "My" in this app.config file (to drive pulling a certificate from the given information)? <?xml version="1.0" encoding="utf-8"?> <configuration> <startup>...</startup> <system.serviceModel> <bindings>...</bindings> <client>...</client>

Change app.config at runtime

旧巷老猫 提交于 2019-12-11 07:58:20
问题 I'm currently trying to create the app.config at runtime. The basic idea is that I'm deploying several config files and based on an environment variable the application itself decides which one to use. Currently I'm copying the config file I'd like to use to myapp.exe.config, and refresh all the sections. The problem I'm facing is, that log4net seems to mess up things, but only in release build (as the static fields are initilized at a different time). I explicitly DON'T want to decide at

Reporting Services - Using a web service via a custom assembly: Finding the endpoint

蓝咒 提交于 2019-12-11 07:54:15
问题 I'm having a problem when using a Custom Assembly in my reports. We are using a Microsoft SQL Server 2012 Express Edition with Reporting Services and are designing our reports in Microsoft Visual Studio 2010 Scenario: In Reporting Services we want to base the language of a report based on a parameter. All the strings are translated with the help of a web service that has a simple "Translate" method. Because we cannot reference to a web service in the report, we used a custom assembly that

How to change application config file name (AppName.exe.config)?

倖福魔咒の 提交于 2019-12-11 07:36:01
问题 I use My.Settings object in VB.NET, which automatically gets application setting from AppName.exe.config file. How can I store config in file with other name, not AppName.exe.config? I have several programs, all of them now uses their own .config file, but in fact they all are clones, and if I change some setting I need to edit several configs. 回答1: This will work with <appSettings> , not sure if it works with the Settings Design time Put the app.config file in the solution folder so one

specifying “To” address in SMTP mail settings in .NET

孤街醉人 提交于 2019-12-11 07:06:24
问题 Is it possible to set "To" address in SMTP mail settings just like "From" address? there is an attribute for "From", but not "To" address. basically I need to send an email to technical support whenever a specific exception (or any unhandled exception) happens in the application. I can add it to "appSettings", but wondering if I can specify it in SMTP settings itself, without having to read from "appSettings". thanks in advance <system.net> <mailSettings> <smtp deliveryMethod="network" from=

Change app.config programmatically at the runtime

依然范特西╮ 提交于 2019-12-11 05:47:03
问题 I want to change TNS_ADMIN property in appconfig dynamically at the runtime. Here is the app.config; <?xml version="1.0" encoding="utf-8"?> <configuration> <configSections> <section name="oracle.manageddataaccess.client" type="OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess, Version=4.122.18.3, Culture=neutral, PublicKeyToken=89b483f429c47342"/> </configSections> <startup> <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/> </startup> <system.data>

Write to custom section in app.config .Net

◇◆丶佛笑我妖孽 提交于 2019-12-11 05:41:59
问题 I am using .Net 4.0 on a WPF application with MVVM I have added a custom section MyAppCustom.ReportServer.Settings to the section group userSettings as below: <sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b87a6a562548e011" > <section name="MyApp.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b87a6a562548e011"

.Net Standard 2.0 ConfigurationManager Doesn't Read Connection Strings

笑着哭i 提交于 2019-12-11 05:06:55
问题 I have a .Net Standard 2.0 Library. I've references System.Configuration.ConfigurationManager via NuGet and I've added an App.config file with two connection strings. When I break on the following line, I notice that ConnectionStrings only contains a single connection string which is neither of the connection strings I have in my App.Config (shown below). var foo = ConfigurationManager.ConnectionStrings["cs1"].ConnectionString; The single connection string which does appear in

WCF service: app.config versus attributes or a mixture of both

江枫思渺然 提交于 2019-12-11 05:06:02
问题 In a WCF application we have a servicecontract with attributes: namespace We.Work { [ServiceContract(Namespace = "We", Name = "IWork", SessionMode = SessionMode.NotAllowed)] public interface IWork an implementation of the servicecontract with attributes: namespace We.Work { [ServiceBehavior(Name = "Work", Namespace = "We", IncludeExceptionDetailInFaults = true, InstanceContextMode = InstanceContextMode.PerCall, ConcurrencyMode = ConcurrencyMode.Multiple,