Answered by:
SSIS Microsoft.XRM.SDK error

Question
-
I am trying to create a dtsx package with VS2010.
I am building this on a local machine ( Win 8 Pro) and have the latest CRM2011 SDK.
SQL server is running on a separate win2008 R2 Server
CRM2011 is running on a separate Win2008 R2 server
Following a tutorial I have added the references to a script task and all compiles, but when I execute the task (to test) i get the following error Could not load file or assembly 'Microsoft.Xrm.Sdk, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.
properties of Microsoft.Xrm.Sdk
Version 5.0.0.0
Runtime Version v4.0.30319
Dont ask me .. i dont know
Tuesday, June 11, 2013 12:59 PM
Answers
-
Hi Pete,
You need to pass the ADFS client credentials:
ClientCredentials credentials = new ClientCredentials(); credentials.UserName.UserName = UserName; credentials.UserName.Password = Password;
hth
Scott Durow
Blog: www.develop1.netFollow Me
Rockstar365 Profile
If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"- Proposed as answer by Scott Durow (MVP)MVP, Editor Tuesday, June 11, 2013 2:30 PM
- Marked as answer by Pete Newman Tuesday, June 11, 2013 2:31 PM
Tuesday, June 11, 2013 2:29 PMAnswerer
All replies
-
Hi Pete,
You need to make sure that the Microsoft.Xrm.Sdk and the Microsoft.Crm.Sdk.Proxy assemblies are located in the same folder as the custom task assembly - or added to the GAC on the SQL Server.
hth
Scott Durow
Blog: www.develop1.netFollow Me
Rockstar365 Profile
If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"Tuesday, June 11, 2013 1:36 PMAnswerer -
Hi Scott,
This will sound like a daft question, but even though I am running this task under VS2010 on my local machine, am I right in presuming that the CRM2011 SDK need to be installed on the SQL Server as well ?
Dont ask me .. i dont know
Tuesday, June 11, 2013 1:44 PM -
Hi Pete,
The SDK assemblies only need to be installed where the package is running - so if you only ever intend on running it locally from VS - then they don't - but if you intend on running the package via SSIS/SQL Agent on the SQL server - then they need to be there too.
hth
Scott Durow
Blog: www.develop1.netFollow Me
Rockstar365 Profile
If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"- Proposed as answer by Scott Durow (MVP)MVP, Editor Tuesday, June 11, 2013 2:30 PM
Tuesday, June 11, 2013 1:51 PMAnswerer -
Hi Scott,
That's what I thought. At present this task is not running directly on the SQL server, and the assemblies are installed on my local machine.
One thing has struck me though, Although I am running VS on my local machine, the project itself is located on a Development server. Would I be right in thinking then that if the 'project' is located on DevSrv1, and I am accessing that project from my local machine, when I run the project, it would be looking for the assemblies on DevSrv1?
regards
Dont ask me .. i dont know
Tuesday, June 11, 2013 1:57 PM -
Hi Pete,
If you are running the project form VS it will execute locally - so the assemblies need to be in the GAC locally.
hth
Scott Durow
Blog: www.develop1.netFollow Me
Rockstar365 Profile
If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"- Proposed as answer by Scott Durow (MVP)MVP, Editor Tuesday, June 11, 2013 2:30 PM
Tuesday, June 11, 2013 2:06 PMAnswerer -
Hi Scott,
That fixed it, though I have run into another issue you may be able to help with. This dtsx will eventually be fired from a SQL trigger. I have followed a tutorial which uses windows authentication, which is failing as we use adfs with 'The user authentication failed!'.
How can i set a user in the following code ie 'Fred' with password '1234567' ( dummy user name and password)
Public Overrides Sub PreExecute() MyBase.PreExecute() Dim credentials As New ClientCredentials() credentials.Windows.ClientCredential = System.Net.CredentialCache.DefaultNetworkCredentials organizationservice = New OrganizationServiceProxy(New Uri("https://internal.OURDOMAINNAME:PORTNO/DEVCRM/XRMServices/2011/Organization.svc"), Nothing, credentials, Nothing) End Sub
Dont ask me .. i dont know
Tuesday, June 11, 2013 2:26 PM -
Hi Pete,
You need to pass the ADFS client credentials:
ClientCredentials credentials = new ClientCredentials(); credentials.UserName.UserName = UserName; credentials.UserName.Password = Password;
hth
Scott Durow
Blog: www.develop1.netFollow Me
Rockstar365 Profile
If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"- Proposed as answer by Scott Durow (MVP)MVP, Editor Tuesday, June 11, 2013 2:30 PM
- Marked as answer by Pete Newman Tuesday, June 11, 2013 2:31 PM
Tuesday, June 11, 2013 2:29 PMAnswerer -
Scott you are a legend
Thank for all your help
Dont ask me .. i dont know
Tuesday, June 11, 2013 2:31 PM -
I am not sure if this is too late but just in case if anyone else is having same issue.
In my case I had a brand new machine with brand new profile. After installing VS12 and getting latest from TFS, all my CRM related packages started showing same error even though the reference for Xrm.SDK was there.
After bit of research I copied dll file from SDK to C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn and ran package again with no errors.
Wednesday, August 9, 2017 5:05 PM