0

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!

4
  • 1
    Try using the web deploy publish method or publish to file system and copy all files. Commented Jun 12, 2017 at 12:36
  • c-sharpcorner.com/UploadFile/2b481f/… Commented Jun 12, 2017 at 12:37
  • In what way did they not work? Commented Jun 12, 2017 at 12:39
  • I have updated my question to show the results of a publish Commented Jun 12, 2017 at 21:48

2 Answers 2

1

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.

Sign up to request clarification or add additional context in comments.

2 Comments

Have you installed ASP.NET on the server?
I'm sure it has considering it runs other asp.net websites?
1

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!

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.