ANZ 8.1.0 angular/.net core
Occasionally my ANZ app works when Published.
I make a small change, and then I get the following message from the client site in the Chrome debug console:
Access to XMLHttpRequest at 'https://myapp-server.azurewebsites.net//AbpUserConfiguration/GetAll?d=1616355221806' from origin 'https://myapp-client.azurewebsites.net' 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.
The server app is able to display swagger login page. The error persists even after rolling back the change. What might be causing this? How can I diagnose the cause?
13 Answer(s)
-
0
Hi @timmackey
This problem might not be related to CORS. Could you check your server side log file to see if there are any related error messages for this problem ?
If not, could you share your app's URL with [email protected] ?
Thanks,
-
0
reply sent via email.
-
0
https://myapp-server.azurewebsites.net//AbpUserConfiguration/GetAll?d=1616355221806
Try removing / in your cors origin configuration.
-
0
-
0
Added the "Allow CORS: Access-Control-Allow-Origin" browser extension to continue development. NOT A PERMANENT SOLUTION.
Logging in as 'admin' produced a lot of warnings. Log file sent via email.
-
0
'Publish' copies all appsettings.json files to wwwroot. If "CorsOrigins" is not identical for
appsettings.Development.json
andappsettings.Production.json
andappsettings.json
, the CORS error occurs. It appears thatappsettings.Development.json
is still being referenced from somewhere. -
0
project files emailed to [email protected]
-
0
Hi @timmackey
If there are some missing values in appsettings.Production.json, some values in appsettings.Development.json might be used. So, you can make sure that both config files contains all the configuration keys.
If that doesn't solve the problem, probably your app is not published in Release mode.
-
0
The app is published in Release mode. (publish profile in project submitted via email) Please review appconfig...json files in project (submitted via email).
-
0
Hi @timmackey
Thanks, we got the project now and will check it.
Thanks,
-
0
Wondering if any progress has been made in determining a solution?