Category "asp.net-core"

Prevent DefaultAntiforgery from logging errors

Is there a way to stop DefaultAntiforgery from logging errors? I see it takes an ILoggerFactory as parameter, which is a public type, but I don't know how to se

Get Identity Role id - ASP.NET Core MVC

I am new to ASP.NET Core MVC, and I'm trying to develop a popup modal for Edit and Create. The create popup works, but when it comes to edit I can't get the id

SignalR TypeError: Failed to fetch after deploying to Azure

I am trying to create a small chat app using SignalR. In my backend I am using .net Core 5 and in Frontend, I am using React. When running in localhost every th

Generate JWT Token for logged in user?

I have a razor pages app [username and password auth] and a WebAPI app that uses JWT auth. Both the services use the same user table. After user proceeds to che

Net Core 2.2 Web App - Cookie of browser too large on specific server

I have a web application running on .Net Core 2.2 and so far it has been deployed on various servers on IIS screenshot of web.config The cookies created on all

Azure devops appsettings.json variable substitution from Key Vault in pipelines not working

I have a .Net 6 web application that I am building in devops. I am trying to substitute settings in the appsettings.json, but somehow can't get it working. What

How is Windows Authentication Wired Up?

I'm in the process of creating an ASPNET Core 6 MVC app in VS 2022 which will eventually be deployed in a Docker container. Windows Authentication will be used

Difference between instance of HttpClient and IHttpClientFactory in .NET Core5

Below is my Startup.cs public class Startup { public Startup(IConfiguration configuration) { Configuration = configuration;

ASP .NET Core custom authentication scheme with external login

I have a website where users log in on an external website and are redirected back with a token in the querystring. I then validate the token and create the aut

Error when using CreatedAtRoute in ASP.NET Core minimal API

I'm trying to use CreatedAtRoute in minimal API. app.MapGet("/clients/{id:int}", [EndpointName("GetClientById")] async (int id, ClientsContext db) => await

How to monitor CPU and RAM consuming by a .NET Core application

I am working on an ASP.NET Core Web API application in which I am working with the files security. I want to monitor the maximum and minimum RAM and CPU consump

how to apply numeric validation

I want to apply validation for integer but it's not working function fnAllowNumeric() { if ((event.keyCode < 48 || event.keyCode > 57) && ev

Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool issues even If I used using statement

I am working on dotnet core 3.1. I am working on API call. When I call the API, below function in Repository will execute first by saving the data: then anothe

OpenIdDict 3.0 error from ASP.NET Core 3.1 web application

I am hosting my ASP.NET Core 3 web application in Azure, whenever I do a new publish to Azure, it works as expected. However, the next day, the site is down, th

How to Publish DotNet Core (v5.0) Web Api to IIS?

First thing I did was install the .NET Core Hosting Bundle on the IIS server; I have also stopped and re-started IIS; I've tested and can confirm my app runs on

How to prepopulate name of the printer in the browser

I'm using ASP.NET MVC and I'm using a function with AJAX that opens in the browser the window to print. My questions is when I print I would like to already set

Custom authorization issue

I'm testing some custom authorization without the default Entity Framework stuff. I have created an "ASP.NET Core Web App (Model-View-Controller)" project using

Renci.SshNet.Common.SftpPermissionDeniedException: 'Permission denied'

I am new to SFTP. I am getting Renci.SshNet.Common.SftpPermissionDeniedException: 'Permission denied' error while uploading an image to the SFTP location from a

ASP.NET Core 6: How to intercept all incoming requests to call an external service

I am planning to build a micro frontend to intercept and handle all incoming requests just calling an external service that will render the html that the micro

.Net core app runs with EXE but does not run on IIS

I have a .Net Core 6 app which runs fine locally, it also runs fine when I manually start the exe in the publish folder. However when I run on IIS, it gives the