Category "asp.net-core"

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) {

How to apply Client Side validation using Fluent Validation for .Net core

.Net Core 3.0 MVC view. Needs to apply - Client Side validation for below model. Tried as follow: Model:Person public class Person { public int Id {

ASP .NET CORE simple parameter validation

Is it possible to do some validation using attributes on simple parameters, like: [HttpGet("test/{type}")] public ActionResult GetSomeData([Range(0,2)]byte typ

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

Microsoft.Extensions.Hosting.HostFactoryResolver+HostingListener+StopTheHostException

I'm using Asp.Net Core Web Api 6 I'm facing an error when migrating my DbContext and when updating the database The Error [17:07:29 INF] Application Is Starting

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

ASP.NET Core IHostedService manual start/stop/pause(?)

I would like to implement a recurring (timed) IHostedService instance in ASPNET Core that can be stopped and started on demand. My understanding is that IHoste

ASP.NET Core IHostedService manual start/stop/pause(?)

I would like to implement a recurring (timed) IHostedService instance in ASPNET Core that can be stopped and started on demand. My understanding is that IHoste

ASP.NET Core IHostedService manual start/stop/pause(?)

I would like to implement a recurring (timed) IHostedService instance in ASPNET Core that can be stopped and started on demand. My understanding is that IHoste

Aftter conversion to .NET 6.0, question mark is added to text

We have an ASP.NET Web API project that gets data from Java service that lives in Web Sphere and is exposed as a WCF service. After conversion to .NET 6.0, the

Custom Result in Net 6 Minimal API

In ASP.NET Core 5 I had a custom Action Result as follows: public class ErrorResult : ActionResult { private readonly IList<Error> _errors; public E

Update only two columns of table in razor pages

I have a razor page configuration that returns a a partial view with an entire table in it: <div class="col-12 border text-left p-3 mt-3 d-flex"> <

Bearer error="invalid_token", error_description="The issuer is invalid"

I have a simple web api project, which looks like this: [Authorize] [Route("Get")] public ActionResult<string> SayHello() {

ASP.NET Core MediatR error: Register your handlers with the container

I have a .Net Core app where i use the .AddMediatR extension to register the assembly for my commands and handlers following a CQRS approach. In ConfigureServi

Failed to load the hostfxr.dll after install net core

Anyone has this problem i change Pc and tried to install net core framework but vs code return this info when i tried to write dontet --info Failed to load th

.Net Core 2.1 - Cannot access a disposed object.Object name: 'IServiceProvider'

I just migrated .NET Core 2.0 to .NET Core 2.1. Everything went fine, but when I try to login now I get the folowing error: $exception {System.ObjectDispos

How do I update Microsoft.AspNetCore.Http 3.0 in .Netstandard 2.0

I need to upgrade a reference Microsoft.AspNetCore.Http.dll 3.0 When I try to upgrade Microsoft.AspNetCore.Http 3.0 using Nuget and it is showing as installati

dotnet run not working after update to dotnet 6

I updated yesterday from .Net 5 to .Net 6 and now my projects can't start with dotnet run. I then get the error: Building... warn: Microsoft.AspNetCore.Server.K