4

Using Visual Studio 2012 Express on Windows 7, From MVC 4 internet application template I created a new project, then used the simple membership and tested successfuly the authentication.

Then to try the simplest deployment way, as first step I tried the application on localhost, following the next steps:

  • published the project using File System publish method,
  • targeted a new folder: "C:\inetpub\wwwroot\MyApp",
  • copied App_Data folder into "C:\inetpub\wwwroot\MyApp",
  • allowed to IIS_IUSRS read permission on folder "MyApp".

As database is an SQL CE type, I think that there is nothing to change in the web.config connectionStrings section.

Publishing went great untill the final step: browser loading, I got the next error:

Not Found

HTTP Error 404. The requested resource is not found. - with Error code: 0x80070002

I failed to find an answer to this issue on google in a limited time, Please advise what could be done ?

Mathew Thompson
  • 55,877
  • 15
  • 127
  • 148
Sami-L
  • 5,553
  • 18
  • 59
  • 87
  • You added the site to IIS yeah? Did you also add the URL you added to IIS to your hosts file? – Mathew Thompson Nov 22 '12 at 22:03
  • As I use Visual studio Express 2012, it has its own IIS Express, I wanted first to try loading the site using IIS Express on localhost, then when it succeed, I'll pass to the next step: publishing on windows 7 IIS. Please correct me if my approach is wrong. – Sami-L Nov 22 '12 at 22:24
  • If you're using IIS Express, what URL is set up in the project properties? – Mathew Thompson Nov 22 '12 at 22:26
  • Do you mean: Project -> Properties -> Web (Tab) -> Servers (section) -> Project Url ? it contains: **htpp://localhost:2786/** – Sami-L Nov 22 '12 at 23:22
  • @mattytommo, you're right to search in the URL direction, In the publish properties of the project, I changed **the destination URL** and the **Target location** name (alias here: MyApp) which was **containing space character**, then I got no more 404 error, but this time I got HTTP 403.14 - Forbidden, which means no default document is specified for the application, now I wonder why routing to the default document is not the same after publish. Please make an answer below in order to make this post answered. – Sami-L Nov 23 '12 at 10:05
  • Would add an answer, but it's closed. But if you are using IIS and the HOST entry you defined had a typo, you'll confront this problem. For example, if the bindings in IIS for your site is `www.123.com` and your _actual_ domain is `www.1234.com` this is the error you will face. – Kirk Woll May 23 '18 at 02:58

1 Answers1

4

As stated in my comments, make sure your URL is correctly formatted in the Project Properties. Also, make sure you set up a default startup page (if you don't have an Index action in the Home Controller).

Mathew Thompson
  • 55,877
  • 15
  • 127
  • 148
  • Sorry, vote up requires 15 reputation, [please try to help me on this](http://stackoverflow.com/questions/13527498/asp-net-mvc-4-how-to-keep-routing-to-default-document-after-project-publishing) – Sami-L Nov 23 '12 at 10:50