Method not found System.Net.Http.Formatting.MediaTypeFormatter.get_SupportedMediaTypes() after adding .NET Standard 2.0 dependency

I have a .NET Framework 4.6.1 WebApi project that is referencing a small NuGet package we use internally to share common utility methods. We want to start moving some of our stuff to .NET Core, so I ...

20 Sep at 12:57

ASP.NET Core 2 Unable to resolve service for type Microsoft EntityFrameworkCore DbContext

When I run my asp.net core 2 projects I get the following error message: > InvalidOperationException: Unable to resolve service for type 'Microsoft.EntityFrameworkCore.DbContext' while attempting to ...

EntityFramework Core 2.0 - Add Migration error "The EntityFramework package is not installed"

*I'm getting an error when trying to Add-Migration for Entity Framework Core, to a Code First project, here are the details...* I have created a new ASP.Net Core web project (Core 2.0 in VS 2017)...

How Do I Clear The Credentials In AWS Configure?

I have deleted the [AWS credentials](https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-files.html) in `sudo nano ~/.aws/config`. But, the credentials are still in [aws configure](https://...

How to get access token from httpcontext using owin and Mvc 5

I've got a IDP implemented in [IdentityServer 4](https://identityserver4.readthedocs.io/en/release/). My web app client(implemented in Mvc 5) authenticates with the IDP but now I need to get the acces...

Add Reference to dll vs. adding a NuGet package in .NET Standard project

I have a .NET Standard 2.0 project in my solution and I am using the IConfiguration interface. When I write the name VS suggest that I reference Microsoft.Extensions.Configuration.Abstractions.dll. If...

20 Sep at 09:55

Asp.Net core "remember me" persistent cookie not works after deploy

I've built an MVC Core (Framework) application and I use Identity to login. When I click "Remember me" option all is ok on my develop machine, but after deploy on server machine, "remember me" doesn't...

Fixing Xcode 9 issue: "iPhone is busy: Preparing debugger support for iPhone"

I'm looking for more information on the message below. Xcode 9 seems to be hanging for a couple minutes already... > .Alex’s iPhone is busy: Preparing debugger support for .Alex’s iPhone Xcode will c...

31 Aug at 13:10

Xamarin Forms - negate bool binding values

I am learning the xamarin forms and mvvm pattern. I am wondering, if is it possible to negate binding bool value. What I mean is: I have, let's say Entry with isVisible Binding: ``` <Entry x:Nam...

20 Sep at 23:1

iPhone X / 8 / 8 Plus CSS media queries

What are the CSS media queries corresponding to Apple's new devices ? I need to set the `body`'s `background-color` to change the X's safe area background color.

Automapper Profiles not being loaded in Startup?

I'm using: - - It seems my profiles are not being loaded, every time I call the mapper.map I get Here my Startup.cs class ConfigureServices method ``` // This method gets called by the runtime....

19 Sep at 21:55

How to create a POST request properly using ServiceStack for C#

I have an API which contains the following bit. It is supposed to receive a `Person` object. ``` [HttpPost] public IActionResult Post(Person person) { ... } ``` I also have a consumer for this ...

20 Sep at 22:32

Visual Studio Community 2015 debugger ends at conditional breakpoint with "Evaluation of native methods is not supported" - how do I fix?

I have a conditional breakpoint and the condition checks the value of a string and stops if it's true. It stops but then a window opens saying: `The condition for a breakpoint failed to execute ... T...

Chr(34) equivalent

I am converting `VB.NET` code to `c#` and I am stopped when I reached the following code snippet. I need someone's help to convert Chr(34). Please help me to convert it to `c#`. ``` Dim inputStri...

19 Sep at 15:50

Sharing secret across namespaces

Is there a way to share secrets across namespaces in Kubernetes? My use case is: I have the same private registry for all my namespaces and I want to avoid creating the same secret for each.

9 Jun at 06:34

LoggerFactory Generates InvalidOperationException

I've created a console application using Microsoft.Extensions.Logging that uses a service layer. ``` public static void Main(string[] args) { // Create service collection var serviceCollectio...

11 Jan at 17:18

.NET Core IssuerSigningKey from file for JWT Bearer Authentication

I am struggling with the implementation (or the understanding) of signing keys for JWT Bearer Token authentication. And I hope somebody can help me or explain me what I am missunderstanding. The last...

26 Feb at 07:47

When is it more efficient to pass structs by value and when by ref in C#?

I've researched a bit and it seems that the common wisdom says that structs should be under 16 bytes because otherwise they incur a performance penalty for copying. With C#7 and ref return it became q...

7 Mar at 18:4

Set cookies for cross origin requests

How to share cookies cross origin? More specifically, how to use the `Set-Cookie` header in combination with the header `Access-Control-Allow-Origin`? Here's an explanation of my situation: I am att...

How to pass some data through signalR header or query string in .net core 2.0 app

Using signalR in .net 4.7 we were able to pass two variables from the client application to signalR server. Here is the code snippet: ``` public class MyHub : Hub { protected (string myVar1, stri...

ServiceStack Json deserialization error

Here is the code of my .net core 2.0 console app: ``` using ServiceStack; using System; using System.Collections.Generic; namespace ConsoleApp1 { class Program { static void Main(...

18 Sep at 11:10

XMLHttpRequest blocked by CORS Policy

I add an API with following script in let's say [http://www.test.com](http://www.test.com): ``` <script src="http://apiendpoint.com/api/v1/api.js"></script> <div id="api" data-apikey="LA59CJI9HZ-KIJ...

16 Jun at 18:55

How To design configurable field level permissions with Entity Framework

Say we have a table of information pertaining certain models of cars, such as the following: [](https://i.stack.imgur.com/Oz7g2.png) How would I best implement field level access permissions for read...

No authenticationScheme was specified, and there was no DefaultChallengeScheme found Cookies Authentication

I am using the below code for authentication in ASP.NET Core 2.0 using cookies ``` services .AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme) .AddCookie("MyCookieMiddlewar...

10 Jun at 05:46

Cannot open new Jupyter Notebook [Permission Denied]

I have installed Jupyter Notebook on ubuntu 16.04 using pip3. I can execute `jupyter notebook` command. It opens and shows a list of current path directories. But I cannot create a new notebook(). It...

27 Aug at 09:0