Category "asp.net-core"

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

Entity Framework Core: load related data after object is queried

It is clear how to query an entity and include all the related data; e.g.: using (var context = new BloggingContext()) { var blogs = context.Blogs .

Passing a large file stream to MultipartFormDataContent with HttpClient

I'm experiencing a problem when trying to use MultipartFormDataContent with HttpClient with a stream of data. Context I'm trying to upload a large file to ASP.N

How do you get data and bind to a table?

I am trying to get data from a database and just bind the output to a table. I am using AJAX because some of my other codes won't allow me to mix with the IEnum

ASP.NET Core 6 how to access Configuration during startup

In earlier versions, we had Startup.cs class and we get configuration object as follows in the Startup file. public class Startup { private readonly IHostE

SQL Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding

I am using Microsoft.EntityFrameworkCore.SqlServer 2.2.6. I have a stored procedure which typically takes 1 to 2 seconds to execute. I am using .NET Core 2.2 wi

Store Entity Framework Core SQLite file in project-relative subdirectory

I have an ASP.NET Core 2.0 app using Entity Framework Core and the SQLite Provider. I am trying to store the SQLite database file in a subdirectory (specificall

Web Application build error with net6.0 framework, is already signed (NETSDK1177)

I am working on MAC and dotnet core 3.1, 5.0 and 6.0 versions are installed on my machine. I not able to build Web Application on my machine due to shared error

ASP.NET Core MVC (2.2) Error Middle-ware not triggering error pages

In my ASP.NET Core MVC (2.2) app I have completed the setup for a global error handling class. I inject this class in the Startup.cs of my project by using app.

How to convert a file into byte array in memory?

Here is my code: public async Task<IActionResult> Index(ICollection<IFormFile> files) { foreach (var file in files) uploaddb(file);

Include wwwroot from a library project?

I'm working on a project structure with multiple projects serving the same set of static files. At start each project will server both the static files and the

Jenkins MSBuild fails, error NETSDK1064: Package Microsoft.CodeAnalysis.Analyzers, version 2.9.3 was not found

I am trying to deploy a sample aspnet core project but Jenkins build fails. C:\Program Files\dotnet\sdk\3.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.Packa

ASP.NET 5 Authorize against two or more policies (OR-combined policy)

Is it possible to apply authorization against two or more policies? I am using ASP.NET 5, rc1. [Authorize(Policy = "Limited,Full")] public class FooBarControll