Category "asp.net-core"

Problem with configuring ssl certificates in asp .net core API

I have the following certificates Certificates I want to configure my asp .net core web API to use these certificates in order to use https redirection. I am us

Problem with configuring ssl certificates in asp .net core API

I have the following certificates Certificates I want to configure my asp .net core web API to use these certificates in order to use https redirection. I am us

How to access HttpContext and Request in RequireAssersion?

I'm trying to create a custom authorization policy. Let's say I want the URL to contain a token. For example: https://example.com/customer/list?token=2nHxltsDOj

Using resx resources in .NET Core 1.0

I am attempting to use a resource(.resx) file in an ASP.NET Core project. I had it working in rc1 using a namedResource, but can't seem to get it working in RTM

How to add project reference to ASP.NET Core 1.0 MVC project

I have a ASP.NET Core 1.0 MVC app in solution X and I have some common projects (.net 4.5.2 class libs) in solution Y. I want to reference the projects in solu

How to cancel .Net Core Web API request using Angular?

I have the following two applications Angular 6/7 App .Net Core Web API I am making GET request to API using Angular's HttpClient as shown below this.subscrip

Using 'UseMvc' to configure MVC is not supported while using Endpoint Routing

I had an Asp.Net core 2.2 project. Recently, I changed the version from .net core 2.2 to .net core 3.0 Preview 8. After this change I see this warning message

How to use jquery in ASP.​NET Core

I created a ASP.NET core template and wrote a jquery script. When I look at the page I see that jquery is loaded into the page, but the script doesn’t run

Why ASP Net Core 2.2 do not release memory?

I'm testing ASP Net Core 2.2 using default project made from: Visual Studio > File > New > Project > ASP NET Core Web Application > Next > Cr

How to return a specific status code and no contents from Controller?

I want the example controller below to return a status code 418 with no contents. Setting the status code is easy enough but then it seems like there is somethi

How do I solve a "view not found" exception in asp.net core mvc project

I'm trying to create a ASP.NET Core MVC test app running on OSX using VS Code. I'm getting a 'view not found' exception when accessing the default Home/index (o

No authentication handler is registered for the scheme 'Cookies'. The registered schemes are: Application, Bearer, ASOS

I am implementing Aspnet.security.openidconnect (ASOS) with .net core 2.1 application. Now the issue is when I am trying to execute this chunk in controller,

How to mock an IFormFile for a unit/integration test in ASP.NET Core?

I want to write tests for uploading of files in ASP.NET Core but can't seem to find a nice way to mock/instantiate an object derived from IFormFile. Any suggest

Issue with API Versioning .NET Core 2.2 UnsupportedApiVersion

I am creating an API and need to have versioning done in it. I am using package Microsoft.AspNetCore.Mvc.Versioning 3.1.3 My StartUp.cs is as follows In Confi

Serilog set flush interval

I'm using serilog in my ASP Core 2.2 application. Everything works great but I can't set flushToDiskInterval. It means that I want to flush logs to disk every m

automapper map interface to interface or object

How to map objects inherited from one interface to objects inherited from another interface. I have such code structure public interface IDataTranslatable {

Unable to create an object of type 'DbContext'

When I try to run dotnet ef migration add Init I get error Unable to create an object of type 'IdentityContext'. I know what caused the problem. I wan

Using remote validation with ASP.NET Core

I am trying to create a remote validation as follows: [Remote("CheckValue", "Validate", ErrorMessage="Value is not valid")] public string Value { get; set; }

API Gateway Ocelot and Kubernetes

I am trying to access my microservice "externalforum-api-svc" inside my kubernetes cluster using ocelot gateway. I`ve followed the docs but it does not seem to

API Gateway Ocelot and Kubernetes

I am trying to access my microservice "externalforum-api-svc" inside my kubernetes cluster using ocelot gateway. I`ve followed the docs but it does not seem to