Sunday, 4 May 2014

Debug CRM 2013 Using Plugin Profiler error : System.Security.SecurityException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support:

When you need a debugging for your CRM 2011/2013 Plugin, you can do the debugging using 2 methods :

1. Using “Debug –> Attach to Process” then attach to w3wp.exe for OnPremise Plugin
2. Using Plugin Profiler

For some messages, PluginProfiler cannot be used to debug.

But, well here I will not explain you how to use PluginProfiler debugger, but I give you resolution to fix pluginprofiler error.

Now, I am trying to debug using Plugin Profiler, but instead of having a good Profiler when I trigger a plugin to do download error log, even I this following error message :

image

Then I Download log file :


Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: System.Security.SecurityException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #D42EB3A1Detail:
<OrganizationServiceFault xmlns:i="
http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts">
  <ErrorCode>-2147220970</ErrorCode>
  <ErrorDetails xmlns:d2p1="
http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
  <Message>System.Security.SecurityException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #D42EB3A1</Message>
  <Timestamp>2014-05-04T07:31:17.7584456Z</Timestamp>
  <InnerFault i:nil="true" />
  <TraceText>

[PluginProfiler.Plugins: PluginProfiler.Plugins.ProfilerPlugin]
[d69ec10c-5ed3-e311-940f-001cc4eecdd6: TFP.Xrm.Konica.PluginLogic.AccountPluginPreUpdate: Update of account (Profiler)]


</TraceText>
</OrganizationServiceFault>



Then I try to debug my plugin using that profile :

image

Unhandled Exception: System.ArgumentException: Unable to parse the OrganizationServiceFault.
Parameter name: serializedReport
   at PluginProfiler.Library.ProfilerUtility.ExtractReport(String serializedReport)
   at PluginProfiler.Library.ProfilerUtility.DeserializeProfilerReport(String assemblyFilePath, String logFilePath)
   at PluginProfiler.Library.ProfilerExecutionUtility.RetrieveReport(String logFilePath)
   at Microsoft.Crm.Tools.PluginRegistration.OrganizationHelper.ParseReportOrShowError(IWin32Window owner, FileBrowserControl profilePathControl, Boolean requireReportParse, ProfilerPluginReport& report)
Inner Exception: System.InvalidOperationException: Message does not contain a serialized value.
   at PluginProfiler.Library.ProfilerUtility.ExtractReportFromFault(OrganizationServiceFault fault)
   at PluginProfiler.Library.ProfilerUtility.ExtractReport(String serializedReport)

Ya, of course I will get this error because that Profile is not in parse-able format

I tried this and kept searching and I was tired and frustated about this, then I tried using my first method debugging, but finally I try again using older SDK, especially for CRM 2011 SDK that I have.
I tried some SDK, and then try this SDK and using this Plugin Registration Tool inside this folder :
“..\SDK\tools\pluginregistration\bin\Debug”

In the newest CRM SDK version, you will not longer see pluginregistration folder inside tools folder, but you will find in the bin folder.

Yes, I try to install my profiler using that SDK and that.

I can have this Profile :

image

Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault,
Microsoft.Xrm.Sdk, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]:
Download the details and load with Plug-in Profiler.
|7R1dc+I48q9QPGzdPRgbDMFhCVuzk8wttTsDFTJXW/tyJcttoosteWU5CfvrV7IN4cMBw0wM0ZIHgmS11OputVr
qbtz/6TkMao/AY8LoVb3ZsOo1oJh5hE6v6l/vPhlOvfbToH8LEeOiJhvTuEeu6vdCRD3TfHp6ajzZDcanZsuymubvn3
+b4HsIkUFoLBDFUB/0PzLqk2nCkZBj1EiPkuCqLngCdTN9GMvvWDB+nTcZ0s8kCEgMmFEvHlh9c3ej5X5unjFEO8a
aCMTFHQlh0LKabcPqGFb7zur22navaTda3WbL7tp/rIz8AqI6EvAsBj8E4sdSBPxhKn5UjcdBMiX05hlwohDM+zmEr
PMef05iQiGOv1Iihp6qdTzsOuDZhuNddgywm03DsVzHkB11Op7ValtWS0Gam6Cq+iPjHIKMxmklvrjoetAEo4svW
kYb4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1pvoycK44DV4/Q1B+kLDfqLx6+8Z6Fp981dbV46efVN
DIsWZd/DUADQ/wXFE+CPBEtV4kWMUPGFicVRP380UEP2zXJt+8M4p8QtRPLQM0gPQ31zvbq/ctQZtPqrZ5/0dR
my3c2jVMyvr6pX18Y8PjyLAM8jyGNFN7mWEw5bX6ihJE2t8cHeceh9cwHbN7MXfgz+Bg==|Detail:
<OrganizationServiceFault xmlns:i=
http://www.w3.org/2001/XMLSchema-instance
xmlns="
http://schemas.microsoft.com/xrm/2011/Contracts">
  <ErrorCode>-2147220891</ErrorCode>
  <ErrorDetails xmlns:d2p1="
http://schemas.datacontract.org/2004/07/System.Collections.Generic">
    <KeyValuePairOfstringanyType>
      <d2p1:key>OperationStatus</d2p1:key>
      <d2p1:value xmlns:d4p1="
http://www.w3.org/2001/XMLSchema" i:type="d4p1:string">0</d2p1:value>
    </KeyValuePairOfstringanyType>
    <KeyValuePairOfstringanyType>
      <d2p1:key>SubErrorCode</d2p1:key>
      <d2p1:value xmlns:d4p1="
http://www.w3.org/2001/XMLSchema" i:type="d4p1:string">-2146233088</d2p1:value>
    </KeyValuePairOfstringanyType>
  </ErrorDetails>
  <Message>Download the details and load with Plug-in Profiler.
|7R1dc+I48q9QPGzdPRgbDMFhCVuzk8wttTsDFTJXW/tyJcttoosteWU5CfvrV7IN4cMBw0wM0ZIHgmS11OputVr
qbtz/6TkMao/AY8LoVb3ZsOo1oJh5hE6v6l/vPhlOvfbToH8LEeOiJhvTuEeu6vdCRD3TfHp6ajzZDcanZsuymubvn3
+b4HsIkUFoLBDFUB/0PzLqk2nCkZBj1EiPkuCqLngCdTN9GMvvWDB+nTcZ0s8kCEgMmFEvHlh9c3ej5X5unjFEO8a
aCMTFHQlh0LKabcPqGFb7zur22navaTda3WbL7tp/rIz8AqI6EvAsBj8E4sdSBPxhKn5UjcdBMiX05hlwohDM+zmEr
PMef05iQiGOv1Iihp6qdTzsOuDZhuNddgywm03DsVzHkB11Op7ValtWS0Gam6Cq+i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Ioq9IBgWur4WrmitY464mznjjriXeuJ1pvoycK44DV4/Q1B+kLDfqLx6+8Z6Fp981dbV46efVN
DIsWZd/DUADQ/wXFE+CPBEtV4kWMUPGFicVRP380UEP2zXJt+8M4p8QtRPLQM0gPQ31zvbq/ctQZtPqrZ5/0dR
my3c2jVMyvr6pX18Y8PjyLAM8jyGNFN7mWEw5bX6ihJE2t8cHeceh9cwHbN7MXfgz+Bg==|</Message>
  <Timestamp>2014-05-04T07:43:13.3182314Z</Timestamp>
  <InnerFault i:nil="true" />
  <TraceText>

[PluginProfiler.Plugins: PluginProfiler.Plugins.ProfilerPlugin]
[c0bd8b04-5dd3-e311-80bb-00155d02400c: TFP.Xrm.Konica.PluginLogic.AccountPluginPreCreate:
Create of account (Profiler)]

</TraceText>
</OrganizationServiceFault>


And I can do debugging and I can view my profile from that file, meaning that this file is parse-able.

I just try to view my profile using that downloaded log file error.

image

From here, I can see my input arguments and also I can do debugging as usual.
Okay, here is the final resolutions I can do :

ERROR :


Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: System.Security.SecurityException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #D42EB3A1Detail:
<OrganizationServiceFault xmlns:i="
http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.microsoft.com/xrm/2011/Contracts">
  <ErrorCode>-2147220970</ErrorCode>
  <ErrorDetails xmlns:d2p1="
http://schemas.datacontract.org/2004/07/System.Collections.Generic" />
  <Message>System.Security.SecurityException: Microsoft Dynamics CRM has experienced an error. Reference number for administrators or support: #D42EB3A1</Message>
  <Timestamp>2014-05-04T07:31:17.7584456Z</Timestamp>
  <InnerFault i:nil="true" />
  <TraceText>

[PluginProfiler.Plugins: PluginProfiler.Plugins.ProfilerPlugin]
[d69ec10c-5ed3-e311-940f-001cc4eecdd6: TFP.Xrm.Konica.PluginLogic.AccountPluginPreUpdate: Update of account (Profiler)]


</TraceText>
</OrganizationServiceFault>


CAUSE :

After long journey of investigation, I found the reason behind this and can finish my errand here.

The problem is..

Problem is in PluginProfiler.Solution file

image

RESOLUTIONS :

1. Using CRM 2011 Plugin Registration older SDK, this is to ease you, please download this :

PluginRegistration to Fix Plugin Profiler Error

or using this one

PluginRegistration to Fix Plugin profiler Error SDK CRM 2011 - Bin Only

2. Using CRM 2013 Plugin Registration tool, but using the PluginProfiler.Solution from CRM 2011

Well, if you still insist to using CRM 2013 Tool, here you can do these steps.

This can be tricky, because those two files have different format.

CRM 2013 SDK :

image

CRM 2011 SDK

image

So you have to combine that and create new .zip file.

Okay, again I would like to make it easier for you, just download this PluginProfiler.solution

PluginProfiler.SolutionFixCombined

and then copy paste to your CRM 2013 SDK bin folder, don’t forget to backup your old .zip file.

image

Then as usual go to your Plugin Registration Tool and Install Profiler.

(If you don’t combine the file and just copy file from 2011 to 2013, which is there is no web resources folder, then when you install the Profiler you will get error)

image

And you can see after that you will be able to see your Plugin Profile

image

Test this by creating a new Account to trigger plugin

image

Look, now I can debug my Plugin :)

image

So, you can download these files :

CRM 2011 Plugin Registration Tool SDK - Bin Only Fix Plugin Profiler

CRM 2013 Plugin Registration Tool SDK - Fix Plugin Profiler

Hope it helps!


22 comments:

  1. Hi, shows me a error when attach to process in Visual Studio "Unable to attach to the process. The remote endpoint was not reachable."

    Can you help me?

    ReplyDelete
  2. Before shows me this error than you comment. I realized this steps and it works except than I can't attach to process.

    ReplyDelete
  3. Hi Mary, sorry I just see my twitter.
    Do you use remote debug plugin?
    You attach the Debug process to PluginRegistrationTool.exe?

    ReplyDelete
  4. Hi Aileen! I before used VS2012 and I tried in VS2010 and it works. Thanks for your help, your post helped me much.

    Regards!

    ReplyDelete
    Replies
    1. Hi Mary, nice to help you, glad to hear that. Anyway, actually I use VS 2012 and it works, not sure why to you cannot.

      Delete
  5. Thanks, it's useful to me!

    ReplyDelete
  6. One of my friend need this info going to bookmark it to share with him. thanks for the post.
    whmcs wordpress

    ReplyDelete
  7. Hello Aileen,
    Have you got to debug a merged dll solution plugin?
    In my solution is all ok, but the debug process is not stopped in the VS break point. It's only success when I have separates dlls.

    ReplyDelete
    Replies
    1. Sermoc,

      It should stop in your breakpoint.
      Have you downloaded the latest log file and then you put break point, then you do attach to the Plugin Reg Tool in the attach process in VS?

      Delete
  8. Very nice blog.people who are looking for this info it is very helpful to them
    Microsoft Dynamics CRM Online Training | Microsoft Dynamics AX Training

    ReplyDelete
  9. I completed my debugging, stopped profiling, and it works great for me. My users are still receiving the profiler message and it does not run?

    ReplyDelete
  10. Wow! Great post! The content is very rich, and I really like it. It help me very much to solve some problems. It is very helpful for all the people on the web. Thanks a lot. Ecommerce Product Photography || Ecommerce Product Photoshoot || Products Catalogue

    ReplyDelete
  11. Wow! Great post! The content is very rich, and I really like it. It help me very much to solve some problems. It is very helpful for all the people on the web. Thanks a lot. Ecommerce Product Photography || Ecommerce Product Photoshoot || Products Catalogue

    ReplyDelete
  12. Hi! Would you have the PluginProfiler.Solution.zip file for MS Dynamics CRM 2015 Online? Downloaded the ones you provided above, but they did not work... Keep getting this error: "You can only import solutions with a package version of 7.1 or earlier into this organization. Also, you can't import any solutions into this organization that were exported from Microsoft Dynamics CRM 2011 or earlier."

    ReplyDelete
    Replies
    1. I'm struggling with the same problem. I'm using CRM 2016 online.

      Delete
  13. Same error "You can only import solutions with a package version of 7.1 or earlier into this organization. Also, you can't import any solutions into this organization that were exported from Microsoft Dynamics CRM 2011 or earlier."
    No solution for CRM 2015 On Promise ?

    ReplyDelete
  14. Did anyone found solution for CRM 2015 on Premise plugin profile parsing error? Any information would be of great help.

    ReplyDelete
  15. Such unexpected errors stop the proper working of the whole program. Use the error-free code for Joomla development.

    ReplyDelete

My Name is..