开发者

Compact Framework: Unit tests won't hit breakpoints

I'm using VS2008 and building a WinForms mobile application targetting the Compact Framework 3.5 and Pocket PC 5. I'm using the VS unit test functionality and the tests run OK but won't stop at breakpoints. I keep getting the dreaded "breakpoint will not currently be hit, no symbols have been loaded for this document" message. The solution also includes a server-side WCF service and the tests for that work fine.

I've searched the开发者_StackOverflow中文版 net and tried every suggestion I can find. About the only thing I've found that seems a little odd is that inside Configuration Manager I'm unable to check the Deploy box for the mobile unit tests project. I don't know if this is a problem or not.

Help!!

Cheers

Mark

PS - It would be nice to actually write code instead of spending most of my time trying to get all these bloody bug-ridden tools and frameworks working :(

UPDATE: I've just found this page which apparently explains how to fix the problem: http://msdn.microsoft.com/en-us/library/bb513875.aspx

There's 2 problems with this:

  1. It's a f***ing joke! Hey Microsoft - how about building ALL the basic functionality required before claiming that we can unit test in the CF! Who wants to spend 10 minutes setting one breakpoint?

  2. It doesn't work. When I try to attach the debugger I get "Unable to attach to the process. Attach is not enabled for this process with this debug type". I give up.


Correct, you cannot set break points in CF unit tests (well you can set them, but it will never break). I'm a little surprised that the MSDN workaround didn't actually work, but it's still worthless because the turnaround time from when you want to debug to when you're at a break point is absolutely ridiculous and untenable.

I have created a workaround which is basically my own test runner, so you don't use the Studio test host. It works well and is published with one of my open source projects. Details can be found in this blog entry.


Clean the solution and do a rebuild (note: not a simple build) of the project. Especially the latter has worked wonders for me, since I've been in the very same situation as yours, and it solved the problem.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜