web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

plugins always crash

(0) ShareShare
ReportReport
Posted on by 112

I am trying to write a plugin but I seem to be unable to even get a basic one to run. 

few things:

the class is public,

It is signed,

version sdk is 8.2.1.1

Also the profiler will not help do to its own issue (Unexpected exception from plug-in). I have tried to copy and paste the sample code in and get the same error every time.

I am now just try to get a shell that does not do any thing to run. Here is the code 

using Microsoft.Xrm.Sdk;
using System;

namespace basicPlugin
{
public class basicPlugin : IPlugin
{
#region Secure/Unsecure Configuration Setup
private string _secureConfig = null;
private string _unsecureConfig = null;

public basicPlugin(string unsecureConfig, string secureConfig)
{
_secureConfig = secureConfig;
_unsecureConfig = unsecureConfig;
}
#endregion
public void Execute(IServiceProvider serviceProvider)
{
ITracingService tracer = (ITracingService)serviceProvider.GetService(typeof(ITracingService));

IPluginExecutionContext context = (IPluginExecutionContext)serviceProvider.GetService(typeof(IPluginExecutionContext));

IOrganizationServiceFactory factory = (IOrganizationServiceFactory)serviceProvider.GetService(typeof(IOrganizationServiceFactory));

IOrganizationService service = factory.CreateOrganizationService(context.UserId);

try
{
Entity entity = (Entity)context.InputParameters["Target"];

//TODO: Do stuff
}
catch (Exception e)
{
throw new InvalidPluginExecutionException(e.Message);
}
}
}
}

*This post is locked for comments

I have the same question (0)
  • Junbin Duan Profile Picture
    35 on at
    RE: plugins always crash

    Thanks for the answer - it helps me too. I did not not realize the core assembly has been updated to 9.x while SDK still in 8.x. They are not compatible obviously.

  • Rscroggins Profile Picture
    112 on at
    RE: plugins always crash

    Holy wow that worked. Thank you so much

  • Verified answer
    ashlega Profile Picture
    34,477 on at
    RE: plugins always crash

    I'm not sure how it's possible.. but, since it's clearly mentioning 8.0 in the error message, I would try downloading 8.0 package from nuget:

    (This one, basically: www.nuget.org/.../8.0.0)

    Then recompile the plugin and see if it works.

    Why would there be a version difference between the UI and SDK, I've no idea. Might want to talk to Microsoft support (unless that's a partner-hosted CRM)

  • Rscroggins Profile Picture
    112 on at
    RE: plugins always crash

    I am running Version 1612(8.2.1.411)(DB 8.2.1.411) online,

  • ashlega Profile Picture
    34,477 on at
    RE: plugins always crash

    Maybe that's the problem, then? What version of CRM do you have there? In the error message, it's mentioning 8.0

  • Rscroggins Profile Picture
    112 on at
    RE: plugins always crash

    As I said in my first post my SDK version is version sdk is 8.2.1.1.

  • ashlega Profile Picture
    34,477 on at
    RE: plugins always crash

    Hm.. Just wondering - are you using the latest version of the SDK assemblies for the project references?

  • Rscroggins Profile Picture
    112 on at
    RE: plugins always crash

    I have downsized the code to the bare skeleton

    using Microsoft.Xrm.Sdk;

    using System;

    namespace CRMPluginProject1

    {

       public class Class1 : IPlugin

       {

           public void Execute(IServiceProvider serviceProvider)

           {

               //throw new NotImplementedException();

           }

       }

    }

    [View:[URL=http://s1347.photobucket.com/user/ITRS/media/code_zpso7eetgvn.png.html][IMG]i1347.photobucket.com/.../code_zpso7eetgvn.png[/IMG][/URL]:320:240]

    [View:[URL=http://s1347.photobucket.com/user/ITRS/media/regSkeleton_zps7ugriymy.png.html][IMG]i1347.photobucket.com/.../regSkeleton_zps7ugriymy.png[/IMG][/URL]:320:240]

    [View:[URL=http://s1347.photobucket.com/user/ITRS/media/regNewStepSkeleton_zpsnapwlynf.png.html][IMG]i1347.photobucket.com/.../regNewStepSkeleton_zpsnapwlynf.png[/IMG][/URL]:320:240]

    [View:[URL=http://s1347.photobucket.com/user/ITRS/media/errorSkeleton_zpsnb6kvfzg.png.html][IMG]i1347.photobucket.com/.../errorSkeleton_zpsnb6kvfzg.png[/IMG][/URL]:320:240]

    Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=8.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: System.ArgumentNullException: Value cannot be null.
    Parameter name: SandboxAppDomainHelper.Execute: The plug-in type could not be found in the plug-in assembly: CRMPluginProject1.Class1Detail:
    <OrganizationServiceFault xmlns:i="www.w3.org/.../XMLSchema-instance" xmlns="schemas.microsoft.com/.../Contracts">
    <ActivityId>6515a93c-4a47-4339-84f3-fe2e65284c6f</ActivityId>
    <ErrorCode>-2147220970</ErrorCode>
    <ErrorDetails xmlns:d2p1="schemas.datacontract.org/.../System.Collections.Generic" />
    <Message>System.ArgumentNullException: Value cannot be null.
    Parameter name: SandboxAppDomainHelper.Execute: The plug-in type could not be found in the plug-in assembly: CRMPluginProject1.Class1</Message>
    <Timestamp>2017-10-13T14:53:58.4541054Z</Timestamp>
    <ExceptionRetriable>false</ExceptionRetriable>
    <ExceptionSource i:nil="true" />
    <InnerFault i:nil="true" />
    <OriginalException i:nil="true" />
    <TraceText>

    [CRMPluginProject1: CRMPluginProject1.Class1]
    [32884a3c-26b0-e711-8115-e0071b7285c1: CRMPluginProject1.Class1: Create of account]


    </TraceText>
    </OrganizationServiceFault>

    If you need any thing else let me know.

    Thank you.

  • prasannakumar Profile Picture
    80 on at
    RE: plugins always crash

    Hi,

    Can you share more information on the plugin with details on the registration steps, the triggering message. how you have registered the plugin and how to concluded that the plugin is always crashing. May be a screenshot of the plugin registration tool and also the log information. 

  • ashlega Profile Picture
    34,477 on at
    RE: plugins always crash

    How do you know it crashes? Is there an error message/a log file/a screenshot you could share?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Aric Levin - MVP Profile Picture

Aric Levin - MVP 2 Moderator

#1
HR-09070029-0 Profile Picture

HR-09070029-0 2

#3
MA-04060624-0 Profile Picture

MA-04060624-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans