Alternative to HttpUtility.UrlEncode in Dynamics CRM Online

If you try to use HttpUtility.UrlEncode in your plugin or workflow code, you’ll get a security error:

System.Security.SecurityException: That assembly does not allow partially trusted callers.

Because it’s not allowed in CRM Online.

Instead, we should use this one:

Uri.EscapeDataString

Advertisements

Can’t connect to Dynamics 365 Customer Engagement using CRM SDK v9

Exception: Metadata contains a reference that cannot be resolved.

Today I encountered a strange exception when working with CRM SDK v9 to build a console application connecting to a D365 CE instance. When I inspected the inner exception, it said:

An existing connection was forcibly closed by the remote host

Continue reading “Can’t connect to Dynamics 365 Customer Engagement using CRM SDK v9”