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 :
Dynamics 365 Community / Blogs / Nishant Rana’s Weblog / System.Security.SecurityExc...

System.Security.SecurityException: That assembly does not allow partially trusted callers while using HttpUtility.UrlEncode in CRM

Nishant Rana Profile Picture Nishant Rana 11,325 Microsoft Employee

Hi,

We got the below error in one of our Sandboxed Plugins

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

We realised it was because of using System.Web.HttpUtility class


We replaced it with EscapeDataString method and this fixed the issue.

System.Uri.EscapeDataString()

Helpful thread

https://stackoverflow.com/questions/3840762/how-do-you-urlencode-without-using-system-web

Hope it helps..


Filed under: CRM, CRM 2013, CRM 2015, CRM 2016, CRM 2016 Update 1, Microsoft Dynamics 365, Microsoft Dynamics CRM Tagged: CRM, CRM 2011, CRM 2013, CRM 2016, Dynamics 365, Microsoft Dynamics 365, Microsoft Dynamics CRM

This was originally posted here.

Comments

*This post is locked for comments