在ASP.NET网站项目中设置断点 [英] Set breakpoints in an ASP.NET Web Site Project

查看:275
本文介绍了在ASP.NET网站项目中设置断点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用网站站点项目,而不是Web 应用项目。因此,没有项目文件可生成并生成 .dll 库文件或 .pdb 调试器符号文件。

I'm working on a Web Site Project as opposed to a Web Application Project. As such, there is no project file to build and produce a .dll library file or .pdb debugger symbols file.

开箱即用,如果我创建一个全新的网站项目,尝试在任何地方设置一个断点,然后在调试器上运行,则会收到以下消息:

Right out of the box, if I create a brand new web site project, try to set a breakpoint anywhere, and run with the debugger on, I get the following message:


当前不会命中断点。没有为该文档加载任何符号。

The breakpoint will not currently be hit. No symbols have been loaded for this document.

我必须忽略一些简单的事情,因为必须有一种调试ASP.NET网站的方法。是吗?

I must be overlooking something simple, because there must be a way to debug an ASP.NET Web Site. Right?

复制步骤


  1. 打开Visual Studio(在2010年和2008年确认)

  2. 创建新网站项目

  3. 选择ASP.NET网站

  4. 将Load Event处理程序添加到Default.aspx.vb

  5. 使用调试器 F5
  6. 运行
  7. 提示您是否在web.config中具有< compilation debug = true /> (如果尚未安装),请选择是。

  8. 调试器符号将不会为该页面加载,因为它是动态编译的

  1. Open Visual Studio (confirmed in 2010 and 2008)
  2. Create New Web Site Project
  3. Select ASP.NET Web Site
  4. Add a Load Event handler to Default.aspx.vb
  5. Run with Debugger F5
  6. This will prompt you to have <compilation debug="true" /> in your web.config if you don't already, select yes.
  7. Debugger symbols will not be loaded for the page because it is compiled on the fly


推荐答案

您可能需要将断点实际放在方法中,因为您说的是在执行此行之前中断。在函数声明中,如何在该行之前中断?

You might need to actually put the breakpoint inside the method, as you're saying "break before this line is executed". On function declaration, how do you break before that line?

Protected Sub Page_Load(sender As Object, e as System.EventArgs)

   ' Some Page load task - try setting your break point here.

End Sub

这篇关于在ASP.NET网站项目中设置断点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆