I encountered an exception though when I tried to run it:
"The CORS protocol does not allow specifying a wildcard (any) origin and credentials at the same time. Configure the policy by listing individual origins if credentials needs to be supported"
This was caused by setting both "AllowAnyOrigin()" and "AllowCredentials()" when setting up the CORS policy. However, when I remove "AllowCredentials()" and run it, it says the page cannot be found.
Any suggestions on how to overcome this? Has this requirement come into play since you wrote this tutorial, if not how did it work for you?
Yes, you need to remove the AllowCredentials() to run the solution. After that build the solution and the first page will be Not found and you need to put /api/blogposts into the url for calling the get all method.
Hi Martin,
Thanks for the tutorial.
I encountered an exception though when I tried to run it:
"The CORS protocol does not allow specifying a wildcard (any) origin and credentials at the same time. Configure the policy by listing individual origins if credentials needs to be supported"
This was caused by setting both "AllowAnyOrigin()" and "AllowCredentials()" when setting up the CORS policy. However, when I remove "AllowCredentials()" and run it, it says the page cannot be found.
Any suggestions on how to overcome this? Has this requirement come into play since you wrote this tutorial, if not how did it work for you?
Any help would be greatly appreciated.
Thanks,
Gavin
Hi Gavin,
Yes, you need to remove the AllowCredentials() to run the solution. After that build the solution and the first page will be Not found and you need to put /api/blogposts into the url for calling the get all method.
Best regards,
Bogdan
Hi Bogdan,
Thanks for the help. I had realised my error but hadn't had a chance to come back and update my comment.
Thanks again for your help!
Gavin
Thanks for clarifying that, Bogdan!