config.json

cannot install docker on windows 10

五迷三道 提交于 2020-01-05 04:23:12
问题 I am pretty new to docker with windows. I had not problem with it on my personal mac. However, I have been unable to get docker to run correctly on windows 10. I have followed along the accepted stack overflow answer Cannot start docker after installation on Windows. However, when I run docker-machine ls I get NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS default not found Error open C:\Users\Steve\.docker\machine\machines\default\config.json: The system cannot find the file specified.

Configuring properties from config.json using services.Configure

怎甘沉沦 提交于 2019-12-24 02:43:27
问题 Following on from a StackOverflow question regarding Using IConfiguration globally in mvc6. A comment to the accepted answer suggests using services.Configure<SomeOptions>(Configuration); Now this works fine with the following code; Class public class SomeOptions { public string MyOption { get; set; } } config.json { "MyOption": "OptionValue" } Startup.cs public Startup(IHostingEnvironment env) { Configuration = new Configuration() .AddJsonFile("config.json") .AddEnvironmentVariables(); }

Retrieve sections from config.json in ASP.NET 5

你离开我真会死。 提交于 2019-12-19 20:35:14
问题 Let's say I have a config.json like this: { "CustomSection": { "A": 1, "B": 2 } } I know I can use an IConfiguration object to get specific settings, i.e., configuration.Get("CustomSection:A") , but can I grab the whole hierarchy (in any type - even a raw string would be fine)? When I try configuration.Get("CustomSection") , I get a null result, so I think this isn't supported by default. My use case is grabbing entire configuration dictionaries at once without having to grab each individual

how to add config file in Class Library, followed by connection string for .NET Core 1.1

徘徊边缘 提交于 2019-12-12 09:41:02
问题 I am working on n-tier application, where I have Data Access Layer. which is independent to any other application. I have create Class Library for .NET Core 1.1, I can see dependencies folder but not any config/JSON file. I want to know, Can I add AppSetting.JSON file in class library project? followed by how can I add connection string. I am aware to override ConfigureBuilder in DbContext class --> SQLServerConnection but I want to keep in separate config file and refer to these connection

Retrieve sections from config.json in ASP.NET 5

喜你入骨 提交于 2019-12-01 18:36:25
Let's say I have a config.json like this: { "CustomSection": { "A": 1, "B": 2 } } I know I can use an IConfiguration object to get specific settings, i.e., configuration.Get("CustomSection:A") , but can I grab the whole hierarchy (in any type - even a raw string would be fine)? When I try configuration.Get("CustomSection") , I get a null result, so I think this isn't supported by default. My use case is grabbing entire configuration dictionaries at once without having to grab each individual setting - some properties may not be known at compile time. I have solved a similar problem where I

Why does Visual Studio tell me that the AddJsonFile() method is not defined?

…衆ロ難τιáo~ 提交于 2019-11-30 10:40:33
I'm developing an ASP.NET 5 WebAPI project using VS Ultimate 2015 Preview. I'm trying to configure the app in this way (line numbers are just guides): 1 using Microsoft.Framework.ConfigurationModel; 2 3 public IConfiguration Configuration { get; private set; } 4 5 public Startup() 6 { 7 Configuration = new Configuration() 8 .AddJsonFile("config.json") 9 .AddEnvironmentVariables(); 10 } Line 8 gives me an error: 'Configuration' does not contain a definition for 'AddJsonFile'... What is wrong? Lonig You need to include the Microsoft.Extensions.Configuration.Json NuGet package if you want to call

Why does Visual Studio tell me that the AddJsonFile() method is not defined?

夙愿已清 提交于 2019-11-29 16:33:49
问题 I'm developing an ASP.NET 5 WebAPI project using VS Ultimate 2015 Preview. I'm trying to configure the app in this way (line numbers are just guides): 1 using Microsoft.Framework.ConfigurationModel; 2 3 public IConfiguration Configuration { get; private set; } 4 5 public Startup() 6 { 7 Configuration = new Configuration() 8 .AddJsonFile("config.json") 9 .AddEnvironmentVariables(); 10 } Line 8 gives me an error: 'Configuration' does not contain a definition for 'AddJsonFile'... What is wrong?