Hi,
This error could come when the IIS server isnt configured properly.
Hence, go to virtual directory's Properties tab and check the version of ASP.NET that you are using.
You can also try to re-register the IIS server. For this, Open VisualStudioCommandPrompt and type
aspnet_regiis - i
and Enter.
Please reply incase this doesnt work.
Regards,
Praneet