Category "asp.net-core-3.1"

AWS Lambda image/pdf upload to S3 is corrupted (asp.net core)

I have written a function that uploads a file in an s3 bucket. It works fine when I run my application locally. But when I deploy the application in AWS Lambda,

Binding section from appsettings.json to options

So I was trying to follow the Microsoft Docs, Options pattern in ASP.NET Core however for the life of me I can't seem to correctly get the "AppSettings" section

Authorize(Roles = "Admin") not working in .net core 3.0

I have been struggling with the Authorization bit in my .net core 3.0 application. My User.IsInRole("Admin") returns true but if I add [Authorize(Roles="Admin")

AWS Lambda Json Serializer is removing trailing zeros from milliseconds in a date time input

I have created an AWS lambda with C# .net core 3.1. This lambda takes a json object as input and one of the property names of the json object is a datetime. Loo

How to map Object to KeyValuePair<char, string> using AutoMapper?

I'm trying to map my object model to a KeyValuePair<char, string> but my results are KeyValuePairs where Key = null and Value = null. What's the correct w

The type or namespace name 'OpenIdConnectOptions' could not be found while upgrading my ASP.NET Core 2.2 to 3.1

I am trying to upgrade my ASP.NET Core 2.2 to 3.1 but getting below error. Not Sure how to resolve it. I am getting below error Severity Code Description P

ASP.NET Core api controller not being instantiated

I've created an API controller in my .NET Core 3.1 application (with an Angular frontend, C#). For some strange reason its not being instantiated, if I try to c

Net core Identity lockout not lockout user account

I try to enable lockout feature but I am not successed. Each time, I check database, AccessFailedCount is increase to 1 but after that again it turn to 0. What'

Why is web.config getting created on publish not on build the project in Asp.Net Core API?

I have Asp.net Core 3.1 API project. When I build it doesn't create any web.config file, but when I publish the API using VS 2019 in a folder, it creates a web.

ASP.NET Core 3.1 MVC Routing issue with IIS Default Web Site

New information: After much messing around with trying to manipulate the URL I almost got it working but not quite. Then I discovered that it works without any

ASP.NET Core 5 MVC localization query string working but routing not working

In trying to localize my application, the query string localization has worked and accept language header also working, but routing is not working. Here is my c

''MS-ASPNETCORE-TOKEN' does not match the expected pairing token' when calling deployed .net core API on IIS

I am receiving the following exception in the logs and event viewer when calling an endpoint in a .Net core application (3.1): 'MS-ASPNETCORE-TOKEN' does not m

Error: System.Net.Http.HttpRequestException: Response status code does not indicate success: 405 (Method Not Allowed)

I am getting following exception when calling an Asp.NET Core 3.1 web api from a Blazor app. But same code works great from visual studio debugging Response sta

How to make "One or more validation errors occurred" raise an exception?

I'm running a WebAPI on Core 3.1 and one of my endpoints excepts JSON with a model that has fields with [Required] attribute like so: public class Vendor {

InvalidOperationException: Can't use schemaId .. The same schemaId is already used for type

I receive the following error. InvalidOperationException: Can't use schemaId "$Registration" for type "$PortalService.Models.Registration". The same schemaId is

the type or namespace name 'RuntimeCompilation' does not exist in the namespace 'Microsoft.AspNetCore.Mvc.Razor'

If I write this line of code, services.AddMvc().AddRazorRuntimeCompilation(), in startup.cs and while publishing the project from Visual Studio 2019 on Azure, I

How do I update Microsoft.AspNetCore.Http 3.0 in .Netstandard 2.0

I need to upgrade a reference Microsoft.AspNetCore.Http.dll 3.0 When I try to upgrade Microsoft.AspNetCore.Http 3.0 using Nuget and it is showing as installati

Trying to create the database using ABP framework while DB Migration

I have inserted connectionstring in "[AbpTenantConnectionStrings]" table for same tenant id. My objective is to create both the DB and migrage the DB DB while

Unable to verify checksum for avformat-58.dll

The following is a crash dump produced by my video streaming application written in .NET Core 3.1 with Windows Forms 32-bit. I'm trying to workout how to best i

Cannot start windows service (.Net Core worker service) due to extra extension methods on IHostBuilder

Goal: I'm trying to run a .Net Core 3.1 Worker service as a windows service. Setup: I've used the Worker service default template via Visual Studio. To add wind