Dynamics 365 CE Plugin Exception: System.Security.SecurityException: That assembly does not allow partially trusted callers.

Today I faced an in an existing plugin which was working earlier. During investigation, I found that this is caused by the “HttpUtility.UrlEncode(clientSecret)” as shown in below code snippet image I found 2 ways to fix this issue User “System.Net.WebUtility.UrlEncode()” instead of “System.Web.HttpUtility.UrlEncode()”. Use “System.Uri.EscapeDataString() ” instead of “System.Web.HttpUtility.UrlEncode()”. as suggested in the this blog… Read More Dynamics 365 CE Plugin Exception: System.Security.SecurityException: That assembly does not allow partially trusted callers.

Dynamics 365 Web API – Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host

I have written a console application to do CRUD operation in CRM using Web API. It was working fine with my trial CRM organization, but stopped working from last few days. I was getting below error while making a call to CRM Web API. System.AggregateException occurred HResult=0x80131500 Message=One or more errors occurred. Source=<Cannot evaluate the… Read More Dynamics 365 Web API – Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host

Sample to connect to Dynamics 365 Web API through Console App (C#)

Here is step by step guide on how to create a console application to connect to Dynamics 365 Web API. Pre-Requisites You should have a Dynamics 365 CRM trial, if you don’t have one, you can create it from here. Visual studio or any other editor (I prefer visual studio 2015 or later version). Download… Read More Sample to connect to Dynamics 365 Web API through Console App (C#)