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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Are the micorsoft.crm.sdk dlls dependent on the micorsoft.sharepoint.dll?

(0) ShareShare
ReportReport
Posted on by 615

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)

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans