Category "asp.net-core"

CompilationFailedException during runtime compilation of Razor from AspNetCore TestHost

I have ASP.Net MVC application, one part of it is compiling razor views to string. The code is very similar to this example: https://long2know.com/2017/08/rend

the type or namespace name 'RuntimeCompilation' does not exist in the namespace 'Microsoft.AspNetCore.Mvc.Razor'

If I write this line of code, services.AddMvc().AddRazorRuntimeCompilation(), in startup.cs and while publishing the project from Visual Studio 2019 on Azure, I

How to load razor page before it's done rendering?

I have a table of records in Index.cshtml, once a user clicks on a record to view the details it will take them to Details.cshtml. The issue is, there is a lot

Showing #value! before enable editing on excel if I write formula using epplus

Using C# .net core I am updating existing excel template with Data and formulas using EPPlus lib 4.5.3.3. If you see the below screen shots all formula cells ha

Microsoft.AspNetCore.OData 8: controller is not found by convention

As described in the docs, Microsoft.AspNetCore.OData 8 uses a convention to tie a controller to an entity set. They also provide a sample that demonstrates this

Best strategy for creating a child container (or isolated scope) with Microsoft.Extensions.DependencyInjection

In my AspNetCore application, I process messages that arrive from a queue. In order to process a message, I need to resolve some services. Some of those service

Confirm popup working fine but not delete the item in .net core

public async TaskOnPostDelete(int Id) { var book= await _db.Book.FindAsync(Id); if(book == null) { return NotFoun

SignalR: Cancellation in Case of Client to Server Streaming makes code buggy in case of dotnet client

I’m trying to send a stream from client to server from a dotnet client to another dotnet server through sending an invocation to a method on server hub as

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