0

Hi I have done following steps while hosting my .net core web API in IIS of my laptop. But when I browse the URL I get 404 error.

Sample URL: http://localhost/Myapp/api/user

Help will be much appreciated! If need any further info let me know.

Steps:

  1. Install Install the .NET Core Hosting Bundle 2.2.5
  2. Hosted web api in IIS with defaul 80 port number without any hostname
  3. Created new application pool with No MANAGED CODE as .NET CLR Version.
4
  • did you publish your site? Commented Jun 5, 2019 at 9:27
  • double check that this is not a 500 error hiding behind an attempt to redirect to a an error page that doesn't exist hence the 404. Commented Jun 5, 2019 at 10:15
  • I don't have error page .. however what could be the reason of not getting output ... It's works fine in visual studio Commented Jun 5, 2019 at 11:02
  • Yes jalpa.. it had published on local host iis. . Commented Jun 5, 2019 at 11:03

1 Answer 1

1

To host .NET Core Web API in IIS follow below steps:

  • Publish the Web APIs to Your Local Folder enter image description here for example, D:\testcoreapi
  • Install Microsoft .NET Core Windows Server Hosting Bundle File ASP.NET Core Module Configuration Reference
  • Open IIS Create One Application Pool of No Managed Code enter image description here
  • Create Web Site to point to the local folder of your published.

Note: Do not forget to select an application pool which you created before with no managed setting. enter image description here

If you are still not able to browse the site select your site from connection node in iis. right click on site and select "Explore" and make sure that you select right folder.

enter image description here

For more detail you could follow the below article: https://jakeydocs.readthedocs.io/en/latest/publishing/iis.html

Regards, Jalpa

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

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.