Category "asp.net-core"

Support OData for an entity with 2 composite keys in ASPNetBoilerplate

I'm using ASP.NET Boilerplate framework for ASP.NET Core. How do I add a OData controller to support an entity with 2 composite keys. I have the composite key

Unable to resolve service for type Microsoft.EntityFrameworkCore.DbContextOptions

When I want to add controller using ASP.NET Core MVC with views: enter image description here This is my DbContext class: namespace Infrastructure { public

<label> element splits to multiple lines

I have a <label> element in my ASP.NET core MVC project, that splits to multiple lines instead of showing in a single line. I've inspected the element in

System.ArgumentNullException: Value cannot be null. (Parameter 'connectionString') asp.net Core Docker-compose

I have a dockerized asp.net Core application trying to connect to a mySql Database. Both are running inside a docker-compose. When I test the connection to a lo

Authentication with Azure AD redirect_uri is incorrect using FrontDoor

I've got an Azure FrontDoor setup as a reverse proxy/load balancer between a container running on port 5443 and a custom domain. The point of this is to provide

Modify middleware response

My requirement: write a middleware that filters all "bad words" out of a response that comes from another subsequent middleware (e.g. Mvc). The problem: strea

How to Include Jquery function in a partial view in a modal

I have a jquery button click method which works fine in views other than modals.uploadbtn button click method doesn't work when partial view is loaded in the mo

How do I get client IP address in ASP.NET Core?

Can you please let me know how to get client IP address in ASP.NET when using MVC 6. Request.ServerVariables["REMOTE_ADDR"] does not work.

Views not found after migrating to .NET 6

I migrated an ASP.NET CORE MVC project from .NET Core 2.1 to .NET 6. After making relevant changes, the project compiles and starts seemingly OK, but the views

Change default Identity routes in an Angular & ASP.NET Core project

I configured Angular to use "login" route to show a LoginComponent page. That's ok. But when I try to access some authorized page without login made, I got th

Error trying to create Mock.Of<ControllerContext>() for ASP.Net Core 3.1 Unit Test

As per last section of the Moq Quickstart defined here, I am trying to configure the following Mock in order to pass Form values to the controller method under

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