mmutilva
mmutilva

Reputation: 19014

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:

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.

Upvotes: 3

Views: 7560

Answers (6)

Iman
Iman

Reputation: 18946

  • check that you do not have multiple web front end servers in your Development Farm , and if you have remove them and only leave the actual server running VS

Upvotes: 0

ansielf
ansielf

Reputation: 11

My favorite technique: Don't debug SharePoint Web Parts! Build a Windows Console App and do your debugging there instead.

1) Create a windows console app
2) Copy all the relative code from the web part
3) Replace any ASP.NET control output with Console output
4) Debug and step through
5) Copy the fixed code back to the web part.

Cheers!

Upvotes: 0

wtjones
wtjones

Reputation: 4160

I worked around this by using the Attach All hotkey (Alt A, S) via CKSDev: http://cksdev.codeplex.com/

I also can't see the web part in the edit page screen during an F5 session even though it is supposed to work: http://blogs.msdn.com/b/bethmassi/archive/2010/01/28/creating-a-sharepoint-visual-web-part-using-visual-studio-2010.aspx

I figured the issue is related.

Upvotes: 0

donkos
donkos

Reputation: 54

A common cause of this problem is installing SharePoint on a machine that is already running Visual Studio. If you get this message: "The breakpoint will not currently be hit. No symbols have been loaded for this document", the easiest thing to do is reinstall Visual Studio on the machine. Then it works fine.

Upvotes: 1

mmutilva
mmutilva

Reputation: 19014

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.

Upvotes: 5

Jason
Jason

Reputation: 15931

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.

Upvotes: 2

Related Questions