Are the micorsoft.crm.sdk dll/micorsoft.crm.sdktypeproxy dlls used in plugin development dependent on the micorsoft.sharepoint.dll? I have a plugin that is throwing the following filenotfound exception.
Note: This plugin worked previously. We have two instances of crm and one instance of SharePoint on our server. We have the latest rollup applied for CRM. The exception is being thrown when the following line executes. I will post the entire plugin code below. Any help would begreatly appreciated.
Dim response As RetrieveMultipleResponse = CType(service.Execute(request), RetrieveMultipleResponse)
Exception Text:
[FileNotFoundException]: Could not load file or assembly 'Microsoft.SharePoint' or one of its dependencies. The system cannot find the file specified.
Plugin Code:
Public Sub Execute(ByVal context As Microsoft.Crm.Sdk.IPluginExecutionContext) Implements Microsoft.Crm.Sdk.IPlugin.Execute
Try
If context.InputParameters.Properties.Contains("Target") Then
Dim de As DynamicEntity = CType(context.InputParameters.Properties("Target"), DynamicEntity)
If context.PrimaryEntityName = "account" Then
If de.Properties.Contains("originatingleadid") Then
'Assign the Lead id and the id of the newly created Contact, Account or Opportunity to local variables for later use.
Dim originatingleadid As Guid = CType(de.Properties("originatingleadid"), Microsoft.Crm.Sdk.Lookup).Value
Dim newEntityid As Guid = CType(context.OutputParameters.Properties("id"), Guid)
Dim service As ICrmService = CType(context.CreateCrmService(True), ICrmService)
Dim query As QueryByAttribute = New QueryByAttribute
query.ColumnSet =
New AllColumns()
query.EntityName = EntityName.annotation.ToString query.Attributes =
New String() {"objectid"}
query.Values =
New Object() {originatingleadid}
' Create the request.
Dim request As New RetrieveMultipleRequest()
' Set the request properties.
request.Query = query
request.ReturnDynamicEntities =
False
' Execute the request.
Dim response As RetrieveMultipleResponse = CType(service.Execute(request), RetrieveMultipleResponse)Dim ctr As Integer = 1
For Each note As annotation In response.BusinessEntityCollection.BusinessEntities
note.annotationid =
Nothing
Dim newReference As EntityNameReference = New
EntityNameReference
newReference.Value = context.PrimaryEntityName note.objecttypecode = newReference note.objectid.Value = newEntityid service.Update(note) ctr = ctr + 1
Next
End
If
End
If
End
If
Catch ex As Exception
'Throw exception
End Try
End Sub
*This post is locked for comments
I have the same question (0)

Report
All responses (
Answers (