I've successfully injected an arbitrary DLL into a foreign process. But this DLL seems that the injected DLL has errors. I can attach a second Visual Studio session to that process but Visual Studio doesn't show me any disassembly of the crash. Doesn't Visual Studio look for debug information on the crashed code in the same folder of that module ?
Related
I have a Visual Studio project that builds a plugin (.DLL file). To use the built plugin, I load it in a host.exe application. The trouble I'm having is that I don't know how to set up Visual Studio to debug the plugin (.DLL) whilst it is loaded and running inside the host.exe application. I want to be able to use breakpoints in my plugin code, and for those breakpoints to be hit when the plugin is loaded and running in the host.exe application.
I have tried (in Visual Studio) going to Project>Properties>Debugging, and setting the path to the host.exe application in the 'Command' field. Also in the debugging section I set the 'Attach' field to 'yes'. Then when I run the host.exe application, and then click 'start debugging' in Visual Studio, the debugger appears to successfully attach to the host.exe application. The problem is that when I then load my plugin (DLL) in the host.exe application, none of the breakpoints in my plugin code are being hit. It's as if Visual Studio thinks it's supposed to be debugging the host.exe application its self, rather than the plugin(DLL) that is loaded into the host.exe applications address space.
Can anyone tell me how to configure Visual Studio to debug the plugin (DLL) whilst it is running inside the host.exe application?
How do I debug an assembly that's being used by a Report Services report running through SQL Server 2008 R2 Reporting Services?
I'm trying to debug using VS2012
It looks like the reports were created in VS2008 (VS9)
The assembly is targeted to .NET 3.5
I'm developing on my own dev machine and want to debug on this
One of the expressions in my report calls a method in a custom .dll
I've built the dll in debug mode, and deployed it, plus the .pdb file, to the default location (in my case, C:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\PublicAssemblies)
I'm setting the breakpoint in VS2012 for the assembly code, which is contained in a distinct project
I run up the report in Firefox, then attach to the ReportingServicesService.exe process
I carry out some actions in the report that should trigger the code
The breakpoint isn't hit
Is there anything else I need to do to debug?
Got it. Here's what else I needed to do:
Open the report solution in VS2008
Open the custom assembly project in VS2012
Attach to process from VS2012, but attach to devenv.exe for the VS2008 instance
Click the report 'preview' tab in VS2008 - this runs the report, which is now hooked up to the VS2012 debugger :)
Here's some MSFT documentation on this (doesn't strictly relate to SQL Server 2008 R2):
http://msdn.microsoft.com/en-us/library/ms153693.aspx
i have a problem with a DLL.
i have created an DLL agent snmp extension with visual studio and for testing debug DLL i connect it to snmp service, but if open Debug->Module my DLL is not present in the list, so the breakpoint are not avaible.
Can anyone help me?
If you want to Debug your DLL you had to debug SNMP.EXE. for that Debug->Attach to process. Keep the pdb file close to the DLL.
I've written an event handler for sharepoint 2010 site using visual studio 2010 . I had attached a breakpoint to the code and followed the process which i had done in visual studio 2008.
It is to use the Attach to process option and select the w3wp option.
The event gets attached but the breakpoint is not firing.
I ve checked the site collection and checked the MAnage site settings to see if the event handler is enabled. It is enabled. I tried to disable and enable it again. Even now its not firing.
Also i tried to clean the build solution and re built it . The debugger is not firing.
Do post a reply
Thanks in advance
Baradhwaj.PC
Here are a few things to check:
Are you attached to the correct process?
Using appcmd.exe list wp on the server (IIS7+) can be a useful way to determine which process ID belongs to which App pool. If you attach to the wrong process ID, even if it is the right name, the breakpoint won't fire.
Are your PDB's installed with the .dll's?
When I use GAC-based deployments, I often use a PowerShell script to copy my PDB files into the GAC folder where the assembly lives, usually something like C:\WINDOWS\assembly\GAC_MSIL\MYLibrary\1.0.0.0_publickeytoken.
When using bin-based deployments, it is sufficient to ensure the pdb is also in the bin folder.
While debugging, check the "Modules" debug window.
Find your assembly to determine whether debug symbols were loaded. If they are not, read the reason why. Note that you may need to invoke your code at least once for the assembly to get loaded.
Sometimes, it might mention that the pdb version doesn't match the assembly. This might happen if you built and deployed without pushing out a new pdb, even if you made no changes to the code. If this occurs, just redeploy a freshly-built assembly and pdb.
Are the PDB files in the path in which you are debugging? Without the PDB files, I think Visual Studio will be unable to link your code to the breakpoints.
I have a project that is auto generated. This project is referenced by my web app in visual studio. When i step through the code in debug mode the code from this project gets stepped into. Is there a way I can skip this code in debug mode.
I can't use System.Diagnostics.DebuggerStepThroughAttribute since the code will get replaced every time my datasource changes.
Thanks,
i think you should remove pdb files of the project which you don't want to debug.
A program database (PDB) file holds debugging and project state information that allows incremental linking of a Debug configuration of your program.
similar question/answer : Can you debug a .NET app with ONLY the source code of one file?