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)

Non-Sand-boxed plugin errors out "Request for the permission of type 'System.Security.Permissions.EnvironmentPermission' failed"

(0) ShareShare
ReportReport
Posted on by

I received below error while I am invoking an external web service from plugin. plugin is registered under isolation mode: 'none', stage: post, mode: Sync

Request for the permission of type 'System.Security.Permissions.EnvironmentPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

what other permissions/settings needs to be verified to resolve this issue?

*This post is locked for comments

I have the same question (0)
  • David Jennaway Profile Picture
    14,065 on at

    I'm surprised that you get this if the plugin is not running in the sandbox, as it should run in full trust. However, it's possible that the CRM website might not be running in full trust, which could cause this. See https://stackoverflow.com/questions/8470216/system-security-securityexception-request-for-the-permission-of-type-system-se#8477634  for information on the IIS settings.

    Or maybe you could change the code so it doesn't need this permission. This permission is needed for accessing environment variables, such as to get the machine name, or  the temporary directory

  • Community Member Profile Picture
    on at

    Thanks for your response David. I realized that the web service call works fine from plugin on server but fails when i debug locally. I am using plugin profiler and attaching the profiler process to visual studio. i believe something on my machine is not allowing the plugin code to execute the web service call.

  • David Jennaway Profile Picture
    14,065 on at

    It makes more sense that it is a local issue, rather than on the server. There are many permissions or group policy settings that could cause this, though the most likely is access to the temporary directory. If you can, try running the plugin profiler with administrative rights

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