Getting value from appsettings.json in .net core
Not sure what am I missing here but I am not able to get the values from my appsettings.json in my .net core application. I have my appsettings.json as: ``` { "AppSettings": { "Version": ...
- Modified
- 8 Jun at 11:55
update to python 3.7 using anaconda
[Python 3.7](https://docs.python.org/3.7/whatsnew/3.7.html) alpha version is out, but I haven't been able to find any post on how to update to python 3.7 using Anaconda - maybe they will wait for the ...
- Modified
- 10 Jan at 15:38
ASP.NET Core 2.0 combining Cookies and Bearer Authorization for the same endpoint
I've created a new ASP.NET Core Web Application project in VS17 using the "Web Application (Model-View-Controller)" template and ".Net Framework" + "ASP.NET Core 2" as the configuration. The authentic...
- Modified
- 12 Jun at 16:52
Unable to resolve service for type while attempting to activate
In my ASP.NET Core application, I get the following error: > InvalidOperationException: Unable to resolve service for type 'Cities.Models.IRepository' while attempting to activate 'Cities.Controllers....
- Modified
- 31 Dec at 11:33
How to solve npm install throwing fsevents warning on non-MAC OS?
Following warning is being thrown on `npm install` command - ``` npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.2 (node_modules\rea ct-scripts\node_modules\fsevents): npm WARN notsup SK...
- Modified
- 25 Oct at 10:29
xunit constructor runs before each test
In a test class, the constructor starts before each test and the initialized data provided by the constructor isn't reachable by the following tests. I'd like the initialized data to be accessible fo...
- Modified
- 17 Mar at 14:25
Property 'controls' does not exist on type 'AbstractControl' Angular 4
I am trying a nested reactive form in Angular 4. It is working fine but when I try to build AOT it's throwing the error > 'controls' does not exist on type 'AbstractControl' I googled and tried few...
- Modified
- 25 Oct at 08:46
How to purge messages for Service Bus Topic Subscription
Just wondering the best way (even if via Portal, Powershell, or C#) to purge the messages off of a Service Bus Topic's Subscription. Imagine we have a topic with 4 subscriptions, and we only want to p...
- Modified
- 7 May at 07:16
Error: Could not initialize class com.android.sdklib.repository.AndroidSdkHandler
I've setup the environment for react native on Windows. But when I run the command ``` react-native run-android ``` I get the following errors - ``` * What went wrong: A problem occurred configur...
- Modified
- 24 Oct at 18:14
The type initializer for 'SQLite.SQLiteConnection' threw an exception
I'm trying to implement an incredibly basic use of SQLite. I have a `Button` and an `EditText`. I want to store the contents of the `EditText` `OnClick`. I'm following this: [https://developer.xamar...
- Modified
- 24 Oct at 17:31
Is there a way to revert to a previous commit in VS code?
Is there a way to revert to a previous git commit in VS code? I know I can see the changes between commits and the differences in the working tree but I want to know how to reset to the previous commi...
- Modified
- 21 Dec at 22:0
Cannot find module 'aspnet-webpack' when using 'dotnet publish' in .Net Core 2.0 & Angular
I have been trying to follow answers to this problem but to no avail.. I am trying to publish my .Net Core 2.0 & Angular project using the command line command 'dotnet publish' I successfully publish,...
- Modified
- 24 Oct at 14:21
What's the difference between a ReadOnlyDictionary and an ImmutableDictionary?
In C#, what is the key difference (in terms of features or use cases) between these two containers? There doesn't appear to be any information comparing these on Google. [System.Collections.ObjectMod...
- Modified
- 2 Dec at 15:52
ServiceStack RedisAuthRepository not storing anything
I have this problem where I'm trying to use ServiceStack RedisAuthRepository to store user information so I can use it to rehydrate the User Session that’s embedded in the JWT Token. So far this is my...
- Modified
- 25 Oct at 13:4
Controlling menu with the arrow keys and enter
I was trying to create an RPG. I have a problem with the menu where I can choose a class. I was trying to create an menu where you can control the directions with the arrow keys to the specific class ...
- Modified
- 7 May at 05:52
DataTestMethod vs TestMethod
I started to use MSTest 2 `DataRow` attributes to check multiple cases in a single test: ``` [TestMethod] [DataRow(1, 1, 2)] [DataRow(1, 2, 3)] public void AdditionWorks(int op1, int op2, int expecte...
- Modified
- 25 Oct at 11:33
Call SignalR Core Hub method from Controller
I am using ASP.NET Core 2.0 with Microsoft.AspNetCore.SignalR (1.0.0-alpha2-final). I have windows service which communicate with Excel, SolidEdge ... When operation is complete it post request to ...
- Modified
- 5 Mar at 13:35
How to Replace by pattern with Regex in C#
I have a text, the text contains char sequence which begins with # and ends with ="" characters. Between the # and ="" characters just exists alphanumeric characters, without space or ; chars. I tried...
- Modified
- 24 Oct at 07:20
Uploading File using Ajax in Asp.Net Core
Good day everyone, I'm trying to upload file using ajax from client side to server side (asp.net core) controller but I'm having a null value. Here's my html and javascript codes: ``` <input type="...
- Modified
- 24 Oct at 06:44
Using a null IDisposable value with the using statement
The following code produces no errors when executed: ``` using ((IDisposable)null) { Console.WriteLine("A"); } Console.WriteLine("B"); ``` `using` If so, where is it documented? Most C# code I...
- Modified
- 24 Oct at 02:13
ReadKey InvalidOperationException application does not have a console
I am trying to use `ReadKey()` to get a password field so it doesn't show in the console for a .net core app I am running on Ubuntu. This is code: ``` while (true) { var key = System.Console.ReadK...
Cannot resolve scoped service Microsoft.AspNetCore.Mvc.ViewFeatures.Internal.IViewBufferScope from root provider
I'm trying to use in my ASP.NET Core 2.0 web app this sample [RazorViewEngineEmailTemplates](https://github.com/ianrufus/BlogPosts/tree/master/RazorViewEngineEmailTemplates) to create an html email bo...
- Modified
- 23 Oct at 20:29
Read a YAML file in C#?
I am trying to read a .yaml file into my C# application, and store the data in a custom class. I am attempting this using `YamlDotNet` from nuget. The file is pasted below, and the code I have (from t...