Tiaan
Tiaan

Reputation: 699

Installing an ASP.NET web API on IIS

I have built my first ASP.NET web API in MVC, when I debug the application from Visual Studio everything works perfectly.

Now I need to get these API's on my server...

I have tried copying the project files to the website root which usually works for normal MVC apps with views, and I have also built the project and copies the file full of DLL's and an exe to the IIS root.

Obviously, neither of these worked, anyone know what I am missing? Perhaps something I have to do with IIS?

I have now tried "publishing" the project and when I try to access the site this happens...Internal server error

Thanks in advance!

Upvotes: 0

Views: 1470

Answers (2)

Mitchel Sellers
Mitchel Sellers

Reputation: 63136

When you publish and get an error such as this it is often related to a configuration issue, or other non-supported .NET Runtime issue.

For best results, if you can get to the Event Viewer for the server a detailed error should appear there outlining the root cause of the issue.

If you don't have access to the server directly, updating the <system.webServer> section with the below should get you a detailed error.

<httpErrors errorMode="Detailed" />

Just please note DO NOT LEAVE THAT LINE IN PRODUCTION!

Upvotes: 1

JKMburu
JKMburu

Reputation: 37

Build the application then publish it. Copy the published files to a favorite IIS folder. Ensure you select the right version of ASP.NET in the server for your application in the application pool.

Upvotes: 1

Related Questions