0

I am using Asp.Net Standard version 4.7 with MVC and attempting to deploy to IIS Express. I am facing several issues in the configuration and cant seem to find straight forward documentation for asp.Net standard. I added a website named localHost aside from Default Website in IIS. I am facing 2 issues. When I click browse from IIS, it navigates http://localhost/Views/Home/Index.cshtml I get a 404 error.

Server Error in '/' Application. The resource cannot be found

When Debugging From Visual studio 2019 I get

Process with Id of xxxx cant be found . Description: HTTP 404.

I am thinking there some port configuration issue but I am unclear on how to configure.

I attached screenshots of my configuration settings.

enter image description here

enter image description here

enter image description here

4
  • 1
    Are you trying to run it on IIS or IIS Express? They're different applications Commented Jun 6, 2020 at 19:43
  • Right now I am trying with IIS Express though I wouldn't mind a pointer or documentation referral for IIS Commented Jun 7, 2020 at 2:14
  • Looks like this was the problem. I changed my debugger to Local IIS and its working Commented Jun 7, 2020 at 3:09
  • Second question. When you set up your site on IIS manager alongside the default site did you add "localhost" as the host name in the site binding - see image 6 in Jalpa Panchal's answer below. If you didn't then localhost will still point to the default website, and you'll find the "Welcome to IIS" landing page at root level rather than your application's home page. Commented Jun 7, 2020 at 12:21

3 Answers 3

2

Please follow Microsoft guideline.

You are trying to access wrong Url. Try below url to access:

http://localhost:8080/Home/Index
Sign up to request clarification or add additional context in comments.

1 Comment

That guideline is for a sql server database, and localhost:8080/Home/Index doesnt work (site cant be reached), it is also not the address navigated to when I click browse.
1

To host the site .net application you need to publish it and use that publish folder as site folder path in iis.

1)open visual studio, select your project.

2)right-click on your project and choose publish:

enter image description here

3)in publish target select folder and create a new folder in c or another drive where can you access the folder.

enter image description here

4)click on the publish

enter image description here

5)open iis and create a new site

enter image description here

6)choose the folder path and site binding

enter image description here

7)browser your site.

Note:

Assign iis_iusrs and iusr full permission to the site folder. you need to set the physical path credential with your Gmail account.

enter image description here

2 Comments

Thats exactly what I did and I get an error, resource can't be found.
@Curious-programmer from your screenshot it look like that you configured visual studio project path with iis site. but as a correct way you need to configure the publish folder path in iis site.
0

Maybe you are misunderstand MVC, you should visit a restful path in mvc instead of cshtml, just like this: http://localhost:8080/Home/Index -> to find /Views/Home/Index.cshtml in you solution.

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.