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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Early Bound with SDK 2016

(0) ShareShare
ReportReport
Posted on by

Hello,

I am currently trying to migrate to SDK 2016 a project using C# code essentially within plugins and SSIS projects.

I first noticed that I had to change connection process because it was using a class named CRMConnection witch is no more provided in new sdk.

And then I came across another problem. Our projects uses early bound as well and when trying to cast a generic entity into an earlybound entity, I get errors.

For example, when calling the following method, I receive the exception : Method Microsoft.Xrm.Sdk.Entity.ToEntity: type argument 'XXXXXXX.Crm.Cliper.nov_datainterface' violates the constraint of type parameter 'T (XXXX replaces customer's name in my namespace)

Please find the code of the called method :

private nov_datainterface GetDataInterfaceByName(string name)
{
QueryExpression query = new QueryExpression(nov_datainterface.EntityLogicalName);
query.Criteria.AddCondition("nov_name", ConditionOperator.Equal, name);
var result = OrgService.RetrieveMultiple(query);
if (result != null && result.Entities != null && result.Entities.Count > 0)
return result[0].ToEntity<nov_datainterface>();
return null;

}

I think that this method of the Entity class does not work anymore : public T ToEntity<T>() where T : Entity;

This works well with SDK 2015.

Any helps will be appreciated. I tried different ways to cast my custom entity fro an a an entity class but I was not able to find anything which works.

I am also wondering who many time the current code (actually working fine with 2015 SDK) will be supported. Any replies on that point will be appreciated either.

Best regards,

Emmanuel Barache

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Emmanuel Barache Profile Picture
    on at

    Hello,

    With further investigations, we found out that the problem I have reported is only occurring on the SSIS script task field.

    Our projects was using a proxy DLL.

    It seems that the problem I described would be avoided by inserting directly the proxy file C# file in the script task and not with a reference to a proxy DLL like the screen shot below :

    PROXY.png

    Best regards to all

    Emmanuel Barache

    Novulys Consultant

  • Verified answer
    Emmanuel Barache Profile Picture
    on at

    Hello,

    In the meantime, I could verify that it is still possible to work with a proxy DLL.

    The old proxy needs to be removed from the GAC, if not, we run thru problems !

    Best regards,

    Emmanuel Barache

    Novulys

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans