Base solution for your next web application
Open Closed

CORS problems #9311


User avatar
0
bruno93 created

Hello dear Support team,

After following your guide for deployment I came across to the following problem. " Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://localhost:44301/AbpUserConfiguration/GetAll?d=1594043721318. (Reason: CORS request did not succeed)." Application is on Azure. I tried this one: https://support.aspnetzero.com/QA/Questions/7570/CORS-Policy-issue-when-deployed-to-Azure But with no success.

I sent appconfigs in email to [email protected]

Best regards, Bruno


7 Answer(s)
  • User Avatar
    0
    bruno93 created

    The problem was that I put appconfig.production.json in the wrong folder.

  • User Avatar
    0
    orbyta created

    Hi @bruno93, we had the same issue. Where do you have to put, instead?Under site/wwwroot folder? Best regards

  • User Avatar
    0
    bruno93 created

    Hello @orbyta, under the site/wwwroot/assets

  • User Avatar
    0
    bruno93 created

    Unfortunately I'm having another problem related with CORS. If anyone know solution, please help me.

    Error in Chrome:

    Error in Firefox:

    I was trying to do: https://github.com/dotnet/aspnetcore/issues/4457#issuecomment-465669576 , but I can't get it. I can't include routes.MapHub**<General>**("/hubs/general"); . This is the part of Configure method:

    This is the part of ConfigureServices method:

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @bruno93

    1. Could you share the definition of General ?
    2. Could you also check logs of your published application to see if there are any related error messages ? It should be App_Data/Logs/Logs.txt file by default.
  • User Avatar
    0
    bruno93 created

    Hi @ismcagdas The problem is that I don't know what is General and for what is used for... That "General" class or whatever it is, is written by guy on this comment: https://github.com/dotnet/aspnetcore/issues/4457#issuecomment-465669576.

    I sent yesterday to info email logs file.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @bruno93

    Sorry, I think I didn't understand your problem with https://support.aspnetzero.com/QA/Questions/9311/CORS-problems#answer-58a98a5c-168e-1462-ba99-39f63bc68ca6. Your website doesn't throw CORS error in the login page, so the problem is related to something else I guess.

    Could you explain what you are trying to achieve with https://support.aspnetzero.com/QA/Questions/9311/CORS-problems#answer-58a98a5c-168e-1462-ba99-39f63bc68ca6 ?

    Thanks,