Debugging Visual Studio and Adobe Flash together
Most of my applications are a combination of VB.NET and Adobe Flash, such that the VB application is displaying a Flash file inside the main form (using Adobe's COM object). The VB application is communicating with the Flash file via the ActionScript ExternalInterface and FSCommands (using XML strings).
I'm having a hard time debugging the applications, since when an error occurs withing the Flash file (due to a bug in the ActionScript code) I'm getting a non-informative exception.
What I'd like to do is t开发者_StackOverflow社区o debug both codes at once. At the very least I'd like to see the runtime error output as it is shown when I'm working with Adobe Flash. At the best scenario, I'd like to be able to hook my VB.NET code with the Actionscript code such that I can use breakpoints in both.
How can this be done?
Edit: Environment: I'm using Visual Studio 2008 and Adobe Flash CS4.
The Amethyst Visual Studio debugger can debug across .NET and Flash or Flex projects. There are several relevant tutorials here: http://www.sapphiresteel.com/Tutorials/Amethyst-Tutorials/article/amethyst-tutorials-index
Here is one that shows .NET to Flex but you can also debug ASP web sites etc.
http://www.youtube.com/watch?v=qhlzeu277yc
best wishes
Huw
I am unsure how the debugging works for the flash player. Presumably attaching devenv.exe and whatever the flash debugger did not work? Was the second attach prevented? Or did it happen but then functionality failed/
Two debuggers working on a single win32 process is problematic. Here are a few possibilties why it might fail:
- the flash debugger might be attaching as a win32 native debugger. If so only one can be attached at a time.
- actionscript might rely on in process execution. If so when VS is debugging the code it will stop the physical Win32 threads when at a breakpoint preventing the other debugger from operating. (this is a bunch of speculation on how the flash debugger works)
If either of the above is what is happening you could try WinDbg which has a 'non-invasive' attach option, leaving the flash debugger the opportunity to attach as the win32 native debugger. In that mode you might be able to get both debuggers attached. However you will still have issues preventing them form getting in each others way ... that said a broken , limping, tool is sometimes better than nothing.
Good luck.
精彩评论