简体   繁体   中英

Debugging a Native .dll in a Silverlight 5 application

I am writing a Silverlight application that takes advantage of the P/Invoke functionality added to Silverlight 5. I've written a native .dll that takes a bitmap from the managed code and uses a 3rd party library (OpenCV) to process it.

My .dll gets loaded correctly and works fine, but I am not able to hit any breakpoints I set anywhere in the Native code. Visual Studio says that the breakpoint will not be hit as there are no symbols loaded for the document. I tried copying the corresponding .pdb files to the path where the .dll is loaded from, but it didn't help. Additionally, the .dll doesn't show up in the Modules window when debugging, so I can't manually load the symbols that way.

Is there any other way to get the debugger to load the needed symbols?

When you start a SL5 app, VS starts a .NET debugger. This debugger is unable to debug native processes.

You could start another instance of Visual Studio, and use the "Attach to process" dialog under the debug menu, and attach the native debugger to the targeted process. Note that I am not sure that you can attach a Native and a .NET debugger at the same time on the same process.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM