InvalidOperationException: Endpoint / (/) contains anti-forgery metadata, but a middleware was not found that supports anti-forgery. Configure your application startup by adding app.UseAntiforgery() in the application startup code.

ykl
ykl
Member
116 Points
5 Posts

Getting following error - Migrating blazor server to .net 8 with blazor app:

InvalidOperationException: Endpoint / (/) contains anti-forgery metadata, but a middleware was not found that supports anti-forgery. Configure your application startup by adding app.UseAntiforgery() in the application startup code.
Views: 297
Total Answered: 1
Total Marked As Answer: 1
Posted On: 03-Jan-2024 05:22

Share:   fb twitter linkedin
Answers
ykl
ykl
Member
116 Points
5 Posts
         

It was resolved by adding following middleware in startup.cs

app.UseAntiforgery()
Posted On: 03-Jan-2024 09:51
Thanks for sharing solution.
 - Brian  03-Jan-2024 09:52
 Log In to Chat