Category "asp.net-core"

.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 =

Hiding Azure CDN url

Is there any way to hide the Azure CDN Url in the browser. We have developed the application using ASP.Net Core 2 with Angular 5, also is there any helper class

How to directly set response body to a file stream in ASP.NET Core middleware?

Sample code below to write a file stream to Response.Body in an ASP.NET Core middleware doesn't work (emits empty response): public Task Invoke(HttpContext con

Host ASP (.NET 6) in a Windows Service

I am currently hosting an ASP.NET (.NET 5) application in a Windows Service using WebHost and WebHostBuilder. .NET 6 introduced WebApplication and WebApplicatio

How to set json serializer settings in asp.net core 3?

json serializer settings for legacy asp.net core applications were set by adding AddMvc().AddJsonOptions(), but I don't use AddMvc() in asp.net core 3. So how c

onclick method not working in Blazor server-side razor component

I am building a sample razor component, and I can not get my button onclick method to fire. When I click the button nothing happens at all. I have even placed a

Blazor @attribute [Authorize] tag is not working

I have a working .NET Core 3.0 MVC website, using AzureAD for authentication, this all works fine. I have started to migrate some of the front-end pages to Blaz

Displaying website image testing vs. production

I am currently working on updating a .NET Core website which currently has image tags displaying from a URL like: <img src="https://page.website.com/images/

MQTTnet Connection Issue with HiveMQ Cloud

I am new to the MQTT world and I am trying to create a .Net 5.0 application that connects to a HiveMQ Cloud Broker. I have created a free broker and I am able t

split json response in Qt

I have created a Restful Web Service in ASP.NET and would like to use it in my own Qt project. I can post to and get the data from my Web Service in the SoapUi

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