Alex Rivera | Logout

the common language runtime was unable to set the breakpoint

Asked 2011-12-20T19:13:20.240
32

This is actually another part of this question.

Error settings breakpoints but only on some lines while debugging

I'm remote debugging a CRM 2011 plugin in vs 2010.

I'n one of my source files I can set breakpoint all throughout the code except in a few places.

When I try to set a breakpoint I get this error "The following breakpoint cannot be set:" and "The Common Language Runtime was unable to set the breakpoint."

protected override void ExecutePlugin()
{
    SetStateResponse response = new SetStateResponse(); // Breakpoint works

    // Message switch
    switch (_crmMessage) // Breakpoint error
    {
        case CrmPluginMessageEnum.Create:

        Entity pimage = null; // Breakpoint error
        if (_context.PostEntityImages.ContainsKey("postcreate")) // Breakpoint works
            pimage = _context.PostEntityImages["postcreate"]; // Breakpoint error

        break; // Breakpoint error
        }
} // Breakpoint error

UPDATE Also, in the modules window it shows the dll as Optimized: No User Code: Yes Symbol Status: Symbols Loaded

Edit
Report

1 Answer

0

Another cause of this issue I have just found if you are debugging against CRM is not updating the plugin registration points. Even if you copy the new DLLs to the target machine and attach remotely to that process that is not the DLL CRM will use. CRM will try to take a copy of an old version from its database until you rerun the plugin registrations.

An error which wasted a day and a half for me!

answered 2013-07-18T09:19:59.173

Your Answer