Server Error in '/' Application. in mvc - asp.net-mvc

In MVC application Host the IIS Server. It's showing folders I clicked views folder show the below error.
Server Error in '/' Application. The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its
dependencies) could have been removed, had its name changed, or is
temporarily unavailable. Please review the following URL and make sure
that it is spelled correctly.
Requested URL: /PMS/Views/
Version Information: Microsoft .NET Framework Version:4.0.30319;
ASP.NET Version:4.0.30319.17929

I'm not sure if it's relevant to yourself but I only get this error when I try to start the application on a page which requires a value to start.
For example you have a garage page that requires a garageId to set values/ show details. Because there is no value being passed to the page, that page cannot be found.

Related

i want to transfer my ASP.NET MVC project to another server

I want to transfer my ASP.NET MVC project to another server(obvious with different IP address). I transfer the published code there and also map with the same link through IIS (and stop that site from previous server). And also change the connection string with updated database details.
I get this error:
Not Found
HTTP Error 404. The requested resource is not found.
Kindly help.
First of all, you need to figure out whether the request is sending the request to the right server. So please ensure the domain is pointing to the correct IP. Please ensure accessing the website via IP and domain name are getting same response.
If you are sure the request is reaching the right server, then you should see the 404 error in Server IIS log. Please enable failed request tracing and IIS detailed error to find the sub-status code and exception code.
If you see the 404 is returned from static file handler. Then please ensure IIS asp.net extension has been installed so that extensionless handler would help handle the MVC route URL.
If you have already installed asp.net extension. Please post more details and we may find the root cause.

Server Error in '/' Application.The resource cannot be found while hitting RedirectResult("~/Views/Shared/Error.cshtml")

I am trying to handle a button event and redirect the application to a specific page (http://localhost:51443/Views/Shared/Error.cshtml), but while executing the line RedirectResult("~/Views/Shared/Error.cshtml") I am getting the exception as
Error from the application:
Server Error in '/' Application.
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Requested URL: /Views/Shared/Error.cshtml
While browsing the page I am getting the same exception. Can anyone advise how to handle this redirection error, previously in aspx using HttpResponse I would be able to redirect without any issue.
Right click on your project name and add a html page. Copy paste your codes from Error.cshtml to the new html page. Redirect to that new html page instead.

HTTP 404 error while trying to debug MVC 2 application page

Tried creating a default MVC 2 application using the visual studio template and while setting up start page and browsing the application getting the http 404 (Resource not found error), have checked the controller classes for the naming conventions and also the option to set specific page in the project properties.
Kindly advice for any options to try out and also as I am new to MVC, so any help is highly appreciated.
Error Message
HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Hi, I am using the basic web template of Asp.Net MVC 2 Web Application template available in Visual Studio 2010 and have set up the start page.
Below the brief description of the error
Server Error in '/' Application.
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Requested URL: /Views/Account/LogOn.aspx
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1022
Do let me know if any additional information is required.
Regards
Arvind
Move:
/Views/Account/LogOn.aspx
To:
/LogOn.aspx
MVC uses routing to get to the Views folder. If you want to use legacy aspx HTTP handlers move it to the root folder.
I had the same problem, and I fixed it by this way:
In a first time, you have to check if your project configuration is correct:
Right click on the project properties, check if everything is ok.
Next, remove the file applicationhost.config. Visual Studio will re-create it automatically. You should find it in the folder "path_project/.vs/config" in the same folder of your project.

Issue hosting ASP.NET MVC 4 application using IIS 7.5 after creating virtual directory - Script files are not working

I have an ASP.NET MVC 4 application that I am trying to host in IIS 7.5. I tried creating a virtual directory using "Use Local IIS Web server" option in Project properties and have set the Anonymous Authentication and Windows Authentication set in IIS.
When I run the application, it opens in the browser with the url, "http://localhost\ApplicationName" and I am able to view only the tab names I have created. When I right click and view the page source, I have my scripts listed and the body defined with divs and tables. When I click the tab names, nothing happens.
In the view page source, when I click any script, it throws an error,
HTTP Error 404.0 - Not Found
The resource you are looking for has been removed, had its name changed, or is temporarily unavailable.
Detailed Error Information
Module IIS Web Core
Notification MapRequestHandler
Handler StaticFile
Error Code 0x80070002
Requested URL http://localhost:80/Scripts/Script.js
Physical Path C:\inetpub\wwwroot\Scripts\Script.js
Logon Method Anonymous
Logon User Anonymous
In IIS, I have enabled Anonymous, ASP.NET Impersonation and Windows Authentication.
Also, When I look at the Advanced settings for the directory, it shows the physical path in C\Users........ but in the Detailed Description, it shows the Physical Path as "C:\inetpub\wwwroot\Scripts\Script.js".
Am I giving the path wrong? or should I place the project files in "C:\inetpub\wwwroot\Scripts\Script.js"?
Please help. I have been struggling with this for a while now and it's driving me crazy.
Are you using URL Bundles or are you manually hard coding .JS paths in your front-end code? Are you seeing good/expected behavior when you run the site in debug mode within Visual Studio? I would try and gather some hints with those considerations and perhaps furnish some more information...

I am not able to run Asp.Net MVC 2 Application

I am trying an sample application in Asp.Net MVC 2 Application
given in http://www.codeproject.com/KB/aspnet/aspnet_mvc_tutorial.aspx
But i am getting the error as below
Server Error in '/' Application.
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Requested URL: /Views/PersonalInformation/Index.aspx
Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053
Please let mw know wat is the problem
The problem is the requested url. In an ASP.NET MVC application, the url corresponds to a controller action instead of the aspx page. See this link for an explanation: http://www.asp.net/LEARN/mvc/tutorial-02-cs.aspx.
The url should be something like http://localhost:xxxx/PersonalInformation (where xxxx is your port number)
To avoid getting this error everytime you start up your website through Visual Studio. Go to the properties of your web project and under the Web tab there is a property called Start URL. Change this to http://localhost:xxxx/ or something that is a valid MVC route.
Are you deploying to Cassini or IIS 6. Take a look at these articles
http://guyellisrocks.com/coding/deployed-asp-net-mvc-app-gives-404-on-about-page/
http://www.techdreams.org/microsoft/aspnet/how-to-fix-404-errors-of-aspnet-mvc-website-deployed-on-iis-6-windows-server-2003/2572-20090515
MVC runs fine in Cassini but requires some config modifications to run in IIS. I am still evaluating it in Cassini so i havent crossed that bridge yet but this info should help.

Resources