开发者

Set start route in ASP.NET MVC visual studio development server

开发者 https://www.devze.com 2023-03-08 05:01 出处:网络
My route is configured to require a certain extension. Because of this I get an HttpException when I try to debug from visual studio: The incoming request does not match any route.

My route is configured to require a certain extension.

Because of this I get an HttpException when I try to debug from visual studio: The incoming request does not match any route.

I then have to manualy append the {controller}.{extension} section to the localhost URL in the address bar.

I've tried playing around with the project settings but haven't managed to get it working.

So, to clarify, I would like my project to go directly to

http://localhost:1440/mycontroller.ext

开发者_StackOverflow中文版when I run it under visual studio on local machine.


Are you talking about setting the default URL for when you hit F5 in Visual Studio? If so this should do the trick:

  1. Right click on your web project and select Properties.
  2. On the Web tab, under Start Action, select Specific page
  3. Enter mycontroller.ext in the textbox

Hit F5.

0

精彩评论

暂无评论...
验证码 换一张
取 消