Hello there!
[assembly: Microsoft.Xrm.Sdk.Client.ProxyTypesAssemblyAttribute()]And in the connection code, I enabled proxy types (explained later). The problem is, EnableProxyTypes is a method that exists only in the OrganizationServiceProxy class--which is a class that is now forbidden by link #1 above.
Therefore, I must obtain a connected client using this:
var CrmSvc = new CrmServiceClient(<OauthConnectionString>);
However, I get this error:
A proxy type with the name <entity name> has been defined by another assembly
I could try adding the below lines that EnableProxyTypes, but they are forbidden by the documentation (link #1 above says not to use OrganizationServiceProxy):
CrmSvc.OrganizationServiceProxy.ServiceConfiguration.CurrentServiceEndpoint.Behaviors.Add(new ProxyTypesBehavior(Assembly.GetExecutingAssembly()));
CrmSvc.OrganizationServiceProxy.EnableProxyTypes(Assembly.GetExecutingAssembly());
So my question is, what is the correct way to enable proxy types (or in general, use early-bound generated classes), while complying with the removal of WS-Trust?
Thank you!
@eriksteinebach1 unfortunately no. The error I get concerning this is intermittent. so even when I contacted Microsoft support about it, they weren't able to properly debug/reproduce the issue. Maybe you could have better luck contacting them?
Were any of you ever able to figure this out? I am running into the same issue right now. Trying to enable ProxyTypes with the OAuth enabled Microsoft.PowerPlatform.Dataverse.Client.ServiceClient, but I am not able to find a way to do this.
Hi @somo ,
Thanks, I am afraid as I am couldn't find a way too...could you pls raise to support ticket to Microsoft to see what they say....
Thank you.
Cheers,
PMDY
Hello @Pavan_Mani_Deep Thank you for your response! I've edited my post to hopefully make it more clear that I've already taken the steps suggested in your blog post. In short: The new Oauth connection requirements are incompatible with early-bound generated classes, because Oauth does not have an allowed way to enable proxy types. At least, that's what it seems. Would love a definitive answer from Microsoft on this.
Hi @somo, May I know what were you building, you could prefer organization service instead, do remember that you need to refractor your code a bit, I have written a blog post way back in 2020...please go through it here once https://ecellorscrm.wordpress.com/2020/06/09/are-you-still-using-ws-trust-auth-and-organizationserviceproxy-then-it-is-time-to-change/, do let me know if you have any further questions....
Cheers,
PMDY
WarrenBelz
109
Most Valuable Professional
Michael E. Gernaey
76
Super User 2025 Season 1
mmbr1606
71
Super User 2025 Season 1