Category "asp.net-core"

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

GitHub actions deploys wrong version of Newtonsoft.Json nuget package to Azure

I have a GitHub action doing .net solution build, test and deploy to Azure: name: Build and deploy ASP.Net Core app to Azure Web App - project-test-api on: p

How to stop the localized Microsoft.CodeAnalysis.*.resources.dll files from getting published by ASP.NET Core?

When I publish an ASP.NET Core 3.0 project, I get a few localized folders where the 4 assemblies shown are in each of these folders. I am not sure why these fol

Is there a way to alter ChildContent in Blazor

I'd like to alter ChildContent my component receives from the parent like this: <Markdown> # Title Some _Content_ </Markdown> To interpret t

FluentValidation: How to show client-side validation

I am using FluentValidation public class AddressModel{ public string Street{get; set;} public string City{get; set;} public string State{get; set;} pu

How to add global route prefix in asp.net core 3?

Legacy .net core frameworks used UseMvc() for adding global route prefix. How to make it for asp.net core 3 without UseMvc() ?

Embed JavaScript files inside a .NET class library for Blazor project

I'm working on a Blazor project and I'm trying to move one of the JavaScript files to a class library, I've read the following guides: https://docs.microsoft.co

How to import protobuf well-known types in AspNet Core gRPC Service

I', scratching my head about how to import "google/protobuf/empty.proto" to my proto file. What I'm doing so far: In my .csproj file, I added the following: &

Render partial view on button click in asp.net core

Based on which button is clicked i want to render a partial View inside a div element. If button1 is clicked then Partial View1 is rendered and if button2 is cl