app-config

Enabling log levels in log4net

旧街凉风 提交于 2019-12-06 19:29:54
问题 I'm writing a simple test project to experiment with log4net and I've hit a wall right off the bat. No matter what I do in my config file, the my logger is initialized with all "IsXXXXEnabled" flags set to false. Here is my very simple app.config: <log4netgroup> <log4net xsi:noNamespaceSchemaLocation="http://csharptest.net/downloads/schema/log4net.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <appender name="EventLogAppender" type="log4net.Appender.EventLogAppender"> <param name

Make the connectionstring's AttachDbFilename relative in config file

空扰寡人 提交于 2019-12-06 15:59:54
I am working on a project using an mdf file generated locally using Entity Framework Code First. The path to this mdf is set in several config files in my solution using <connectionStrings> sections like so : <add name="DataContext" connectionString="Data Source=(LocalDB)\v11.0;AttachDbFilename="E:\path\to\project\app_data\local.mdf";Integrated Security=True" providerName="System.Data.SqlClient" /> I use git versionning on this project both from work and at home, thus at work the mdf filepath has to be E:\path\to\project\app_data\local.mdf\ and at home D:\otherpath\to\project\app_data\local

Create custom section in config file

给你一囗甜甜゛ 提交于 2019-12-06 14:59:07
I am trying to create custom section in app.config file <?xml version="1.0" encoding="utf-8" ?> <configuration> <configSections> <section name="BlogSettings" type="ConsoleApplication1.BlogSettings, ConsoleApplication1" /> </configSections> <BlogSettings Price="10" title="BLACKswastik" /> </configuration> C# code : using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Configuration; namespace ConsoleApplication1 { class Program { static void Main(string[] args) { string title = BlogSettings.Settings.Title; Console.WriteLine(title); Console.ReadKey();

Visual C# app.config file for a referenced assembly

六月ゝ 毕业季﹏ 提交于 2019-12-06 14:50:09
问题 We have a Visual Studio 2010 solution that contains several C# projects in accordance with Jeffery Palermo's Onion Architecture pattern (http://jeffreypalermo.com/blog/the-onion-architecture-part-1/). We have a UI project that is an ASP.Net MVC project, and we have a C# Class Library project called Infrastructure that is referenced by the UI project. In our Infrastructure project we have added an app.config file to contain settings that are specific to the Infrastructure project. At runtime,

What is the equivalent of an app.config in a WinRT app?

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-06 13:37:40
In windows desktop development (WinForms, WPF), the app.config is a potential place to put things like connection strings or uri's used within the app. This allows the end user to change these settings, application wide, without having to have a developer rebuild and redeploy. Is there a similar concept in WinRT apps? The closest thing I see is there is the local application data: http://msdn.microsoft.com/en-us/library/windows/apps/hh700361.aspx The trouble I am having is that it seems like creating values and setting values in local application data are all done within code. Is there a way

Where to put application data and temp files on Windows, Linux and MAC if java-application is being lauched using JWS

♀尐吖头ヾ 提交于 2019-12-06 13:27:23
Can we allow user to set and save application data and temp data using Java-Application that has beenrun/launch using JWS ? Does it make sense ? We would like to know if user run JNLP directly then can user save preferences settings on local so when he/she run again JNLP he/she could find his/her last saved settings again. Where to put application data i.e configuration files, properties file. user download path etc.. and where to put temp files i.e.. logs etc.. on Windows, Linux and MAC if java-application is being launched using JWS ? trashgod I often use java.util.prefs.Preferences , but

Which NuGet package creates the web.config in your Views folder?

烂漫一生 提交于 2019-12-06 13:23:24
My project is missing the web.config file from the Views folder. Here are the steps I took to make the project. Created an empty MVC project and installed the packages listed below. Created a controller and view. The view was created by right-clicking the action name and selecting 'Add View...' from the menu. Attempt to run the project, but got the error CS0103: The name 'ViewBag' does not exist in the current context I am getting this error because web.config is missing from my Views folder. Since the web.config contains a lot of version numbers, tokens, etc..., my question is: Why wasn't

How to programmatically change an endpoint's identity configuration?

∥☆過路亽.° 提交于 2019-12-06 12:42:44
I am trying to create a tool to modify my service's app.config file programmatically. The code is something like this, string _configurationPath = @"D:\MyService.exe.config"; ExeConfigurationFileMap executionFileMap = new ExeConfigurationFileMap(); executionFileMap.ExeConfigFilename = _configurationPath; System.Configuration.Configuration config = ConfigurationManager.OpenMappedExeConfiguration(executionFileMap, ConfigurationUserLevel.None); ServiceModelSectionGroup serviceModeGroup = ServiceModelSectionGroup.GetSectionGroup(config); foreach (ChannelEndpointElement endpoint in serviceModeGroup

My web.config references an assembly used by a dependent DLL library. Any way around this?

旧城冷巷雨未停 提交于 2019-12-06 12:30:42
Here is my concrete example. I have written a dll which uses EntityFramework to talk to a database and do some work. Originally, the front end was a console application, but there is now an additional requirement for a web front end as well. From what I've read, the 'top-most' application (web app or console app) should store all the configuration, even the configuration which is needed only by the dll itself. (I will use the web app as my example from now one, but it applies to the console app as well) To get the web app working, I have moved the connection string and other settings from the

Encrypting config files for deployment

本小妞迷上赌 提交于 2019-12-06 12:14:41
问题 I have a windows service that reads from app.config. I want some settings to be encrypted, however, I don't want to use the ProtectedConfigurationProvider classes provided in .NET because they encrypt files based on the machine they are running on using DPAPI. What I wanted was a way for our administrator to deploy the config file already encrypted to many machines and have each machine decrypt them when needed. I don't want to hardcode a password into the assembly either so I'm not sure how