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
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
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.
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
Mohamed Amine Mahmoudi
83
Super User 2025 Season 1
Community Member
54
Victor Onyebuchi
6