When creating a new "ASP.NET Core Web Application" and using the "API" template, if you then wants to add Razor Pages, then you get a 400 badrequest error every time you want to post a form, due to __RequestVerificationToken input doesn't gets generated in the html.
I haven't been able to find any differences compared to creating an "ASP.NET Core Web Application" and selecting the "Razor pages" template.
I have compared all the default nugets and sdk packages and there are no differences.
I have also tried to copy the startup from the project using the "Razor pages" template to the one using "Api" but still no success.
I have attached the project where it doesn't work.
I used Visual Studio Pro 15.8.3 when creating it.
Hi,
When creating a new "ASP.NET Core Web Application" and using the "API" template, if you then wants to add Razor Pages, then you get a 400 badrequest error every time you want to post a form, due to __RequestVerificationToken input doesn't gets generated in the html.
I haven't been able to find any differences compared to creating an "ASP.NET Core Web Application" and selecting the "Razor pages" template.
I have compared all the default nugets and sdk packages and there are no differences.
I have also tried to copy the startup from the project using the "Razor pages" template to the one using "Api" but still no success.
I have attached the project where it doesn't work. I used Visual Studio Pro 15.8.3 when creating it.
RazorPages400Error.zip