52

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.

p.campbell
  • 91,713
  • 61
  • 243
  • 314
  • For `Cassini` did you mean the ASP.NET standalone dev server or the open-source Cassini web server sample or the server that someone developed off of Cassini? – chakrit Dec 30 '09 at 19:56

4 Answers4

37

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.

womp
  • 111,854
  • 24
  • 229
  • 262
33

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

That oughta do it for you.

Brad Larson
  • 168,330
  • 45
  • 388
  • 563
chakrit
  • 57,172
  • 24
  • 125
  • 160
  • an image src attribute linked in this answer is prompting a 403 and causing Firefox to ask for credentials. The URL is "http://chakrit.net/files/stackoverflow/so%5Fmvc%5Fstart%5Furl.png" – Paul Smith Feb 19 '13 at 22:38
  • Sorry, there were some accident and I have lost the original file. – chakrit Feb 20 '13 at 04:33
  • If someone has a copy or can make a new screenshot (it's just the project property page with an arrow pointed to the "start url" thing) I can find host it at a more suitable place and update the answer. – chakrit Feb 20 '13 at 04:34
  • 1
    Perfect thanks @chakrit. (just to clarify to others, you can put MyArea/MyController without specifying the server name and without http :// localhost:port, which is very helpful). So for me 'Start Action' is set to 'MyArea/MyController' and under Servers i selected 'Use Visual Studio Development Server' and 'Auto-assign Port' – Spyder Apr 18 '16 at 14:38
9

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

Chris Halcrow
  • 21,541
  • 11
  • 115
  • 145
0

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.

Bara
  • 31
  • 3