Category "asp.net-core-mvc"

ASP.NET Core 3.1 MVC: setting IgnoreNullValues to true in Startup still renders NULL properties

I have an ASP.NET Core 3.1 project. I am using .AddJsonOptions() in startup with and setting IgnoreNullValues to true. I've created a simple test, and it still

ASP.NET Core 3.1 MVC JWT Login return 401

I have a problem , jwt authentication return 401 Error. Token was created but always return 401 error. I used layered architecture. I tried many things on start

How do I get the userId to save in the database while submitting the form?

I'm a beginner and well i'm doing a form which is capable to send information to the database but I needed one more thing to be sent and it is the Id from the u

What causes a partial view to not run controller actions

I have no idea what happened but suddenly the CRUD operations in my simple app no longer work. Clicking on the create button in my partial view, instead of runn

.NET Core 3.1 CreateHostBuilder Cannot parse JSON file

I am experiencing an error when trying to run my ASP.Net Core 3.1 project. The error is at CreateHostBuilder within Program.cs public class Program {

Cannot find reference assembly 'System.Reflection.Primitives.dll' file for package System.Reflection.Primitives

We have hosted a ASP.NET Core v3.1 Website in IIS. But when I try to view the page getting internal server error. This issue only occurs in the specific machine

ASP.NET Core MVC - posting to a different action name does not bind the values

I'm using a regular html form instead of @html.BeginForm and I have these 2 form tags in my Create.cshtml view file. I was experimenting with routing, but my po

The corresponding CLR type for entity type 'Employee' is not instantiable

My error: The corresponding CLR type for entity type 'Employee' is not instantiable and there is no derived entity type in the model that corresponds to a conc

Cannot connect to SQL Server Browser. Ensure SQL Server Browser has been started

I'm trying to connect my ASP.NET Core MVC application to SQL Server. I'm using the Visual Studio for mac. I wrote the connection string like below : "Connect

Can't access User Secrets in ASP.net core 3.0

My question is simple. I have an ASP.net core 3.0 app, I added secrets using visualstudio and pasted my secrets into the secret file normally. Then inside my P

ASP.NET MVC Core Consuming Web API with Arrays?

I am having difficulty and although I thoroughly (I think) researched the web, including here at SO, I cannot seem to find what I am looking for -- or I am bein

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

ASP.NET Core form ignoring asp-controller

I'm working on an ASP.NET Core application. Part of it is an image gallery which allows the user to upload images. On localhost this works as expected, but when

In asp.net core mvc, the model binding for decimals does not accept thousand separators

For a model with a decimal property, if the value from client contains commas as thousand separator, the model binding will fail. How can we solve this? Any so

Internet Explorer redirect on all .Net Core project pages

I'm a .Net Core beginner and look for a solution to protect the application from IE. I got the following code working in Controller: string userAgent = Reques

.NET Core Pomelo Mysql connection

I'm trying to run a Entity Framework command in dotnet cli and I'm getting the following error: Access denied for user ''@'fe80::45b2:4add:f2de:ebcf%6' (using

Cannot create database migration on EF Core but It can when you ask to EnsureCreate database

I am trying to inject some repository to a service and some services to a controller but I am using the DbContext is an assembly that is not the startup projec

Cannot create database migration on EF Core but It can when you ask to EnsureCreate database

I am trying to inject some repository to a service and some services to a controller but I am using the DbContext is an assembly that is not the startup projec

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

How could I get a parameter of an action from the ResultExecutingContext when using a Filter

I'm creating a custom result filter that implements IAsyncResultFilter interface. In this filter I need the actual value returned by the Action, but I also need