app-config

XmlMassUpdate - Replace Value Node

强颜欢笑 提交于 2020-01-03 15:34:44
问题 I'm trying to use XmlMassUpdate to update my config files based on build Version type. There seems to be no documentation on how to update the new app.config (vs2008) settings formats anywhere. This is the config section: <applicationSettings> <CTC.Mica.ClientService.Properties.Settings> <setting name="PipeName" serializeAs="String"> <value>\\.\pipe\micaPipe</value> </setting> <setting name="CTC_Mica_ClientService_MicaWebService_MicaWebService" serializeAs="String"> <value>URL</value> <

.Net app.config file ignored when under c:\ProgramFiles\

随声附和 提交于 2020-01-03 13:31:24
问题 I have a strange phenomen I have .Net 4.0 app. When the myapp.exe.config is under the normal programfiles folder it is ignored. Even if I delete it or write nonsense in it the myapp.exe works and it seems to me that values are taken from a previous installation. When I copy the folder to e.g. to Desktop it works correct. Edit: when I copy form c:programfiles\myapp\ to c:\programfiles\copy of myapp\ it works It seems to be only a problem in the progamfile folder where a previous installation

App.Config Ignored After Pre-Build Event

橙三吉。 提交于 2020-01-02 10:05:54
问题 I have a solution with several projects and several developers, each with their own environment (of course). To manage connection strings between each environment, I have created several app.config files for each environment: app.config.dev, app.config.qa, etc. The pre-build event simply copies the app.config.$(ConfigurationName) to app.config. This pre-build event is done for each project in the solution, and the connection string is included in each (including the test project). When I use

How to parse app.config using ConfigurationManager?

两盒软妹~` 提交于 2020-01-02 09:36:05
问题 I was using a certain method for parsing my app.config file. Then I was told that using ConfigurationManager is better and simpler. But the thing is I don't know how to do it with ConfigurationManager. My original code looked like this: XmlNode xmlProvidersNode; XmlNodeList xmlProvidersList; XmlNodeList xmlTaskFactoriesList; XmlDocument xmlDoc = new XmlDocument(); xmlDoc.Load("app.config"); xmlProvidersNode = xmlDoc.DocumentElement.SelectSingleNode("TaskProviders"); xmlProvidersList =

Validation of double using System.Configuration validator

纵饮孤独 提交于 2020-01-02 07:27:20
问题 I had to create a custom configuration section for my library. One of the parameters in the configuration should be positive double. However, for some reason I could not find any Validator for double. For instance, here's how I use the integer validator: [ConfigurationProperty("someProp", IsRequired = false, DefaultValue = 15)] [IntegerValidator(MaxValue = 200, MinValue = 0)] public int SomeProperty { get { return (int)this["someProp"]; } set { this["someProp"] = value; } } I've looked

C# ConfigurationManager retrieves wrong connection string from app.config

a 夏天 提交于 2020-01-02 07:06:16
问题 I have a simple WinForms app that will eventually be a game. Right now, I'm just working on the data access layer of it and I've run into a snag. I created a separate project called DataAccess and inside of that, I created a local .mdf SQL Server database file. I also created an app.config file to store the connections string. Here's that config file: <?xml version="1.0" encoding="utf-8" ?> <configuration> <connectionStrings> <add name="TBG_Master" connectionString="Data Source=(localdb)

Mono not reading values from my app.config?

让人想犯罪 __ 提交于 2020-01-02 04:08:10
问题 I have a standard app.config for a .NET 4.0 Console application created by Visual Studio 2010 when adding settings in the project Settings tab as described on MSDN here: Application Settiings. If I update a setting value in the resulting MyAsseblyName.exe.config file in the same directory then run the exe I see this in code by going: Properties.Settings.Default.MySetting; However, if I do the same (with the same build and same files) running Mono 3.2.8 on Ubuntu 14.04 using the above line

Entity Framework losing binding to connection string in Visual Studio

一世执手 提交于 2020-01-02 03:58:06
问题 I'm having a problem where the Entity Framework edmx file is apparently losing its relationship to the connection string that it was built with. The designer for my .edmx file was working perfectly - I could do "Update from database" and it would always jump to the wizard step that would allow me to add tables, procs, etc. Now when I click "Update from database", I get the "Choose your data connection" wizard step where it wants me to select a new database - if I go through these steps, it

How can a NuGet package include transformations for both app.config and web.config?

回眸只為那壹抹淺笑 提交于 2020-01-02 00:41:07
问题 I'm trying to create a nuget package which will both add a DLL and configure it inside of the proper configuration file. The package can be used in either a console/form application or a web application, so I want to update the appropriate configuration file, either app.config or web.config. My files section in the .nuspec file contains the following inside of the section. <file src="config.transform" target="content\app.config.transform"/> <file src="config.transform" target="content\web

Alternative to XML Serialization for Configuration

岁酱吖の 提交于 2020-01-01 11:45:29
问题 Currently, we use a giant configuration object that is serialized to/from XML. This has worked fine for the most part, but we are finding that in the case of power loss and application crashes, that the file could be left in a state that renders it unable to deserialize properly, effectively corrupting the configuration information. I would like to use the built-in app.config, but it doesn't seem to easily support custom classes. For example, with XML serialization, I can easily serialize a