Category "asp.net-core"

What is default maximum request length in .net core

I want to know what is default maximum request length in a .net core application. I read from few links that the default limit is 4 MB for asp.net applications

C# Razor partial view using an iFrame returns dictionary error "`1" and "`2"

I am attempting to load a partial view into an iFrame and receiving the below error. When loading the same partial not inside of a iFrame, there is no issue. Lo

Why can't I add months to OffsetDateTime?

I'm using NodaTime to manage dates and time zones in a .Net Core WebApi. One of the type in the library is OffsetDateTime, which is very similar to DateTimeOffs

React + ASP.Net-Core CORS Problems

While CORS is a big issue when working ReactJS in combination with ASP.Net-Core I figured out how to enable CORS so when accessing my UI (http://localhost:3000)

Why does an application pool for ASP.NET Core in IIS take a long time to stop?

I developed a simple demo web app using ASP.NET Core 5 and published in IIS. However, it takes a long time (over 30 seconds) when I press application pool stop

Disable verbose logging of symbol loading in vscode debug console

When running my webapp (in vscode), the debug console is filled with lines like these: Loaded '/foo/bar/dotnet/shared/Microsoft.NETCore.App/2.2.4/System.Pri

Differences between Microsoft.AspNetCore.Mvc.Testing and Microsoft.AspNetCore.TestHost packages

I have used several times the package Microsoft.AspNetCore.TestHost to host Asp.Net Core Web API applications in my integration test. With Asp.Net Core 2.1 the

Asp.Net Core http requests shows Headers.ContentLength

I am doing an http get call and I can see that Headers.ContentLength always returns null whereas I can see that in fiddler a value: This is my code string url =

An exception was thrown while deserializing the token.The antiforgery token could not be decrypted in .Net Core 2.2 application

I am getting the error in my log. I spent most of my day finding the solution but could not find the one which meets my requirement. Here is the log error seve

ASP.NET Core MVC app can't find error page?

I have an ASP.NET Core 3.1 MVC applications (not a Razor Pages project) and I'm trying to use the exception handling middleware via app.UseExceptionHandle("/err

How to fill attribute value from database on Razor Pages .netCore

I have an attribute above the action Method, the value of which must be filled from the database But I do not know how to do this I want to use this attribute i

ServiceFilter and TypeFilter - what is the difference in injection those filters?

ServiceFilter we must register in Startup.cs. TypeFilter is injected by Microsoft.Extensions.DependencyInjection.ObjectFactory, we don't need to register that f

Why app returns only one supported culture?

I try create language switch on my site. I've add cultures in Startup: IList<CultureInfo> supportedCultures = new List<CultureInfo> { new Cultur

Dot Net Core - How to Prevent appsettings.production.json from changing upon publish

I'm publishing my .net core website to the server. Here is the code that adds Json files to my content path: var builder = new ConfigurationBuilder()

ASP .NET Core 6 with Windows authentification - don't show user login prompt dialog

I've created an ASP .NET Core 6 Web App with Windows authentification from a template and I assume that current Windows user's credentials to be obtained autom

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 {

Microsoft.Extensions.Logging custom implementation, how to get the caller method name?

I'm in .NET 6, I implemented a custom ILogger<TService> (of Microsoft.Extensions.Logging). Usually, when I implement a logger, I also get the caller metho

Lazy loading in EFCore loads all the data even if not accessed

I have been trying to use lazy loading in ASP.NET core 6, I have followed the documentation to do so. However, the behavior of the lazy loading is not the same

stdout message shows "Access to the path 'C:\Windows\system32\config\systemprofile' is denied" as log

I have hosted .net core application on IIS. When i am trying to browse the application, HTTP Error 502.5 - Process Failure error comes up on browser. On checkin

Post FromBody Always Null

I've got a new API that I'm building with ASP.NET Core, and I can't get any data POST'ed to an endpoint. Here's what the endpoint looks like: [HttpPost] [Ro