Category "asp.net-core"

The required library libhostfxr.so could not be found. Netcore Linux

❯ dotnet ef A fatal error occurred. The required library libhostfxr.so could not be found. If this is a self-contained application, that library shou

Authorization in ASP.NET Core. Always 401 Unauthorized for [Authorize] attribute

For the first time I'm creating Authorization in ASP.NET Core. I used tutorial from here TUTORIAL The problem is when I sending request from postman: Authori

How to use alert(),confirm() and prompt() function using Blazor?

I am learning the Blazor technology. I started a default increment project in VS 2019 and I have modified the code for Decrement with confirm() and alert but it

How to pass model value IFormFile from view to controller On Change event

$(".uploadFile").on('change', function () { console.log('new file uploaded') //var array = $("#productImage").getIdArray(); var file

ASP.NET Core: Error while Updating Migration (Database first approach)

I have created an application in .NET Core where I am trying with database first approach. I was able to add Migration using "Add-Migration InitialCreate" but

Azure.Messaging.ServiceBus Error when completing or abandoning message

Som I'm currently looking into updating our very simple service bus service to the latest version (Asure.Messaging.Servicebus) and I'm running into a smaller pr

The default XML namespace of the project must be the MSBuild XML namespace

I cloned the ASP.NET Core SignalR Repo locally, and try opening the solution from within the following environment. IDE Microsoft Visual Studio Enterprise 201

How to access ASP.NET Core web server from another device

I created a project using C# and ASP.NET Core empty and it worked on localhost - how can I access it from another device using the IP of the computer running th

Confuse about Nuget and Libman in VS2022

I am new to .NET Core web development. In VS2017, when I install jQuery using Nuget, a message will be shown suggesting to use Libman instead. However, in VS202

IList returning count=0 on posting back updated checkboxes

I'm using asp.net-core with razor pages. I'm trying to update the checkboxes in the table. When clicking on button save I pass with asp-route-for because I wan

ASP.NET Core fails to load assemblies after migration from .NET 5 to 6.0.1

Recently, I upgraded our ASP.NET Core Web API project from .NET 5 to .NET 6.0.1. It was initially developed in .NET 5, but since this version is EOL somewhere t

Uncaught SyntaxError: Invalid regular expression [intlTelInput]

I am trying to use intl-tel-input in Asp.net core 6.0 razor pages Here is my Scripts $(document).ready(function(){ $('#tbxPhone').intlTelInput();

How to check radiobutton with Enum value in Asp.net core mvc view?

I have rendered my view like below <div class="row row-margin-zero"> <label class="radio-inline margin-rightt-ten margin-leftt-five margin-top-none

.Net Core 3.1 - Set ForContext for Serilog with Microsoft Ilogger interface

How to dynamically set ForContext property for Serilog logger using Ilogger interface from Microsoft.Extensions.Logging? Here's the code: private readonly ILogg

.NET core - Configure JWT Authentication at runtime

I have an ASP.NET Core 2 Web Application and I am using the [Authorize] attribute on the controllers that require authentication. As authentication mechanism, I

The constraint reference 'string' could not be resolved to a type. (netcoreapp3.0)

I have got an error. This is my Startup class. public void ConfigureServices(IServiceCollection services) { services.AddControllers(); } public void Confi

.Net Core 3.0 possible object cycle was detected which is not supported

I have 2 entities that are related as one to many public class Restaurant { public int RestaurantId {get;set;} public string Name {get;set;} public Li

Decrypt ".AspNetCore.Session" cookie in ASP.NET Core

In Asp.Net core, a cookie is created when you configure your app to app.UseSession(). By default the cookie is called ".AspNetCore.Session". Its value identifi

Issue: No 'Access-Control-Allow-Origin' header is present on the requested resource

My problem is that I can't access to GET method from my Angular app because of the issue: Access to XMLHttpRequest at 'https://localhost:44337...' from origin '

How to read request body in an asp.net core webapi controller?

I'm trying to read the request body in the OnActionExecuting method, but I always get null for the body. var request = context.HttpContext.Request; var stream =