Category ".net-core"

Could not load Newtonsoft.Json. Issue with .net framework / core / standard versions

[EDIT 3: bottom line, this stuff can work but is fragile. take a false step and VS will pull in undesired versions. Be prepared to backup, undo changes, and tr

Using multiple authentication providers in C# .net core

We had .net core API already authenticating with AzureAd and then a new requirement came to authenticate the same API using Auth0 as well while keeping existing

Add entity data model (edmx file) to .net core API

I have .Net Core 5.0 API project contains another .Net Core Class Library. Also I have exiting SQl Server Database. How can create edmx using .net core project

ASP.NET Core 5 returning JSON adding $id and $values properties

I'm using ASP.NET Core 5. As below, I'm using System.Text.Json: public IActionResult Index() { var result = GetAllMenuItems(); return Ok(result); } The

Entity Framework Long Timeout on Queries from Azure PostgresSQL DB

I am having an issue with excessivly long timeouts with calls to an Azure PostgresSQL server. On rare occasions, the call to the database will take approximate

Dotnet - How to change Target Framework using CLI?

How to change Dotnet target framework in .csproj using CLI? I know how to do this using Visual Studio, but I want to do it using CLI. Are there any commands lik

Entity Framework Core error "Column names in each table must be unique"

I have manually added the column IdCategory to my table Books, and now each time I try to run Update-Database, I get this error: fail: Microsoft.EntityFramewor

SocketCAN in dotnet core

I am writing software for the device on Linux, and which should work with the CAN interface. Ideally, I would like to work with the interface without connecting

How to connect to Cloud Firestore DB with .net core?

So far all the examples of using Google Cloud Firestore with .net show that you connect to your Firestore db by using this command: FirestoreDb db = FirestoreD

dotnet add package bootstrap gives 404 error with source nuget.org

I'm trying to add bootstrap to a new dotnet core razor app. C:\dev\core>dotnet --version 2.1.302 I created the project with the command below and have mad

Using a .net core dll with .net framework app?

I think i know the answer to this question but wanted to make sure. We are trying to dip our toe in .net core. We would like to code some of our dlls in .net co

How to mock IConfiguration.GetValue

I tried in vain to mock a top-level (not part of any section) configuration value (.NET Core's IConfiguration). For example, neither of these will work (using

Can't use AddHttpClient / IHttpClientBuilder in console app

I have some code from a web app that configures the http client to use a certificate. I relies on IHttpClientBuilder and AddHttpClient. I'd like to use the same

How to create docker image for dotnet app?

I have a dotnet project that work when i do dotnet run, i am trying to containerize that dotnet project. For that i have create the Dockerfile as below: FROM mc

Simple logging in .NET Core app on Elastic Beanstalk

I'm just starting to put some ASP.NET Core apps on Elastic Beanstalk. I want to do some simple logging initially just to track down some issues. I normally use

serilog format SourceContext for showing only assembly name

I configured my project to use Serilog for logging using dependecy injection. I use the following schema in the classes constructor: namespace FlickPopper.API

Identity UserManager CreateAsync does not write to database

It doesn't give any errors or warnings but it doesn't insert in the database. Seems like it's only in memory. Also UserManager's FindByNameAsync can't check use

Docker container is not running on given port in dockerfile

I am trying to run my application on docker (Linux container). In my Dockerfile i'm exposing the port 80 Dockerfile FROM mcr.microsoft.com/dotnet/core/aspnet:3.

Docker compose build error - Project file does not exist

I'm trying to create docker compose which run my ASP.NET Core app and mssql, but I'm getting an error during build. Here's my docker compose file: # Build Sta

"Could not locate MSBuild instance to register with OmniSharp" but msbuild is installed

Due to the third party system we work against, I have to use .Net 2.1, which has worked fine until recently. I develop on Fedora with latest updates and VSCode