Visual Studio ASP.NET MVC project: setting the start URL

asp.net MvcVisual StudioVisual Studio-2010Cassini

asp.net Mvc Problem Overview


Consider an ASP.NET MVC 2 project with VS 2010. The goal is to set the 'start URL' on run/debug using VS's built-in Cassini web server.

Entering the URL as I want to be loaded, in the typical & valid format, controller/action, VS 2010 gives this exception.

alt text

Tried Remedies:

  • starting the URL with and without a slash
  • ending the URL with and without a slash

Question: How can you specify the start URL for an MVC 2 project?

Technologies:

  • Visual Studio 2010
  • ASP.NET MVC 2

Resolution: I was using the wrong field in the startup options. What was needed was the "Specific Page" field with the relative URL, and not Start URL.

asp.net Mvc Solutions


Solution 1 - asp.net Mvc

Start URL has to be a fully qualified URL and is not really used that often. It's meant for testing web services by opening a page that will call into the service, but isn't part of the application itself.

If you're just looking to start on a certain page of your application, which it sounds like you want, then use the "Specific Page" field, and enter your relative URL.

Here's the doc page on project start options.

Solution 2 - asp.net Mvc

Use Start Page \ Specific Page -- NOT START URL -- and specify your URL without a slash.

That oughta do it for you.

Solution 3 - asp.net Mvc

I was looking for a similar solution for VS2015. If anyone is reading this and you just want to run/debug via Visual Studio 2015 without having to attach to process and you're happy to run through Local IIS instead of Cassini or IIS Express, you can set a config like this:

enter image description here

Solution 4 - asp.net Mvc

I have just removed the files with .user extension in my web project and the solution map and the problem is solved now. Try to close your solution in Visual Studio and take a backup of files you "remove"first.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionp.campbellView Question on Stackoverflow
Solution 1 - asp.net MvcwompView Answer on Stackoverflow
Solution 2 - asp.net MvcchakritView Answer on Stackoverflow
Solution 3 - asp.net MvcChris HalcrowView Answer on Stackoverflow
Solution 4 - asp.net MvcBaraView Answer on Stackoverflow