configuration

.Net Core / Console Application / Configuration / XML

自闭症网瘾萝莉.ら 提交于 2020-01-12 14:28:33
问题 My first little venture into the .Net Core libraries using the new ConfigurationBuilder, and Options pattern. Lot's of good examples here: https://docs.asp.net/en/latest/fundamentals/configuration.html and a good copy of the example here Item 1. it says this can be used with non MVC applications, but no examples on how to use it without MVC - particularly if you are using a custom, strongly-typed class. I would like to see an example of showing the setup of DependencyInjection, Configuration,

.Net Core / Console Application / Configuration / XML

◇◆丶佛笑我妖孽 提交于 2020-01-12 14:28:06
问题 My first little venture into the .Net Core libraries using the new ConfigurationBuilder, and Options pattern. Lot's of good examples here: https://docs.asp.net/en/latest/fundamentals/configuration.html and a good copy of the example here Item 1. it says this can be used with non MVC applications, but no examples on how to use it without MVC - particularly if you are using a custom, strongly-typed class. I would like to see an example of showing the setup of DependencyInjection, Configuration,

WCF IIS hosted service multiple Service Contracts implemented by a single service - how do I share uri between endpoints via config

99封情书 提交于 2020-01-12 07:26:49
问题 I have a set of Service Contracts which split up my service interface into chunks of related functionality. I am currently implementing all contracts using a single service class (may want to split these later but for now the single service class suffices). I am trying to use configure the endpoints using a config file (as opposed to via code). The problem is I get a ServiceActivationException because the two endpoints (one for each service contract) are trying to listen on the same uri. The

Configuring MongoDB on Windows

邮差的信 提交于 2020-01-12 05:13:26
问题 I am trying to set up MongoDB on Windows, and the online docs seem far from accurate. Under "Configure a Windows Service" part, step 1 mentions to create a config file. Then it mentions to fill in the file with a line in the format logpath="X:\path\mongo.log" . However, following the link, the config file is said to be in YAML format, which renders the previous line unreadable in YAML. I have created a basic mongodb.cfg ( .cfg or .conf ??) file: systemLog: destination: file path: "P:\\Servers

Configuring MongoDB on Windows

佐手、 提交于 2020-01-12 05:13:24
问题 I am trying to set up MongoDB on Windows, and the online docs seem far from accurate. Under "Configure a Windows Service" part, step 1 mentions to create a config file. Then it mentions to fill in the file with a line in the format logpath="X:\path\mongo.log" . However, following the link, the config file is said to be in YAML format, which renders the previous line unreadable in YAML. I have created a basic mongodb.cfg ( .cfg or .conf ??) file: systemLog: destination: file path: "P:\\Servers

Use properties file instead of static final variables

回眸只為那壹抹淺笑 提交于 2020-01-12 05:01:08
问题 I have many classes with static final fields which are used as default values or config. What is best approach to create global config file? Should I move these fields to single static class, use properties file or what? Edit: I need to use this values both in java classes and xhtml pages. Values dosen't depend on envirnoment. I could compile project to set new values - no problem. 回答1: The answer depends... Put stuff in properties files if the values change depending on runtime environment

How can one read a text file in a Struts 2 app [duplicate]

倾然丶 夕夏残阳落幕 提交于 2020-01-12 03:41:09
问题 This question already has answers here : Where to place and how to read configuration resource files in servlet based application? (6 answers) Closed 3 years ago . Developing a Struts 2 app I run in a following problem. I need to read a text file that is deployed in web server with my app. How can I access it knowing its relative path. In other words how can I find absolute path if I know relative path inside the deployed directory. When I had similar problem with servlets I used to use this

Switch to “Native Windows Secure Channel library” from “OpenSSL library” on Windows Git, without reinstalling?

谁说我不能喝 提交于 2020-01-12 02:19:12
问题 During the installation of Git on my Windows machine, I selected "Use the OpenSSL library" for HTTPS Transport backend. I would like to switch to "Native Windows Secure Channel library" for HTTPS Transport. Is this possible without re-installing git on Windows? 回答1: I found the setting for "schannel" or "openssl" with Git for Windows 2.14.2, 64 bit in file: C:\Program Files\Git\mingw64\etc\gitconfig Example config for OpenSSL: [http] sslCAInfo = C:/Program Files/Git/mingw64/ssl/certs/ca

Is possible to change the default diff tool in Mercurial?

本秂侑毒 提交于 2020-01-11 15:28:07
问题 Every time I do an hg diff file.ext I end up using a console diff application. I would like to use Kdiff3 or WinMerge (I'm using Windows). Is there a way to change that? I can't find a reference in Mercurial documentation ( I'm not talking about merge! ). 回答1: I've solved this using a Mercurial built-in extension... I just have to add the following lines to Mercurial.ini (on Mercurial folder): [extensions] hgext.extdiff= [extdiff] cmd.vdiff = kdiff3 When I want to use kdiff3 instead of diff I

Package-specific logging levels for different Logback appenders

我与影子孤独终老i 提交于 2020-01-11 08:15:25
问题 I have this simple Logback config file, containing two appenders and some custom logging levels based on package name. <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE xml> <configuration> <appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender"> <encoder> <charset>UTF-8</charset> <pattern>%date{HH:mm}\t%-5level\t%msg%n</pattern> </encoder> </appender> <appender name="FILE" class="ch.qos.logback.core.FileAppender"> <file>my_logger.log</file> <encoder> <charset>UTF-8</charset>