Category "asp.net-core"

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

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

React native with Asp.net Core photo upload

I want to upload photos with React Native. My API attempt from Postman resulted in a positive. But React Native didn't make it. React Native function upload

React native with Asp.net Core photo upload

I want to upload photos with React Native. My API attempt from Postman resulted in a positive. But React Native didn't make it. React Native function upload

How to download file on browser from Dotnet core endpoint

I have a react front-end and the dotnet core web API project on the back-end. I have an endpoint on which a client can request a file using fileId from my react

ASP.NET model that requires a reference to a IdentityUser?

I have a model Blueprint that requires a reference to an IdentityUser. When I run Add-Migration CreateBlueprintSchema the following error is thrown: No suitabl

Do not add to list if it is null c#

I am trying to create a list from anonymous function. I want the list to be created if request model properties are not null. Currently, it is adding null to th

Net Core API: Purpose of ProducesResponseType

I want to understand the purpose of ProducesResponseType. Microsoft defines as a filter that specifies the type of the value and status code returned by the act

Unexpected character encountered while parsing value: . Path '', line 1, position 1

I've created an out of the box .NET Core 2.2 solution and run it. As in: Create Project, selecting ASP.NET Core Web Application. Select API as the project tem

Click on ASP .Net Core Identity Log In button leads to 400 error

I'm writing simple asp .net core 2.2 MVC app with individual authorization (ASP Identity) hosted on IIS 10. If user navigates to Login page, stays idle for 20+

Blazor server app still authorized even after altering cookies

I have tested a sample Blazor server application that uses standard ASP.NET Core Identity and I logged in successfully. But even after I tried to alter the cook

Serilog not writing to file on Ubuntu

I have deployed a website to a ubuntu machine but unable to get serilog to write to file Here is what I have: In Program.cs (omitted unnecessary parts): public