Cannot run Radzen Angular Project because of CORS on local

Hello Radzen Team,
we have a new developer in the team who will be the Radzen developer.
He downloaded two of our projects and after launching the app on localhost he got the CORS error:


We tested two different projects with the same result.

Access to XMLHttpRequest at '[http://localhost:5000/odata/PreventiveMaitanenc/Machines'](http://localhost:5000/odata/PreventiveMaitanenc/Machines) from origin 'http://localhost:8000' 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.

How can we overcome this error?
Is this some of the browser settings?

Thank you

Hi @koblamic,

I can't see much from your screenshot but I suspect this isn't a CORS error (otherwise it would have happened to all users). Check if there are any exceptions in Radzen's output window - for example database connection issues etc.

I have added the error text to the message above.
We tested the database connection with Data Infer successfully.

Check Radzen's output window please. There is probably an exception. Other than that your application should contain code that allows CORS:

 services.AddCors(options =>
      {
          options.AddPolicy(
              "AllowAny",
              x =>
              {
                  x.AllowAnyHeader()
                  .AllowAnyMethod()
                  .SetIsOriginAllowed(isOriginAllowed: _ => true)
                  .AllowCredentials();
              });
      });

In application is this code and output window show only port for api, port for application and compiled successfully.

In that case I am not sure what is causing this problem on that particular machine. It could be a browser plugin or setting. You can try with different browsers. You can also try debugging the application. There is a chance some exception is being thrown.

We found that some software for integrated graphics card from Intel Graphics Command Center blocked port 5000.