在ASP.NET MVC中调试当前页面 [英] Debug current page in ASP.NET MVC
问题描述
我在VS2012中有一个MVC4项目.
I have a MVC4 project in VS2012.
如何在浏览器中的VS中调试当前打开的页面?当我在项目属性中选择当前页面"时,将始终打开带有Views文件夹的路径.该路径应没有Views文件夹.
How can i debug the current open page in VS in the browser? When i select "current page" in project properties always the path with the Views folder is opened. The path should be without the Views folder.
当我选择特定页面"并将文本框保留为空白时,始终会打开根目录.
When i select "specific page" and leave the textbox blank always the root directory is opened.
推荐答案
如果您使用的是MVC框架,则最有可能使用路由系统. 要指定起始页面,您需要为项目提供要打开的路径,而不是视图名称(并且选择当前页面"不起作用,因为Visual Studio不知道可以使用哪种路线来显示视图).上).
If you are using the MVC framework you are most likely using the routing system. To specify your starting page you need to give your project the path you want to open and not the view name (and selecting "current page" doesn't work because Visual Studio has no idea what route can be used to display the view your are on).
您需要在项目选项(在"Web"选项卡下)中手动将Specific Page
设置为要使用的路径(假设您要调用home
路径,然后用home
).
You need to manually set the Specific Page
in your project option (under the Web tab) to the path you want to use (let's say you want to call your home
path, then just fill up the field with home
).
这篇关于在ASP.NET MVC中调试当前页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!