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:
- Does anyone have a guess as to what code might cause it to fail the validation?
- 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();
}
}
*This post is locked for comments
I have the same question (0)

Report
All responses (
Answers (