locked
plugin 4 - Could not load file or assembly RRS feed

  • Question

  • i believe i have done something wrong in the code. i removed some chunk of code from plugin class which i wanted to put into a utility (project) helper class. my plugin project has the utility project referenced but after i deploy the dll and update it in reg tool i get this error: 'Could not load file or assembly 'Utility'. System could not find the file specified.

    Original plugin code:

    public void Execute(IPluginExecutionContext context)
            {
    
                DynamicEntity countryEntity = null;
                Guid opportunityId = new Guid();
    
                ICrmService crmService = context.CreateCrmService(true);
                if (context.InputParameters.Properties.Contains("Target") && context.InputParameters.Properties["Target"] is DynamicEntity)
                {
                    countryEntity = (DynamicEntity)context.InputParameters.Properties["Target"];
    
                    if (countryEntity.Name != "new_country")
                    {
                        return;
                    }

     

    new plugin code:

     

    public void Execute(IPluginExecutionContext context)
            {
    
                DynamicEntity countryEntity = null;
                Guid opportunityId = new Guid();
    
                ICrmService crmService = context.CreateCrmService(true);
             
    Helper.GetContext(context, countryEntity);
    
                    if (countryEntity.Name != "new_country")
                    {
                        return;
                    }

    new helper code:
            public static void GetContext(IPluginExecutionContext context, DynamicEntity entityName)
            {
                if(context.InputParameters.Properties.Contains("Target") && context.InputParameters.Properties["Target"] is DynamicEntity)
                {
                    entityName = (DynamicEntity) context.InputParameters.Properties["Target"];
                }
            }

     

    • Edited by Linq2011 Monday, December 5, 2011 11:20 AM
    Monday, December 5, 2011 11:17 AM

Answers

All replies

  • put your helper dll in GAC.

    I hope this helps.


    If you find this post helpful then please "Vote as Helpful" and "Mark As Answer". Amreek Singh Senior CRM Consultant CDC Praxa Sydney, Australia http://mscrmshop.blogspot.com http://crm2011usersettings.codeplex.com
    • Proposed as answer by Amreek Singh Monday, December 5, 2011 11:24 AM
    • Marked as answer by Linq2011 Monday, December 5, 2011 11:36 AM
    Monday, December 5, 2011 11:24 AM
  • i don't have anything in the GAC - but nonetheless i put the Utility in the GAC, did iisreset - same issue.

    anything else i can try?

    Monday, December 5, 2011 11:33 AM
  • actually that did remove the error.

    thanks.

    Monday, December 5, 2011 11:35 AM