Reputation:
I have Web API 2 C# project which runs fine through visual studio. I type URL to test like this:
http://localhost:51754/api/email/1
It shows me XML file. However when I publish and set up IIS I get
HTTP Error 403.14 - Forbidden.
I am new to this and my question is what kind of configuration I need to have it run on IIS. I am using .NET Framework Version 4.0 Integrated Application Pool to run it.
Upvotes: 0
Views: 1596
Reputation: 1038710
Probably ASP.NET is not registered within your IIS. Try running the following command from a DOS prompt with elevated user account:
C:\windows\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -ir
Obviously you might need to adapt the path to aspnet_regiis.exe
depending on your specific OS and version of the framework. Once you have registered ASP.NET 4.0 with IIS make sure that you restart it for changes to take effect:
iisreset
Upvotes: 1