SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When i debug in the event reciever(item adding) as soon as it reached the if condition i get the following error

unable to automatically step into the server.The remote procedure could not be debugged. This usually indicates that the debugging has not been enabled on the server.

 SPServiceContext serviceContext = SPServiceContext.GetContext(Osite);
       UserProfileManager upm = new UserProfileManager(serviceContext);

       UserProfile u = upm.GetUserProfile(accNames);
       if (u[PropertyConstants.WorkEmail].ToString() != null || u[PropertyConstants.WorkEmail].ToString() != string.Empty)

I am working on a remote machine in the dev environment..i also turn the the debug = false to true in webconfig file..but no luck..any suggestions?

share|improve this question
when you say remote machine, is the debugger running on the same machine that the SharePoint server and User Profile Serview are executing on? – GavinB Jan 25 '12 at 3:44
yes it is on the same machine – spStacker Jan 25 '12 at 4:15
Although not answering your question, I am wondering if you could avoid using User Profile to get email address for a given account name. See – Ashish Patel Jan 25 '12 at 4:18
I debugged it again ..when it was on if(u[PropertyConstants.WorkEmail].ToString() != .. condition it gave the error in the pop pup box clicked ok, and then when i pressed f11 did allow to again to debug through...i think its just the part when the code is getting information from the user profiles, it does not allow to debug – spStacker Jan 27 '12 at 15:48

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.