在ASP.NET MVC visual studio开发服务器中设置启动路径

时间:2022-05-07 02:02:00

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.

因此,当我尝试从visual studio进行调试时,我得到一个HttpException:传入的请求与任何路由都不匹配。

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

然后我必须手动将{controller}。{extension}部分附加到地址栏中的localhost URL。

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

when I run it under visual studio on local machine.

当我在本地机器上的visual studio下运行时。

1 个解决方案

#1


8  

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

您是否在谈论在Visual Studio中按F5时设置默认URL?如果是这样,这应该做的伎俩:

  1. Right click on your web project and select Properties.
  2. 右键单击您的Web项目,然后选择“属性”。

  3. On the Web tab, under Start Action, select Specific page
  4. 在“Web”选项卡上的“开始操作”下,选择“特定页面”

  5. Enter mycontroller.ext in the textbox
  6. 在文本框中输入mycontroller.ext

Hit F5.

#1


8  

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

您是否在谈论在Visual Studio中按F5时设置默认URL?如果是这样,这应该做的伎俩:

  1. Right click on your web project and select Properties.
  2. 右键单击您的Web项目,然后选择“属性”。

  3. On the Web tab, under Start Action, select Specific page
  4. 在“Web”选项卡上的“开始操作”下,选择“特定页面”

  5. Enter mycontroller.ext in the textbox
  6. 在文本框中输入mycontroller.ext

Hit F5.