❔ !CORS ERROR!
Hi Everybody, I am working on one project that frontend is React and Backend is C#
in this project, I faced with CORS err, how can I solve this problem?
31 Replies
How did you enable CORS on your C# backend?
dont know
when I receive data from backend side to react, this error is occurred, I think..
do you have any experience with that?
You have to enable CORS in your ASP.NET api
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.
eh... I didnt use ASP.NET for my backend api
i will share screen shot
these are some screen shots of my backend side
This looks like a .NET framework project. Is that intentional, and if so, why?
Yes, this is .NET Framework Project...
eh, nothing special for reason.. I just wanted to make backend side using .Net
could you give me some help?
.NET framework is legacy, outdated
you should be using .NET 7
I used .Net 4.5.1...
to be honest, I dont have any exp or knowledge about ASP .NET
okay. well you are using a version that is from... 2015?
or so
you really should be using .NET 7, which is the current latest version of .NET
I will gladly help you, if you embrace the modern side of .NET and use .NET 7 with ASP.NET Core and EF Core.
okay, thanks
it looks like you already have visual studio 2022 installed, so you likely have .net 6 or 7 too
if you can just run
dotnet --info
in a terminal and show me the result...yes, will do
just a sec
okay that is.. old.
so that wasnt visual studio 2022 I saw?
2019.. lol...
Ok, you'll need to update
eh, is there any way without updating?
well, not with using visual studio.
Why are you so adverse to updating?
actually, my pc is not so good..
so it will take a long time when i update
I'd like to solve this problem asap
2013
it's as old as react
Well, as I said... I'm not here to fix your CORS issue as such
Im here to make you recreate your project from scratch on a modern .NET version
If you want to use a 2013 version that went out of support in 2016, that is your call.. but noone will want to touch that with a 40 foot pole
you're setting yourself up for more problems than just waiting a while to update software on your PC
oh, yes...
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.