How to enable CORS in ASP.NET Core

前端 未结 12 681
无人及你
无人及你 2020-11-22 14:11

I am trying to enable cross origin resources sharing on my ASP.NET Core Web API, but I am stuck.

The EnableCors attribute accepts policyName

12条回答
  •  情话喂你
    2020-11-22 14:36

    All the workaround mentioned above may work or may not work, in most cases it will not work. I have given the solution here

    Currently I am working on Angular and Web API(.net Core) and came across CORS issue explained below

    The solution provided above will always work. With 'OPTIONS' request it is really necessary to enable 'Anonymous Authentication'. With the solution mentioned here you don't have to do all the steps mentioned above, like IIS settings.

    Anyways someone marked my above post as duplicate with this post, but I can see that this post is only to enable CORS in ASP.net Core, but my post is related to, Enabling and implementing CORS in ASP.net Core and Angular.

提交回复
热议问题