I am supposed to find a bug in Lightswitch C# application written in VS2012 which causes application to hung when delete button is clicked. I am new to LS and have problem figuring out how to find the internal code is executed when that button is selected. Even when I try to override action of this button debugger doesn't stop there. Debugging just my code is turned off, on screen data binding I see some name I cannot find in the code. Anybody here has some experience with lightswitch to point me to right direction? thanks
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Lightswitch HTML uses JavaScript for the code behind, not C#. An example of a typical LS delete command:
screen.Items.deleteSelected();
Debugging can be a bitch at times, often i find i have to place breakpoints AFTER running the application. Alternatively, you could use a crude debugging method and insert a bunch of alert() methods in the JavaScript. It's not pretty, but it's effective.
Note: The delete code could be calling a WebAPI web service, or running SQL against a database. In both these scenarios you will need to separately debug these.