configuration-files

Programmatically encrypting a config-file in .NET

你离开我真会死。 提交于 2019-11-26 17:27:55
问题 Could somebody please do a rundown of how to programmatically encrypt a config-file in .NET, preferably in C#. What I would like to do is do some kind of check on an application's startup to see if a section is unprotected, and if it is, then encrypt it. This for both settings and connection-strings. Also if anyone could list the types of encryption-providers and what is the difference between them. I don't know if the code for doing this in a normal WinForms-application is transparent to

WCF Error - The maximum message size quota for incoming messages (65536) has been exceeded [duplicate]

我的梦境 提交于 2019-11-26 16:24:26
问题 This question already has an answer here: The maximum message size quota for incoming messages (65536) has been exceeded 2 answers My Setup: ASP.NET client hosted in IIS Express WCF Service hosted in Console Application Running Visual Studio.NET 2012 in Admin mode I am trying to return 2 List objects from a WCF service. My setup WORKS FINE when I return just 1 List objects. But when I return 2 List objects I get the error: The maximum message size quota for incoming messages (65536) has been

How to load a separate Application Settings file dynamically and merge with current settings?

爷,独闯天下 提交于 2019-11-26 16:18:42
问题 There are questions pertaining to reading settings from a separate config file and others similar to it, but my question is specific to application property settings (i.e. <MyApplication.Properties.Settings> - see XML file below) and how to load them dynamically. I tried the method in this post, which involved refreshing the entire appSettings section of the main config file, but my adaptation threw exceptions because I wasn't replacing the appSettings section: var config =

Read custom configuration file in C# (Framework 4.0)

落爺英雄遲暮 提交于 2019-11-26 15:53:14
问题 I am developing an application in C# under Framework 4.0. In my application I would like to create separate configuration file that is not the app.config file. The configuration file contains custom configuration sections we developed for the product. I don't want to reference this file from the app.config using the configSource. I want to load it at runtime and read it's content. An example to what I mean is the log4net that allow you to write the configuration in the log4net.config file.

Correct implementation of a custom config section with nested collections?

家住魔仙堡 提交于 2019-11-26 15:24:14
问题 In a web application, I want to be able to define some mapping using a config section like this: <configuration> <configSections> <sectionGroup name="MyCustomer"> <section name="CatalogMappings" type="MyCustom.MyConfigSection" /> </sectionGroup> </configSections> <MyCustomer> <catalogMappings> <catalog name="toto"> <mapping value="1" displayText="titi" /> <mapping value="2" displayText="tata" /> </catalog> <catalog name="toto2"> <mapping value="1" displayText="titi2" /> <mapping value="2"

What&#39;s in an Eclipse .classpath/.project file?

社会主义新天地 提交于 2019-11-26 14:53:58
We recently had an issue with an Eclipse project for one of our team members. Tomcat was not deploying JARs of the application. We eventually noticed the .classpath Eclipse file was not the same as for the team members where the project was OK. We replaced the .classpath file with one from a project that was OK and the Tomcat deploy was complete. Just out of curiosity and to know at what to look in the future if something is wrong, what is inside the .classpath and .project files. What can I add in there, what does it all mean? Eclipse is a runtime environment for plugins. Virtually everything

Changing App.config at Runtime

孤街醉人 提交于 2019-11-26 14:09:31
问题 I'm writing a test WinForms / C# / .NET 3.5 application for the system we're developing and we fell in the need to switch between .config files at runtime, but this is turning out to be a nightmare. Here's the scene: the WinForms application is aimed at testing a WebApp, divided into 5 subsystems. The test process works with messages being sent between the subsystems, and for this process to be successful each subsystem got to have its own .config file. For my Test Application I wrote 5

Which design patterns can be applied to the configuration settings problem?

六月ゝ 毕业季﹏ 提交于 2019-11-26 11:51:19
问题 In large and complex software products managing configurable settings becomes a major pain. Two approaches I\'ve seen to the problem are: have each component in the system load its own configuration from config files or registry settings. have a settings loader class that loads all the configurable system settings and have each component query the settings loader for its settings. These approaches both feel wrong to me. Are there any design patterns that could be used to simplify the problem?

How to implement a ConfigurationSection with a ConfigurationElementCollection

假如想象 提交于 2019-11-26 11:00:58
I am trying to implement a custom configuration section in a project and I keep running up against exceptions that I do not understand. I am hoping someone can fill in the blanks here. I have App.config that looks like this: <?xml version="1.0" encoding="utf-8" ?> <configuration> <configSections> <section name="ServicesSection" type="RT.Core.Config.ServicesConfigurationSectionHandler, RT.Core"/> </configSections> <ServicesSection type="RT.Core.Config.ServicesSection, RT.Core"> <Services> <AddService Port="6996" ReportType="File" /> <AddService Port="7001" ReportType="Other" /> </Services> <

SSIS how to set connection string dynamically from a config file

爱⌒轻易说出口 提交于 2019-11-26 10:56:15
问题 I am using SQL Server Integration Services (SSIS) in SQL Server Business Intelligent Development Studio. I need to do a task that is as follows. I have to read from a source database and put it into a destination flat file. But at the same time the source database should be configurable. That means in the OLEDB Connection Manager, the connection string should change dynamically. This connection string should be taken from a configuration/XML/flat file. I read that I can use variables and