.net-core-configuration Questions

2

Solved

I have a .NET Core console application. I'm trying to retrieve the environment variable using the below code. var environment = Environment.GetEnvironmentVariable("ASPNETCORE_ENVIRONMENT"); Howe...
Federal asked 29/8, 2019 at 15:32

2

Solved

I want to use ConfigurationBuidler to read my appsettings.json file. I cant see what I am doing wrong. My file is { "comment": "this gets copied to bin\\debug on build. the app upda...
Labana asked 21/12, 2019 at 21:57

3

Solved

I cannot get basice LogTrace(...) output in my application. Here's a repro: Create a new ASP.NET Core application using Visual Studio 2017. (Optional) comment out .UseApplicationInsights() so the...

5

Solved

Normally in a .NET Core project I would create a 'boostrap' class to configure my service along with the DI registration commands. This is usually an extension method of IServiceCollection where I ...
Melaniemelanin asked 24/12, 2019 at 23:14

3

Solved

I have been looking at a number of tutorials and SO questions (such as App Settings .Net Core) regarding reading appsettings.json in .Net Core 3 and I cannot find any pointers on how-to when dealin...

1

Solved

Really struggling with this one - is it supposed to be this hard?! I have a simple object array in my appsettings: "AppSettings": { "Names": [ { "Id": "1", "Name": "Mike" }, { "Id": "2", ...
Isomeric asked 10/6, 2020 at 11:47

3

I have created a .net core console application using TopShelf. But I got an error when running the application using docker (alpine-linux). Configuration Result: [Success] Name MyApp [Success] D...

1

Solved

I try to add a logger to my console app. All configuration apply correctly, except Logging Program.cs: private static void Main(string[] args) { var services = new ServiceCollection(); Config...

1

Solved

The following program: using System; using System.Collections.Generic; using Microsoft.Extensions.Configuration; namespace ConsoleApp3 { class Program { static void Main() { var builder = ne...
Apostolic asked 31/8, 2018 at 19:0
1

© 2022 - 2024 — McMap. All rights reserved.