Category "asp.net-core-mvc"

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

System.Data.SqlClient.TdsParser' threw an exception: System.BadImageFormatException: An attempt was made to load a program with an incorrect format

I am hosting .net core applicaton on server but when I try to run the application it throws exception in windows logs: Unhandled exception. System.TypeInitializ

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

Fetching data from an API in ASP.NET Core MVC

I'm facing problem while fetching data from an API in ASP.NET Core MVC controller (imdb api). The problem is I cannot deserialize the current JSON object into t

Setting connection string with username and password in ASP.Core MVC

I am working on my first ASP.NET Core MVC application.What is the right way to specify the connection string in a ASP.NET Core MVC application with a sql server

Pass current transaction to DbCommand

I'm working on a project using ASP.NET Core 2.1 and EF Core 2.1. Although most of queries and commands use EF, some units needs to call stored procedures direct

DotNetCore 1.0 MVC how to automatically redirect to a single domain in live

I have multiple domains for a website: http://example.com http://www.example.com http://www.example.co.uk In production, I want the primary domain to be htt

How to get the current domain name in Startup.cs

I have a domain that has multiple sites underneath it. In my Startup.cs I have the following code public void ConfigureServices(IServiceCollection services) {

How to get the current domain name in Startup.cs

I have a domain that has multiple sites underneath it. In my Startup.cs I have the following code public void ConfigureServices(IServiceCollection services) {

Adding AddRazorRuntimeCompilation() to the container in .NET CORE 6 will break the CSS footer

I create a brand new ASP.NET Core MVC project using VS 2022 and .NET Core 6. VS will generate the base template and when I run it without touching any code, eve

Adding AddRazorRuntimeCompilation() to the container in .NET CORE 6 will break the CSS footer

I create a brand new ASP.NET Core MVC project using VS 2022 and .NET Core 6. VS will generate the base template and when I run it without touching any code, eve

options.UseSqlServer returns Error in startup.cs

I'm developing a test Project using asp.net core. For Connecting to database I'm using Entity framework. I add appsetings.json file to the project and change th