app-config

Nuget Config.Transform Formatting Issue

Deadly 提交于 2019-12-05 17:56:27
I have created a Nuget config transform file that has the following transformation: <?xml version="1.0"> <configuration> <system.serviceModel> <bindings> <netTcpBinding> <binding name="NetTcpBinding_IMyService" /> </netTcpBinding> </bindings> <client> <endpoint address="net.tcp://mydomain/MySvc/MySvc.svc" binding="netTcpBinding" bindingConfiguration="NetTcpBinding_IMyService" contract="MyNamespace.MyService" name="NetTcpBinding_IMyService"> <identity> <userPrincipalName value="admin@mydomain.com" /> </identity> </endpoint> </client> </system.serviceModel> </configuration> The problem occurs

ConfigurationElementCollection with a number of ConfigurationElements of different type

断了今生、忘了曾经 提交于 2019-12-05 17:10:00
问题 Is it possible to have a CollectionElementCollection with a number of different by type CollectionElements, e.g.: <collection> <add type="MyType1, MyLib" Type1SpecificProp="1" /> <add type="MyType2, MyLib" Type2SpecificProp="2" /> </collection I have all classes required for such solution: class MyCollection : ConfigurationElementCollection { } class MyElement : ConfigurationElement { } class MyType1 : MyElement { } class MyType2 : MyElement { } ... etc but when I start my application I'm

Plugin to use its own app.config

╄→гoц情女王★ 提交于 2019-12-05 15:03:59
问题 I finally managed to build a working solution of a plugin architecture with help of some guys over here, but now a new problem arises. My hosting application uses it's app.config file for some defaults for the executing assembly (which is a Windows Service). Each plugin should be able to load it's own settings from a separate plugin settings file because the host shouldn't be made aware of the plugin settings. In the plugin project I added an app.config file as well (with some settings and a

nUnit tests looking for {assembly-name}.dll.config

一曲冷凌霜 提交于 2019-12-05 13:09:12
I have a PowerShell script that shells-out to nunit-console-x86.exe to run tests in assemblies ( DLLs ) that were built earlier in the script by shelling to MSBuild to compile a VS .sln Exec { invoke-expression "$BUILD_DIR\Tools\NUnit.2.5.10.11092\nunit-console-x86.exe $full_test_assembly_name /xml:test-results/$test_results_file_name" } Some of these tests utilize System.Configuration.ConfigurationManager to load config settings. nunit-console-x86.exe searches for these config-settings in {$full_test_assembly_name}.dll.config , but this file does not exist as my script does not create it (for

Mono not reading values from my app.config?

一个人想着一个人 提交于 2019-12-05 11:43:18
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 gives me the default value specified on project Settings tab instead of the updated value in the

Azure role configuration management

五迷三道 提交于 2019-12-05 10:24:42
I don't see how Windows Azure lets you vary the configuration of an application when you have no choice but to hold configuration settings in web.config (or app.config). For example... Quite often projects will make use of a 3rd party library that makes heavy use of web.config. The use of web.config may involve connection strings, app settings or custom configuration sections. A good example of this is ELMAH. A web.config file for ELMAH might look like the following: <configuration> <configSections> <sectionGroup name="elmah"> <section name="security" requirePermission="false" type="Elmah

WCF: Updating Service Reference gives duplicate config entries

不想你离开。 提交于 2019-12-05 09:55:58
I have a WPF application using service references to a WCF service. When doing updates on the service I need to update the service reference, so I right click it and hit "Update Service Reference". Doing this results in duplicate entries in the App.config file of the client project. It duplicates a binding under wsHttpBinding - adding an equal entry with postfix number in name: WSHttpBinding_ISomeService --> WSHttpBinding_ISomeService1 . And it duplicates the endpoint definition under binding such that there is one endpoint for each wsHttpBinding . This too is a pure duplicate except of the

How do I store an XML value in my .NET App.Config file

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-05 07:54:31
I am trying to store an xml value in my app.config file. The app.config does not like this and I cannot use the <![CDATA[ construct to ignore the XML'ness of my value. Is there a way to do it? Value example: <FieldRef Name='LinkfileName' Nullable='True'/><FieldRef Name='Web' Nullable='True'/> You can save an XML document as text in an attribute value if you escape the character entities: <FieldRef Name="Linkfilename" ... You can then use XmlDocument.Load() to parse the text value. Note that this won't work for your example because your value is an XML document fragment and not a well-formed

Web.config-style transforms for App.config files for C# Console apps?

烂漫一生 提交于 2019-12-05 07:52:38
My team is in love with publish profiles. We have a number of testing environments that we work in, and using Web.config transforms we're able to substitute the names of machines in each environment, configuration settings, etc, which makes our build/deploy/test process much easier. For example: Web.config Web.dev.config Web.int.config Web.prod.config However, we have a number of test applications that we use to hit our web services, implemented as Console applications. We'd like to be able to do the same type of transforms on these config files, so that we can reduce manual labor of testing

Combined Azure web role and worker role project not seeing app.config when deployed

元气小坏坏 提交于 2019-12-05 06:24:13
I'm implementing the combined web/worker role scenario as described here where you simply add the following to your worker role: public override void Run() { // This is a sample worker implementation. Replace with your logic. Trace.WriteLine("WorkerRole1 entry point called", "Information"); while (true) { Thread.Sleep(10000); Trace.WriteLine("Working", "Information"); } } The problem, as noted in the post's comments, is that this worker process cant read web.config so you have to add an app.config. It is also noted that app.config does not get deployed automatically. So my question is how do I