Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Problem debugging SharePoint 2010 web part

I'm trying to debug a web part manually deployed in my local sharepoint but I can't.

I did the following:

  • Set <compilation batch="false" debug="true" optimizeCompilations="true"> in web.config
  • Set breakpoints (e.g.: at the Page_Load method).
  • Deploy the project containing the webpart to my local sharepoint.
  • Copy the .pdb file manually to the c:/inetpub/wwwroot/wss/VirtualDirectories/80/bin folder.
  • Attach visual studio to all w3wp.exe instances running (there are three).

But Visual Studio reports "The breakpoint will not currently be hit. No symbols have been loaded for this document" so when I web browse to a page containing the web part, visual studio does not hit breakpoints.

like image 905
mmutilva Avatar asked Nov 30 '25 14:11

mmutilva


2 Answers

SOLVED: I was selecting Attach to: Automatically determine the type of code to debug, and Visual Studio automatically selected Native code. I changed the option to Debug these code types: Managed (...) and worked.

like image 189
mmutilva Avatar answered Dec 05 '25 00:12

mmutilva


what version of the ide are you using? you should be able to hit f5 to debug using vs2010. are you sure your debugger is connected to the correct w3wp process? are you manually deploying the web part? if so, it's possible the assembly has been cached and you need to recycle the app pool.

like image 23
Jason Avatar answered Dec 04 '25 22:12

Jason



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!