Why can't I debug this very simple ASP.NET MVC3 application? - asp.net-mvc-3

I decided to follow this tutorial on getting started with ASP.NET. I have Visual Web Developer 2010 Express (with SP1) installed, as well as the ASP.NET MVC3 tools.
I created the project and starting debugging it by going to Debug->Start Debugging - which then opened my browser to http://localhost:50531 and displayed:
According to the tutorial, that's not what I'm supposed to see.
Additional details:
OS: Windows Vista Home Premium 32-bit (with SP2)
I also have IIS 7.0 installed and running.

Did you use the presets or an empty project? If the latter, you don't have any controllers or views, thus the routing doesn't match anything, resulting in an error.

Related

Unable to start debugging on the web server after installing SharePoint

Visual studio 2010 was debugging fine on Win 7 , 64-bit machine. after installing sharepoint foundation 2010. SP site r working fine. but mvc, aspnet projects showing follwoing error
Unable to start debugging on the web server. the web server cound lnot find the requested resource.
thanks,
When SharePoint is installed the default web site in IIS is replaced by the SharePoint default site. Create a whole new website (and also an application pool preferrably) for yourself in IIS and deploy your code there and try debugging it. It should work.
From my past experience you cannot use an MVC template on a sharepoint environment (i.e. sharepoint iis site)
There are a few add-ons and customizations you can do, but their quite tedious.

How to Deploy and Configure an MVC3 application using IIS6

I have created an application installer for my MVC3 project and have followed the BIN Deployment suggestions found online.
My site has been installed but I don't get any pages displayed.
This is how the VS2010 installer project looks
and this is how I have IIS setup
How do you get the Home Index page to be the default page as it is when I run the application through Visual studio?
IIS 6.0 doesn't support extensionless urls out of the box. This means that if you try to navigate to /Home/Index, IIS 6.0 doesn't know that this is an ASP.NET application and nothing happens. Extensionless urls are supported out of the box starting from IIS 7.0 when running the application in managed pipeline mode.
You will need to associate the unmanaged aspnet_isapi.dll filter with ASP.NET if you want to achieve that. Phil Haack covered how this topic in his blog post (ASP.NET 4.0) and this post (for CLR 2.0, which is not your case since you are using ASP.NET MVC 3).

Hosting/Publishing MVC3 on IIS6

So to be specific, I'm using a windows server 2003 (that means iis 6). I've already installed ASP.NET MVC 3 RTM and .NET 4.
I've tried a few guides already.I've tried Haacked's guide too, then navigated to the root.
eg.
localhost/MyWebApp which showed Directory Listing denied (permission related problem probably not relevant to my actual problem).
Visiting another view, localhost/MyWebApp/Home.mvc/Index, showed 404 error page.
Is there anything I'm missing? I don't have any visual studio installed on the server but should I have used the Web Platform Installer instead?
Is your app working correctly when you deploy it from visual studio to local IIS?
The "Home.mvc" looks a little odd - with the default routes that would imply a controller named "Home.mvcController", which is not valid.
The other obvious thing to check is that "MyWebApp" is set up as a web application using a .NET 4 app pool rather than just being a directory.

Visual Studio 2010 nasty caching Cassini? Must manually stop service

I've spent waaaay too much time trying to figure this out. I'm running Windows 7 and Visual Studio 2010 in a VMware Fusion virtual.
When I debug my website project, Cassini (aka ASP.NET Web Development Server) starts and the site shows in my default browser (IE). I stop the debugger, make some tweaks to my C# code, and start the debugger again. The website starts up in IE and the site displays, but its using the code base from when I initially debugged NOT including any tweaks in code between the initial debug/build and subsequent debugs/builds.
The only way I can get code changes to build and run in the browser properly is if I manually stop the ASP.Net Web Development Server from the tray and then run debug.
Has anyone encountered this? Not sure if its caused by VS2010 or the environment being a virtual on a Mac.
Manually stopping Cassini after every debug is really starting to suck.
Thanks.
Check if Visual Studio is set to recompile the projects when there are changes.
Check that Tools > Options > Projects and solutions > Build and run > On run, when projects are out of date is set to Always build.
Perhaps you will have a more pleasant experience with IIS 7.5 Express as a replacement for Cassini.
From that page:
IIS Express is a lightweight,
self-contained version of IIS
optimized for developers. IIS Express
makes it easy to use the most current
version of IIS to develop and test
websites. It has all the core
capabilities of IIS 7 as well as
additional features designed to ease
-- website development including:
-- It doesn't run as a service or
require administrator user rights to
perform most tasks.
-- IIS Express works well with ASP.NET and PHP applications.
-- Multiple users of IIS Express can work independently on the same
computer.
Here's an article to help you get started.
Figured this out. I had mapped my Visual Studio 2010 folders to a VMware Fusion share in order to make my .NET projects accessible from Mac world (for copying graphics files into the projects, etc.). Evidently there was some type of permission issue or something that did not result in any sort of alert that was causing the problem.
I remapped all VS folders (Project, Website, etc.) into the standard Documents folder of my user instance and everything began working as expected.
Thanks for the help.

Visual studio web server iis6 or iis7?

When I run my asp.net mvc site in visual studio 2008 is it running iis7 or iis6 Internally?
Also does mvc require iis7 (is intended for?)
Via Visual Studio, you're not really running IIS6 or IIS7. You're running Cassini. You can find out how Cassini differs from IIS here. As for ASP.NET MVC, it may be deployed to run under IIS6 or IIS7. As mentioned previously, you have to jump through some hoops if you want to run under IIS6 so IIS7 is ideal if possible. If you are stuck with IIS6 (maybe you're on Windows Server 2003) there are a couple of best practices (Url file extensions or wild card application maps) which Phil Haack has well documented which will help to get your application running correctly.
If you mean the one built in to windows, that is tied to your OS version rather than to your version of Visual Studio.
If you mean the version that Visual Studio uses as a development webserver, then that version is not IIS. Its an internal webserver (very similar to Cassini) suited for testing and debugging only.
MVC can work in IIS6 but you need to make sure to set your routing to "{controller}.aspx/{action}/{id}".
As for IIS6 or 7 for the "IISLite" that VS uses, I am unsure of that. I think VS2008 uses IIS7 because I do not need to add ".aspx" to my controller in the route when debugging.

Resources