aspnet / AspNetWebStack

ASP.NET MVC 5.x, Web API 2.x, and Web Pages 3.x (not ASP.NET Core)
Other
858 stars 354 forks source link

__RequestVerificationToken not inserted #194

Closed Joshlo closed 6 years ago

Joshlo commented 6 years ago

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

Joshlo commented 6 years ago

Ah sorry, it's a Core issue, so wrong repo