Category "asp.net-core"

What is the difference between services.AddAuthentication() and services.AddAuthorization() in asp net core?

I have the following code and i want to understand what is the difference between those two extension methods. What each one do? services.AddAuthentication (Jw

VS2022: how to make ASP.NET Core 5 app show it's console window

In VS2019, when I start my ASP.NET Core 5 app, which just exposes an API, if that matters, a console window pops up for that app. There used to be some setting

aspnetcoremoduleV2 missing from iis modules after running the runtime bundle

I dont have aspnetcoremoduleV2 in iis modules, even after installing the runtime/hosting bundle so I cant deploy or test any core service P.S: I used to hav

Running .NET 5 Api under Kestrel from Visual Studio 2019 ignores launchSettings.json applicationUrl setting

We are having an "only on my machine" issue that nobody can figure out. We have a .NET 5 Api that we run under Kestrel for development purposes. On every other

How to fix "AADSTS90102: 'redirect_uri' value must be a valid absolute Uri." error in Microsoft Graph

Following this procedure: https://docs.microsoft.com/en-us/graph/auth-v2-user I'm trying to get a refresh token from this microsoft end point: https://login.m

Include custom WWW-Authenticate header in 401 Unauthorised response when using Microsoft.Identity.Web

Following instructions on making MS Office connect to my Asp.NET Core Web API, I am attempting to present a login redirect to MS Office for failed authenticatio

ASP.NET Core stream video from the OpenCVSharp capture

I want to stream video captured from the webcam using ASP.NET Core application. I also need to do some manipulations with the frames, that's why I'm using OpenC

Set configuration part in startup with static parameters not json file in .net core

I have this line of code in my test solution . I want to config ravenoption in my test code. public IHost host = null; public IDocumentStore documentStore = nul

How to turn on CircuitOptions.DetailedErrors?

I'm getting this message in the console when running a server-side Blazor app: Error: There was an unhandled exception on the current circuit, so this cir

How to run python script from C# code by using command

I have a script file(run_edr.py) in my local machine and when I run it by using "cmd" and the following command then the script works perfectly. The script take

How to display default value in dropdown editor for grid column

This is my grid: var grid = Html.Kendo().Grid<UserVM>() .Name("Grid") .DataSource(dataSource => dataSource .Ajax() .Events(even

Getting an invalidcastexception when trying to retrieve data

When running the get method to return a view populated with details, I get the exception saying: System.InvalidCastException: 'Unable to cast object of type 'Sy

The specified CGI application encountered an error and the server terminated the process. - timeout issue

Getting below error for API which takes around 2-4 minute to process Code:502 Error: Bad Gateway The specified CGI application encountered an error and the serv

How does cascaded parameter Task<AthenticationState> get unwrapped and exposed as "context" in AuthorizeView and AuthorizedRouteView in Blazor WASM?

There is a an object of type AuthenticationState named "context" that is available inside AuthorizeView and AuthorizedRouteView components. This object allows t

How do I use .Net Core Dependency Injection from within a custom Class

Bit of a newbie question. I am having trouble getting access to dependency injected services from within my own custom class in ASP.NET Core 3.1 I can access se

ASP.NET Core Identity prevent user from using same password

I have a project where I am using ASP.NET Core Identity (with IdentityServer4) for user authentication. When I use ChangePasswordAsync to change password, it is

Is there a way in Fluent Validation library to remove the index from the collection validation errors?

I'm using Fluent Validation to validate this model: class MyModel { public int Id {get; set;} public List<ChildModel> Children {get; set;} } clas

Setting up IActionDescriptorCollectionProvider for a unit test

I am currently writing unit tests for a TagHelper that uses IActionDescriptorCollectionProvider in its constructor. My setupt looks as below so far - any ideas

Tag helper order of execution

I am writing a set of ASP.Net Core tag helpers that target (among other tags) <form> and <input> tags. My <form> tag helper defines a custom a

how do you set same error message for all required attribute validation?

I am new to .net core. The following code changes all required validation message to "This field is required" for asp.net framework. public class CustomRequir