CORS access control allow origin [SOLVED]

CORS access control allow origin [SOLVED]

No access-control-allow-origin-header is present on required resource.

Origin is therefore not allowed access

Following is the solution to above problem.

Copy code given in following link to your Web.Config of your file in System.WebServer tag

44 thoughts on “CORS access control allow origin [SOLVED]

  1. Hi, I am still facing this issue added the way you mentioned also getting the call when I run the call in browser .please help on this , it will be very useful

  2. What if the server you're trying to access is a third party server like Office 365 and I don't have access to make adjustments?

  3. I have tried your code but still i was facing accessing the other domain url "in a frame because it set 'X-Frame-Options' to 'sameorigin'." this is the error can you suggest any solution . Thanks in Advance

  4. One thing u missed is to mention about is removing <handlers> section in the <system.webServer> tag in web.config to work this completly 🙂

  5. The source at [] is unreachable. Falling back to NuGet Local Cache at C:UsershpAppDataLocalNuGetCache
    I am getting this error

  6. I guess when you host, it will give you the same error. The missing part is here on where to configure CORS on Angular side.

  7. <httpProtocol>


    <add name="Access-Control-Allow-Origin" value="*" />

    <add name="Access-Control-Allow-Headers" value="Content-Type" />

    <add name="Access-Control-Allow-Methods" value="GET, POST, PUT, DELETE, OPTIONS" />



  8. I can't find the web.config file in my backend 🙁 It was created with nest. Any ideas on where should I paste the code or alternative solutions?

  9. i have done same but not able to access. using anglar to hit MVC web api but still getting cors error. Add the content in webconfig

  10. I am facing similar issue while calling my REST API from react JS. i dont see web.config file in my REST API related folders. Where should i add the code?. Thanks.

Leave a Reply

Your email address will not be published. Required fields are marked *