locked
SSIS integration package excecution failed. error in script component RRS feed

  • Question

  • Hello,


    Please this is my first time of posting here, I love this site, it has helped me alot.

    I am working on SSIS integration for CRM and an sql server database.

    I have done everything and added the assemblies/refrences to the script component class.

    but when i close the script component and try to run the ssis package itself, it gave the follwing error messages:


    Script Component has encountered an exception in user code:
    Project Name: SC_01e8f0b42576417590e05fdbcad38a4c
    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.   
    at ScriptMain.PreExecute()
       at Microsoft.SqlServer.Dts.Pipeline.ScriptComponentHost.PreExecute()


    I have use both crm sdk 2011 and 2013, same problem. please help me.

    this is my main.cs


    using System;
    using System.Data;
    using Microsoft.SqlServer.Dts.Pipeline.Wrapper;
    using Microsoft.SqlServer.Dts.Runtime.Wrapper;
    using Microsoft.Xrm.Sdk;
    using Microsoft.Xrm.Sdk.Client;
    using System.ServiceModel.Description;

    [Microsoft.SqlServer.Dts.Pipeline.SSISScriptComponentEntryPointAttribute]
    public class ScriptMain : UserComponent
    {
        IOrganizationService organizationservice;

        public override void PreExecute()
        {
            base.PreExecute();

            ClientCredentials credentials = new ClientCredentials();
            credentials.Windows.ClientCredential = System.Net.CredentialCache.DefaultNetworkCredentials;
            organizationservice = new OrganizationServiceProxy(
                new Uri("http://crm/contoso/XRMServices/2011/Organization.svc"), null, credentials, null);
        }

        public override void PostExecute()
        {
            base.PostExecute();
        }

        public override void Input0_ProcessInputRow(Input0Buffer Row)
        {
            Entity newcontact = new Entity("contact");

            if (!Row.FirstName_IsNull)
                newcontact["firstname"] = Row.FirstName;

            if (!Row.LastName_IsNull)
                newcontact["lastname"] = Row.LastName;

            if (!Row.Email_IsNull)
                newcontact["emailaddress1"] = Row.Email;

            if (!Row.Phone_IsNull)
                newcontact["telephone1"] = Row.Phone;

            organizationservice.Create(newcontact);
        }

    }

    please help.. thanks


    Wednesday, April 23, 2014 6:33 AM

All replies

  • Just try check if these MS CRM dll is available in GAC if not try to keep it there and then test.

    Our Website | Our Blog | Follow US | My Facebook Page | Microsoft Dynamics CRM 2011 Application Design
    Make sure to "Vote as Helpful" and "Mark As Answer",if you get answer of your question.

    Wednesday, April 23, 2014 6:50 AM
    Moderator
  • Thanks. I have gotten a way around it. I put the dlls in the ms sql server dts bin folder and it worked.

    but please how can I make this work for a real hosted website integration with crm. I want data to be imported on a scheduled basis. How do I deploy my SSIS package to do this.

    Wednesday, April 23, 2014 7:28 AM