I recently upgraded to CRM 2016. I have a custom workflow plugin that was originally written targeting CRM 2011.
When the workflow is triggered it tries to lookup some related entities but the following exception is thrown and I am not sure why.
The Microsoft.Xrm.Client dll is in the GAC of the
Does anyone know of a solution?
Unhandled Exception: Microsoft.Xrm.Sdk.InvalidPluginExecutionException: Exception has been thrown by the target of an invocation.
at MyPlugin.MyActivity.Execute(CodeActivityContext executionContext)
at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)
Inner Exception: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
at System.Delegate.DynamicInvokeImpl(Object[] args)
at Microsoft.Xrm.Sdk.Linq.QueryProvider.DynamicInvoke(Delegate project, Object[] args)
at Microsoft.Xrm.Sdk.Linq.QueryProvider.<>c__DisplayClassb.<ExecuteAnonymousType>b__7(<>f__AnonymousType0`2 <>h__TransparentIdentifier3)
at System.Linq.Enumerable.<>c__DisplayClass12`3.<CombineSelectors>b__11(TSource x)
at System.Linq.Enumerable.<>c__DisplayClass12`3.<CombineSelectors>b__11(TSource x)
at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
at System.Linq.Enumerable.<CastIterator>d__b1`1.MoveNext()
at Microsoft.Xrm.Sdk.Linq.PagedItemCollection`1.MoveNext()
at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
at MyPlugin.MyActivity.Execute(CodeActivityContext executionContext)
Inner Exception: System.Configuration.ConfigurationErrorsException: The value 'Microsoft.Xrm.Client.Configuration.CrmConfigurationProvider, Microsoft.Xrm.Client' is not recognized as a valid type or is not of the type 'Microsoft.Xrm.Client.Configuration.CrmConfigurationProvider'.
at Microsoft.Xrm.Client.Configuration.CrmConfigurationManager.CreateProvider()
at System.Lazy`1.CreateValue()
at System.Lazy`1.LazyInitValue()
at Microsoft.Xrm.Client.Threading.LockManager.CreateProvider()
at System.Lazy`1.CreateValue()
at System.Lazy`1.LazyInitValue()
at Microsoft.Xrm.Client.Threading.LockManager.Lock[T](String key, Func`1 action)
at Microsoft.Xrm.Client.EntityExtensions.GetRelated[T](Entity entity, Relationship relationship, Func`1 action)
at Microsoft.Xrm.Client.EntityExtensions.GetRelated[T](OrganizationServiceContext context, Entity entity, String relationshipSchemaName, Nullable`1 primaryEntityRole, Func`4 action)
at Microsoft.Xrm.Client.CrmEntity.GetRelatedEntity[TEntity](String relationshipSchemaName, Nullable`1 primaryEntityRole)
at Xrm.Connection.get_contact_connections1()
*This post is locked for comments