Those 2 particular pages are "Razor" pages (.cshtml extension), whereas most of the other pages are non-Razor pages (.aspx extension). The "Extensions" page in the control panel is also a Razor page, and so I would imagine you get the same error there
It's probably caused by a configuration issue, maybe at the web host. Do you have these 6 DLLs in your BIN directory?
Microsoft.Web.Insfrastructure.dll, System.Web.Helpers.dll, System.Web.Razor.dll, System.Web.WebPages.Deployment.dll, System.Web.WebPages.dll, System.Web.WebPages.Razor.dll
You could try searching the Discussions here as I think there have been some others who have run into this problem with the Razor pages. There might be more than one solution. Here's a search link you can use: