app-config

inherit the proper app.config in a program started from context menu by SharpShell

回眸只為那壹抹淺笑 提交于 2019-12-11 20:36:04
问题 i'm trying to develop an c# app integrated with the windows shell, because of this i'm using the sharpshell library. i'm using the sharpshell library directly in the same project, creating a dedicated class for handle the context menu. originally i linked to the click event on the context menu the following command: System.Diagnostics.Process.Start(path, _command.ToString() + "|" + string.Join("|", SelectedItemPaths)); and the system was working. now i'm trying to start directly from the

Sharing AppSettings and ConnectionStrings between a console and a web app

ぃ、小莉子 提交于 2019-12-11 17:33:02
问题 I have a multi-tiered ASP.Net MVC 3 application in which different layers need to share some settings, and I am wondering how to best achieve this. For now, all my AppSettings are in the Web.config file, but I just added a new project to my solution to create a console application that will be called every night buy the Windows Task Scheduler to perform routine maintenance tasks. This console application will be using the same database, repository layer, service layer, etc. as the web

Dynamically change config files in .Net Application based on environments through Bamboo

北慕城南 提交于 2019-12-11 17:08:28
问题 I have a windows service written in .net c#. We have three different environments say dev , test and prod . I also have 3 different config files for 3 environments say devAppConfig , TestAppConfig and ProdAppConfig . Earlier, we used to deploy manual, so we used to replace the config files and deploy the binaries.Now the deployments are to be automated for that we are using Bamboo. Now my question is how do I dynamically change the AppConfig for different environment deployments. I have 3

How to avoid duplicate settings when using 2 projects and 2 testing projects in Visual Studio?

被刻印的时光 ゝ 提交于 2019-12-11 16:02:57
问题 Following my previous question, now I have 2 projects: one Console Project and a Library Project. They also have their respective unit test projects. When I run a test for the console project that uses a method from the library project and the library project needs an app.config setting, that setting must be in the console test project's app.config. What I have to do to make it read the setting from the library project app.config, so then I do not have to duplicate the setting across multiple

Referenced Class Library application settings in app.config are being used over ASP.NET MVC web.config's?

雨燕双飞 提交于 2019-12-11 15:38:30
问题 I am maintaining an ASP.NET MVC 4 project which references many Class Libraries that have their own app.config with settings managed through the Settings.settings UI. I have read many questions on Stack Overflow and recently this article and this SO question. It was my understanding that the Web.config of the web application in my MVC 4 project would be what all referenced projects would look at for the settings. You just have to make sure the same settings are specified in the main web

How to load a config file based on user selection from “unknown” location

你说的曾经没有我的故事 提交于 2019-12-11 15:33:23
问题 I have searched and searched and can't find a solution to my specific problem. I am updating a console app that will now be used for more than one client. We have decided, over storing the info in a db at least for now, to store the clients info in config files. Each client will have their own configuration file. I need to know how to load a/any config file from an "unknown" location. All of the examples that I found want me to put in the path of the file. While using my computer, I will know

NUnit3 multiple App.config files in Teamcity

时间秒杀一切 提交于 2019-12-11 14:24:05
问题 I'm having a strange problem. I have a bunch of integration tests projects. Each test project has a configuration file (app.config). Currently, in my "Run Integration Tests" build step, the NUnit3 console runner allows me to specify only one config file (where it says "Path to application configuration file"). I have specified the path to one of my integration test app.configs. The problem is, the tests in other test projects fail because the Nunit3 console doesn't recognize their app.config

how to recreate app.config.exe.config

本小妞迷上赌 提交于 2019-12-11 14:02:01
问题 My program is creating a .exe.config from my app.config and that exe is retaining the changes the user makes to it throughout and after runs of my program. That's great and all but I want to add a button to my windows forms app that allows users to reset those settings to the original values that are static/manually changed in my app.config. What is the best way to do this? This is the entirety of my app.config. <?xml version="1.0" encoding="utf-8" ?> <configuration> <appSettings> <add key=

from where to read keys in Class library/webapi

断了今生、忘了曾经 提交于 2019-12-11 11:28:37
问题 i have a webapi project that uses cache library.I am using cache duration key that is used inside cache library.My question is what is the standard practice where should i put Cache duration key,from Where to pick the value of cache duration, inside appconfig of cache library or from web.config of webapi? 回答1: The web.config is the place to go in a web application. There's no such thing as app.config in an ASP.NET application. You could always build some mechanism to load configuration data

reading TraceListener initializedata property from config .NET 1.1

点点圈 提交于 2019-12-11 10:47:22
问题 I have the following config file: <system.diagnostics> <trace autoflush="true" indentsize="1" > <listeners> <add name="dbgTrace" type="System.Diagnostics.TextWriterTraceListener" initializeData="C:\MyLogs\MyApp\Logs\LogFile.log" /> </listeners> </trace> </system.diagnostics> So I can read the tracelisteners collection like this: TraceListenerCollection tlc = System.Diagnostics.Trace.Listeners; and get the TraceListener from it, but the problem is, that I can not access initializeData property