I\'m deploying a asp.net core 2.0 website to IIS 10.
I\'ve made sure that my app is using the correct configuration for ISS in the program.settings file.
<
I had this issue - simple workaround, actually install the NuGet package (I wasn't using it).
Microsoft.AspNetCore.Antiforgery
Published, deployed - fixed the issue.
In another case, when I published the project, a lot of the dlls weren't being placed in the publish folder - including Antiforgery. The below appears to force publishing to add all the required dlls.
Edit your projectname.json file to ensure PropertyGroup contains PublishWithAspNetCoreTargetManifest = false:
netcoreapp2.0
false
Interested to know why the above works?!