mygeneration调试方法(转http://www.mygenerationsoftware.com/phpBB3/viewtopic.php?f=4&t=3176)

本文介绍了一种在Visual Studio 2005中调试模板的方法。通过在模板的Render方法中加入特定代码并执行两次模板,可以解决调试过程中源代码缺失的问题。此方法虽为临时解决方案,但仍希望能帮助遇到类似问题的开发者。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

原文:

I got this working. The trick (as I found in another post) was to hit Continue andleave the debugger running and then execute the template again. This got me source and the ability to find the erring line. So here is what I did:

1) Add \"<%#DEBUG%><%\" (minus the quotes) to the first line + System.Diagnostics.Debugger.Launch(); to the Render() method.

2) Execute the template. Chose VS2005 as debugger. It comes up without source (disassembly only). Hit F5 to continue.

3) Switch back to MyGeneration and Execute the template again. This time the debugger has source.

So it is a workable workaround, but does anyone know if there are plans to fix this issue in the near future?

Lars

 

分为以下步骤:

1.在模板方法Render() 中加入System.Diagnostics.Debugger.Launch();

2.执行模板一次,会调用vs进行调试.注意这时并不会带原码.

3.再执行模板一次.则会进入代码调试阶段.

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值