Mark
Mark

Reputation: 4950

Learning .Net core 5 project

I am following this link:

https://github.com/psauthor/CoreApiFundamentals/tree/5.0

To learn a .net core 5 project structure. The project is simple and easy to follow. When I run by clicking on IIS Express it runs in the Browser and all I need to do is to add /api/values to the url and I get some data back. Now I am trying to create a web on IIS by creating new website in IIS Manager. I am assigning it some port and specifying a physical path to the net5.0 folder where all the dlls are. Which for me is: C:\solutionfolder\projectfolder\bin\Release\net5.0 But running it in the browser like this:

http://localhost:8085/api/values

gives me 404. so, is it possible to run that project the way I am trying?

Thanks

Update. I found this article: Deploy ASP.NET Core Web API on IIS

But even after that the URL:

localhost:8085/nameofcontroller

still gives me 404.

Upvotes: 0

Views: 85

Answers (1)

Fei Han
Fei Han

Reputation: 27793

If you deploy your ASP.NET Core API project to a folder from Visual Studio, the default folder location would be bin\Release\net5.0\publish\, like below.

enter image description here

To host it on IIS, you can try to select that website in IIS Manager and modify the site's physical path to C:\solutionfolder\projectfolder\bin\Release\net5.0\publish.

enter image description here

Upvotes: 1

Related Questions