Developer forum

Forum » Dynamicweb 9.0 Upgrade issues » Debugging assembly code

Debugging assembly code

Gheorghe Balan
Reply

Hi 

I am writing in regards to a general challenge in Dynamicweb.

I cannot attach breakpoints to my assembly code - which makes it quite difficult to solve complex tasks, such as a complex integration.

Is it possible to attach and hit a breakpoint to a C# method written in a custom assembly, and if yes how ?

 

Br

Gheorghe


Replies

 
Nicolai Pedersen
Reply

In a custom solution, you can debug like in any other .net application. Dynamicweb is no different than any other .net assembly you code against...

You can also debug our code by adding debugging symbols to your solution: https://doc.dynamicweb.com/downloads/other-downloads/developer/debugging-symbols

Or by using the debugging symbols feed from MyGet.

So, how do you do it, what happens that should not?

BR Nicolai

 
Gheorghe Balan
Reply

Hi

Thank you for the reply, I was unaware of the debugging symbols. 

Basically I simply tried to attach a debugger to the IIS Application where my assemblies were running. 

I just did not have the option to attach the debugger since I cannot see the process. 

Is this something that would be fixed by the symbols ?

 

Br

Gheorghe

 
Morten Bengtson Dynamicweb Employee
Morten Bengtson
Reply

Try this...

  1. Start Visual Studio by selecting "Run as administrator..."
  2. Open your project.
  3. Make a debug build and make sure that you copy the assembly (.dll) AND symbols (.pdb) to the /bin folder of the web application.
  4. Run the web application (visit in browser)
  5. Set breakpoints in your code.
  6. Go to Debug > Attach to process...
  7. Make sure that the "Show processes from all users" option is checked/enabled.
  8. Look for the w3wp.exe processes and attach to the one you want to debug.

If you use a separate application pool for each site in IIS and also set Identity on each application pool to ApplicationPoolIdentity then it will be much easier to find the correct process when attaching the debugger, since the name of the application pool is included in the application pool identity which is displayed as user name for each process.

 

You must be logged in to post in the forum