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)

SSIS and xRM

(0) ShareShare
ReportReport
Posted on by 390

I have been attempting to use SSIS with CRM as outlined in this blog posting, http://blog.sonomapartners.com/2009/12/data-integrationmigration-using-sql-integration-services-ssis-2008.html, but with a twist: instead of using the CRM web service I want to use the xRM classes generated by the crmsvcutil.exe.

When I execute the package, it fails with the error:

Validation error. Data Flow Task: Data Flow Task: Microsoft.SqlServer.Dts.Pipeline.CannotCreateUserComponentException: Cannot create user component class. Make sure there is one class marked with SSISScriptComponentEntryPointAttribute in your script.

I have a class marekd with "SSISScriptComponentEntryPointAttribute".  I can successfully build the script component project - it just fails when I execute the package.  The code is below.

Google hasn't been much of a help with the error message.  I can comment out the code for the xRM and uncomment the web service code in the script component from the article referenced above an exclude the generated XrmCode.cs file and it works just fine.  I do have to exclude the crmsvcutil generated file for it to work, which makes me think the error is in there somewhere.

My questions:

  1. Does anyone have a guess as to what code might cause it to fail the validation?
  2. If not, any ideas of how I can debug what code (most likely in the crmsvcutil generated code) is causing the failure?

The code in the script component (using the xRM and not the web service) is below.

Thanks for any ideas.

Jeff

<pre>

using System;
using System.Data;
using Microsoft.SqlServer.Dts.Pipeline.Wrapper;
using Microsoft.SqlServer.Dts.Runtime.Wrapper;
using OrgName.Crm;  // xRM classes namespace
using Microsoft.Xrm.Client;

[Microsoft.SqlServer.Dts.Pipeline.SSISScriptComponentEntryPointAttribute]
public class ScriptMain : UserComponent
{
    private CrmConnection conn = new CrmConnection("Authentication type=Integrated; Server=http://crmtest/OrgName;");

    private DataContext ctx;
    public override void PreExecute()   
    {
        base.PreExecute();
        ctx = new DataContext(conn);
    }

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

   public override void Input0_ProcessInputRow(Input0Buffer Row)
   {
        contact con = new contact();

        if (!Row.FirstName_IsNull)
        {
            con.firstname = Row.FirstName;
        }

        if (!Row.LastName_IsNull)
        {
            con.lastname = Row.LastName;
        }

        if (!Row.Email_IsNull)
        {
            con.emailaddress1 = Row.Email;
        }

        ctx.AddTocontacts(con);
        ctx.SaveChanges();
    }
}

</pre>

 

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at

    Jeff,

    I came across this post when I was researching on SSIS/CRM. How did you manage to overcome the issue?

    Any inputs on your success story will help others on this forum.

    Harihar

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 March Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
AS-17030037-0 Profile Picture

AS-17030037-0 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans