Category "asp.net-core"

ASP.NET CORE 2.1 Server timeout while debugging

'Error: Server timeout elapsed without receiving a message from the server.'. I'm trying to debug some server-side code and while I do that the client ge

How to propagate Always encrypted column encryption to Test, Acceptance and Production?

We are using Always encrypted in a .Net core application. The Sql Server database is maintained with EF-core migrations. I was wondering how to propagate the co

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

notification does not implement $INotification C#

I have a multi-tenancy project using mediator and CQRS, for some reason my CRUD from order request are returning this error, I already try refactor my handler s

Trying to connect to wwwroot and get a image

I work in aspnet core mvc technology, I manage to add an image, it does go to wwwroot, but the image does not display well in the browser Example: enter image d

How to customize migration generation in EF Core Code First?

There is a special base table type in my DbContext. And when inherited from it I need to generate an additional "SQL" migration operation to create a specific t

Apparently Random Error: "Antiforgery token validation failed. The antiforgery cookie token and request token do not match."

Background I have a relatively new ASP.NET Core 2 site. It's running on just one server (Windows Server 2012 R2, IIS 8.5), and I only restart the site once eve

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.

How to get only specific tables to create models from database with Entity Framework Core in C#

I'm using Scaffold-DbContext to create models from an existing database, but it auto pluralizes the table names and I don't want that. It also gets all the tabl

.net core injecting and resolving services

I am trying my hand at .net core web api. I have created a static method for registering my controllers like this: public static class RegistrationExtensions {

.Net 6 Blazor app UseHttpsRedirection is causing many redirects

I have a .NET 6 Blazor Server and another .NET 6 Blazor Wasm site. Both work fine locally but when hosted on a shared hosting site get an error 'too many redir

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

How can I catch an exception and send it as json message?

I wrote a code but for some reason it doesn't work...can you tell me what's wrong? I want the app not to stop when I get an exception, only to send that excepti

Why is not working EF Core retry on failure

I've configured my db context to retry on failure this way: optionsBuilder.UseSqlServer(connectionString, sqlServerOptionsAction: sqlOptions => {

What is the right way to prerender Blazor WebAssembly?

It almost works after the following steps: Install the hosted version of blazorwasm template app. dotnet new blazorwasm --hosted -o HostedWasm Copy _Hosted.cs

Asp.net core, "asn1 encoding routines:asn1_d2i_read_bio:not enough data" error for certificate

When running my asp.net core application locally in my Linux Docker container, the following error occurs: Unhandled exception. Interop+Crypto+OpenSslCryptograp

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 atte

How to SetBasePath in ConfigurationBuilder in Core 2.0

How can I set the base path in ConfigurationBuilder in Core 2.0. I have googled and found this question, this from Microsoft docs, and the 2.0 docs online but

Enabling authentication in swagger

I created a asp.net core empty project running on .net6. I am coming across an issue when I am trying to enable authentication in swagger. Swagger UI runs as ex

Can I move appsettings.json out of the app directory?

I want to put my appsettings.json file outside of the web folder so that I can avoid storing it in source control. How can I do this?