Category "asp.net-core"

Error in production after .net core upgrade to 3.1

I have performed an upgrade on an existing project from .net core 2.1 to 3.1. I've also upgraded the ABP packages to 5.13. Everything is working locally, howeve

Using the Try-Convert Tool for migrating from .net to .net core Multiple installs of MSBuild

I have installed the Try-Convert tool, and when i go to the root of my project and execute the try-convert command - I get multiple installs of MSBuild detected

Automapper profile maps its props to my dto

Hi. I want just map entity to dto but profile props map to the dto. Now what can i do for the following problem? public abstract class DtoProfile<TEntity

Where to set custom ClaimsPrincipal for all HttpRequests

I'm porting older application to ASP.NET Core, that uses Windows Authentication (configured in IIS, resp. launchsetting.json). I would like to override the aut

ITrackingConsentFeature not working in production

I have a cookie consent banner in my blazor server app, everything works well when building in debug mode, but when I push it into production I get a "Object re

How to create a cron like job using HangFire at startup?

I have a service class that has a method like public void BackgroundJob(string cronrule) { RecurringJob.AddOrUpdate("somejob", () => FetchCallHistoryAsyn

Invalid non-ASCII or control character in header on redirect

I'm using asp.net core 2.1 and I have a problem on redirect. My URL is like: HTTP://localhost:60695/ShowProduct/2/شال-آبی

EF Core executing previously failed query on SaveChanges

We have a .Net Core 3.1 application which is using EF Core to connect wit the SQL Server database. We are facing one problem, that when an exception occurs in o

EF Core executing previously failed query on SaveChanges

We have a .Net Core 3.1 application which is using EF Core to connect wit the SQL Server database. We are facing one problem, that when an exception occurs in o

ASP.Net core - blank response when returning a JObject property

I am using ASP.Net core 5.0 and want to return IEnumerable of an object as Action method response. Here is the response class: public class TestResponse { p

Why use AddScoped() instead of AddSingleton()?

Why I should use AddScoped() for my repositories or services? Why not AddSingleton()? I know about differences between them, but dont understand why I shouldn't

Posting form file to ASP .NET Core API using AWS SDK Test Lambda Context and APIGatewayProxyRequest

I have an ASP .NET Core API endpoint which accepts the below model: public class FileUploadModel { public IFormFile? File { get; set; } public DateTime?

NET Core 3.1 MVC Authorization/Authentication with token (JWT) obtained externally in separate Net Core 3.1 Web Api

I have 3 projects: Net Core 3.1 MVC project. Net Core 3.1 Web Api project with JWT auth --> connected to db via Entity Framework (Xamarin app that also uses

Asp.Net Core : Get the value after siding in DbContext?

I want to seed a default value in the database...These values ​​include a role and a user. How can I take the role value after seed and add it to th

Error CS0234 The type or namespace name 'HttpContext' does not exist in the namespace 'System.Web' in asp.net core

CS0234 The type or namespace name 'Http Context' does not exist in the namespace 'System Web' in asp.net core

filter data in header based on API key authentication

I want to try to filter data based on API key authentication using NET CORE where the key is stored in the header. each key has its own data. is there a refere

how to use ILogger when using global ActionFilter

i have an action filter where i am trying to log name of action that system enters and left. public class LogFilter : IAsyncActionFilter {

HttpContext.SignInAsync() doesn't authenticate the user

I have been trying to create a custom login feature in ASP.NET Core 2.1. However, it doesn't seem the work and I have no idea why. This is run in the controlle

Connect to Azure Service Bus with Amqp over WebSockets using new Standard library

I am trying to send a message to my queue hosted in azure. My application communicates with the world through a proxy. I use the .Net Core 2.1 and the new the

How to test a .NET 4.8 client running against a .NET 5.0 server in a developer-friendly way?

I don't know if this question is appropriate for this forum. I am developing a C# ASP.NET Core webservice and a client-side library that uses this webservice. A