web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans