Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

How to solve Plug-in assembly error in crm 2015

(0) ShareShare
ReportReport
Posted on by 260

Hi,

I wrote a plug-in and when i execute it in the crm form while save operation; i got error. The error log is:

Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: System.ArgumentNullException: Value cannot be null.
Parameter name: TrackingId: 535C8412, Depth: 1, Message: SandboxAppDomainHelper.Execute: The plug-in type could not be found in the plug-in assembly: CheckboxMagazaKaydet.MyPluginDetail:
<OrganizationServiceFault xmlns:i="www.w3.org/.../XMLSchema-instance" xmlns="schemas.microsoft.com/.../Contracts">
<ErrorCode>-2147220970</ErrorCode>
<ErrorDetails xmlns:d2p1="schemas.datacontract.org/.../System.Collections.Generic" />
<Message>System.ArgumentNullException: Value cannot be null.
Parameter name: TrackingId: 535C8412, Depth: 1, Message: SandboxAppDomainHelper.Execute: The plug-in type could not be found in the plug-in assembly: CheckboxMagazaKaydet.MyPlugin</Message>
<Timestamp>2016-10-31T07:00:45.449893Z</Timestamp>
<InnerFault i:nil="true" />
<TraceText>

[CheckboxMagazaKaydet: CheckboxMagazaKaydet.MyPlugin]
[8ec0dfd2-d29c-e611-80d8-0050569f563c: CheckboxMagazaKaydet.MyPlugin: Create of new_destek_yerelreklam_detay]

</TraceText>

</OrganizationServiceFault>

How can i solve "The plug-in type could not be found in the plug-in assembly" error. I use crm ms 2015 and the assemblies in the plugin are from sdk bin folder version 2015.

*This post is locked for comments

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to solve Plug-in assembly error in crm 2015

    Will making research about it to find a solution for you,

    stackoverflow.com/.../dynamics-crm-2015-the-plug-in-type-could-not-be-found

    crmfortress.com/.../the-plug-in-type-could-not-be-found-in-the-plug-in-assembly-issue

    Check these two links too

    and try using diagnostic tool

  • altun8tr Profile Picture
    altun8tr 260 on at
    RE: How to solve Plug-in assembly error in crm 2015

    Hi Ezgi,

    I did the steps again according to your describing. Nothing changed. I got the error:

    Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: System.ArgumentNullException: Value cannot be null.

    Parameter name: TrackingId: 951071C9, Depth: 1, Message: SandboxAppDomainHelper.Execute: The plug-in type could not be found in the plug-in assembly: CheckboxMagazaKaydet.MyPluginDetail:

    <OrganizationServiceFault xmlns:i="www.w3.org/.../XMLSchema-instance&quot; xmlns="schemas.microsoft.com/.../Contracts&quot;>

     <ErrorCode>-2147220970</ErrorCode>

     <ErrorDetails xmlns:d2p1="schemas.datacontract.org/.../System.Collections.Generic&quot; />

     <Message>System.ArgumentNullException: Value cannot be null.

    Parameter name: TrackingId: 951071C9, Depth: 1, Message: SandboxAppDomainHelper.Execute: The plug-in type could not be found in the plug-in assembly: CheckboxMagazaKaydet.MyPlugin</Message>

     <Timestamp>2016-10-31T12:10:38.6617732Z</Timestamp>

     <InnerFault i:nil="true" />

     <TraceText>

    [CheckboxMagazaKaydet: CheckboxMagazaKaydet.MyPlugin]

    [dcf241db-629f-e611-80d8-0050569f563c: CheckboxMagazaKaydet.MyPlugin: Create of new_destek_yerelreklam_detay]

    </TraceText>

    </OrganizationServiceFault>

  • Suggested answer
    Nuno Profile Picture
    Nuno 2,005 on at
    RE: How to solve Plug-in assembly error in crm 2015

    Hi,

    Take a look at this to see it it may solve your problem:

    crmfortress.com/.../the-plug-in-type-could-not-be-found-in-the-plug-in-assembly-issue

  • altun8tr Profile Picture
    altun8tr 260 on at
    RE: How to solve Plug-in assembly error in crm 2015

    Hi Nuno,

    I downloaded the sdk package again today .The version is crm 2015

    The Crm program is Crm 2015. Imean both are 2015

  • Suggested answer
    Nuno Profile Picture
    Nuno 2,005 on at
    RE: How to solve Plug-in assembly error in crm 2015

    Hi Muharrem,

    Which SDK are you using? Is it the same as the CRM? This exception may happen when the dlls from SDK and the CRM are from different version. For example using dlls from SDK 2016 on a CRM 2015.

    Regards,

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to solve Plug-in assembly error in crm 2015

    I have just realized that I guess you register your plugin wrong. Just to make sure you did it right please chek out the screenshots below..

    1- click right on plugins 

    6232.Ekran-Al_3101_nt_3101_s_3101_.PNG

    2- click on it

    6232.Ekran-Al_3101_nt_3101_s_3101_.PNG

    3-click on add new step

    Ekran-Al_3101_nt_3101_s_3101_2.PNG

    on the fallowing page enter your entity info and then add post image 

  • altun8tr Profile Picture
    altun8tr 260 on at
    RE: How to solve Plug-in assembly error in crm 2015

    I add post image on plugin registration tool. I got the error which you can see below when try to save the form on ms crm 2015. I can not debug you can see the picture above. Before i could be able to debug code on vs 2015. But now i get error. I do not understand.

    Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: System.ArgumentNullException: Value cannot be null.

    Parameter name: TrackingId: BD1E5A63, Depth: 1, Message: SandboxAppDomainHelper.Execute: The plug-in type could not be found in the plug-in assembly: CheckboxMagazaKaydet.MyPluginDetail:

    <OrganizationServiceFault xmlns:i="" xmlns="">

     <ErrorCode>-2147220970</ErrorCode>

     <ErrorDetails xmlns:d2p1="" />

     <Message>System.ArgumentNullException: Value cannot be null.

    Parameter name: TrackingId: BD1E5A63, Depth: 1, Message: SandboxAppDomainHelper.Execute: The plug-in type could not be found in the plug-in assembly: CheckboxMagazaKaydet.MyPlugin</Message>

     <Timestamp>2016-10-31T10:12:40.8809096Z</Timestamp>

     <InnerFault i:nil="true" />

     <TraceText>

    [CheckboxMagazaKaydet: CheckboxMagazaKaydet.MyPlugin]

    [7c6dbe03-519f-e611-80d8-0050569f563c: CheckboxMagazaKaydet.MyPlugin: Create of new_destek_yerelreklam_detay]

    </TraceText>

    </OrganizationServiceFault>

    c4.jpg

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to solve Plug-in assembly error in crm 2015

    Hi Muharrem,

    As I have realized, you forgot to add your post image on plugin registration tool. After adding it if you still get same error then using trace will be helpful. And we can make code review to see if you have problem in your code.

    Regards,

    please mark if it helps

  • altun8tr Profile Picture
    altun8tr 260 on at
    RE: How to solve Plug-in assembly error in crm 2015

    Above, you can see what i want to do. I wrote an html web resource to select child firms. After selection, the selected firms goes to the multiline text fields. When user presses the save (Kaydet) button, the form saves the firms one by one to the database table. I mean if 3 firm were selected, 3 rows should be added to the dadatabes table. The fatura no, fatura tarihi etc. are the same. And also the tutar value should be divided by the number of selected firms. The divided tutar should be saved to the dataase table row for each selected firms. Besides the MaÄŸaza field on the form is a lookup field and the marka field is an option set field.

    using System;

    using System.Collections.Generic;

    using System.Linq;

    using System.Text;

    using System.Threading.Tasks;

    using Microsoft.Xrm.Sdk;

    using Microsoft.Xrm.Sdk.Query;

    using System.ServiceModel;

    using Microsoft.Xrm;

    namespace CheckboxMagazaKaydet

    {

       // Bu plugin yerle rekalm desteÄŸinde birden fazla maÄŸaza seçildiÄŸinde maÄŸazaları ve verilerini kaydeder.

       public class MyPlugin : IPlugin

       {

           public void Execute(IServiceProvider serviceProvider)

           {

               // Sandbox içerisinde calisan plug-in’ler TracingService’den yararlanabilirler.

               ITracingService tracingService = (ITracingService)serviceProvider.GetService(typeof(ITracingService));

               //Context’i elde ediyoruz.

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

               // CRM Servisi elde ediyoruz

               IOrganizationServiceFactory serviceFactory =

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

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

               Entity SelectedFirms = new Entity("new_destek_yerelreklam_detay");

               // InputParameters’dan gelen verileri aliyoruz

               if (context.InputParameters.Contains("Target") && context.InputParameters["Target"] is Entity)

               {

                   // Target ile entity’e erisiyoruz.

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

                   // Beklediginiz entity geldi mi diye kontrol ediyoruz.

                   if (entity.LogicalName != "new_destek_yerelreklam_detay") return;

                   if (entity.Contains("new_magaza")) return;

                   if(entity.LogicalName == "new_destek_yerelreklam_detay")

                   {

                       try

                       {

                           if (context.MessageName == "Create")

                           {

                               #region seçilen magazaların id lerini al

                               string ids = entity.Contains("new_ids") ? entity["new_ids"].ToString() : "";

                               string[] id = ids.Split(',');

                               for (int k = 0; k < id.Length; k++)

                               {

                                   id[k] = id[k].Trim();

                               }

                               Guid[] magazaId = Array.ConvertAll(id, Guid.Parse);

                               #endregion

                               #region markalar

                               //The brands (mark numbers) of the firms

                               string markalar = entity.Contains("new_markalar") ? entity["new_markalar"].ToString() : "";//string from the multitext

                               string[] marka = markalar.Split(',');

                               int[] mrk = new int[marka.Length];

                               for (int j = 0; j < marka.Length; j++)

                               {

                                   marka[j] = marka[j].Trim();//add each mark number to string array

                               }

                               //string array to integer array for mark numbers

                               int[] myInts = Array.ConvertAll(marka, int.Parse);

                               #endregion

                               #region Gelen deÄŸerleri ata

                               //new_magaza alanı yoksa oluÅŸtur

                               if (entity.Attributes.Contains("new_magaza") == false)

                               {

                                   Guid mu = new Guid();

                                   mu = Guid.Empty;

                                   for (int i = 0; i < id.Length; i++)//It loops in new_multiline textare according to thenumber of firmsr

                                   {

                                       decimal tutar = (entity["new_tutar"] as Money).Value;//money value

                                       tutar = tutar / id.Length;

                                       string faturano = (string)entity.Attributes["new_faturano"];

                                       DateTime faturatarihi = (DateTime)entity.Attributes["new_faturatarihi"];

                                       OptionSetValue donem = (OptionSetValue)entity.Attributes["new_donem"];

                                       OptionSetValue calismaTuru = (OptionSetValue)entity.Attributes["new_calismaturu"];

                                       OptionSetValue myOptionSet = new OptionSetValue();

                                       myOptionSet.Value = myInts[i];

                                       entity.Attributes["new_marka"] = myOptionSet;

                                       OptionSetValue Firmamarkasi = (OptionSetValue)entity.Attributes["new_marka"];

                                       SelectedFirms.Attributes["new_marka"] = Firmamarkasi;//the integer mark number of the firm

                                                                                            /* SelectedFirms.Attributes["new_magaza"] = entity.Attributes["new_magaza"];*/// Guid id of firm productId

                                       SelectedFirms.Attributes["new_magaza"] = magazaId[i];//the guid of the selected firm.

                                       SelectedFirms["new_tutar"] = new Money(tutar);//money

                                       SelectedFirms.Attributes["new_faturano"] = faturano;//text

                                       SelectedFirms.Attributes["new_faturatarihi"] = faturatarihi;//datetime

                                       SelectedFirms.Attributes["new_donem"] = donem;//Option set

                                       SelectedFirms.Attributes["new_calismaturu"] = calismaTuru;//Option set

                                       SelectedFirms.Attributes["statecode"] = 0;//integer

                                       SelectedFirms.Attributes["new_ids"] = "";//the ids ffrom checked firms from the html web resource should be null. In database table this field  should be null

                                       SelectedFirms.Attributes["new_markalar"] = "";//the mark numbers comes from the html web resource

                                       SelectedFirms.Attributes["new_multiline"] = "";//the child firm names comes from the html web resource

                                                                                        //the ids,markalar and multilen textfield should be saved as null to the database

                                       service.Create(SelectedFirms);

                                   }

                               }

                               #endregion

                           }

                       }

                       catch (Exception ex) { tracingService.Trace("MyPlugin: {0}", ex.ToString()); throw; }

                   }

               }

           }

       }

    }

    3443.c3.jpg

    8311.c1.jpg

    0728.c2.jpg

    3443.c3.jpg

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: How to solve Plug-in assembly error in crm 2015

    Hi Muharrem,

    Can you please share your code and plugin registration screenshots( assembly and steps)?

    Regards

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

Congratulations 2024 Spotlight Honorees

Kudos to all of our 2024 community stars! 🎉

Meet the Top 10 leaders for December

Congratulations to our December super stars! 🥳

Start Your Super User Journey

Join the ranks of our community heros! 🦹

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,711 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,458 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans