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,
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
reply sent via email.
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
https://myapp-server.azurewebsites.net//AbpUserConfiguration/GetAll?d=1616355221806
Try removing / in your cors origin configuration.
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image)
-
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.
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Removing "appsettings.Staging.json" and "appsettings.Development.json" from the server, and making "aspsettings.Production.json" the same as "aspsettings.json" fixed the issue.
Submitted ticket #10212 to suggest a long-term solution.
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
'Publish' copies all appsettings.json files to wwwroot. If "CorsOrigins" is not identical for
appsettings.Development.jsonandappsettings.Production.jsonandappsettings.json, the CORS error occurs. It appears thatappsettings.Development.jsonis still being referenced from somewhere.Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
project files emailed to [email protected]
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
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.
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
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).
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Hi @timmackey
Thanks, we got the project now and will check it.
Thanks,
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image) -
0
Wondering if any progress has been made in determining a solution?
Markdown is supportedCopy & paste or drag & drop images (max 30 MB per image)
