© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
4 replies
abc

❔ CORS error

I have enabled cors according to: https://learn.microsoft.com/en-us/aspnet/core/security/cors?view=aspnetcore-7.0
named policy and middleware

policy.WithOrigins("http://localhost:7022").AllowAnyHeader().AllowAnyMethod();

i still get

rom origin 'https://localhost:7022' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
Enable Cross-Origin Requests (CORS) in ASP.NET Core
Learn how CORS as a standard for allowing or rejecting cross-origin requests in an ASP.NET Core app.
Enable Cross-Origin Requests (CORS) in ASP.NET Core
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

❔ !CORS ERROR!
C#CC# / help
3y ago
❔ CORS error
C#CC# / help
4y ago
❔ Cors Policy Error
C#CC# / help
3y ago
✅ Enable CORS
C#CC# / help
2y ago