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)

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

(0) ShareShare
ReportReport
Posted on by 15

Hellow , 

We have hosted an webserive , and from Plugin we are trying to consume . 

When i register my plugin in  None Mode , it works fine , but when i register it in Sandbox i am facing below error message .  

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

 

Code :

XYZService  serviceProxy = new XYZService ();
serviceProxy.Url = ncmsServiceHostUrl.TrimEnd('/') + "/samplexyz.asmx";  // Error Occurs when executing this line .


Currently we need to register our plugin in Sandbox mode , Also our Service url is an full trusted url .  

Kindly advice on above issue .  

Thanks  ,

 

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at

    Hi,

    Are you using online or onpremise ?

  • Suggested answer
    SergeyT Profile Picture
    310 on at

    Make sure your service runs on 80 or 443 port.

    >Only the HTTP and HTTPS protocols are allowed.

    >IP addresses cannot be used. You must use a named web address that requires DNS name resolution.

    docs.microsoft.com/.../plugin-isolation-trusts-statistics

  • Suggested answer
    RaviKashyap Profile Picture
    55,410 Moderator on at

    Hi,

    You cannot consume the web service using the add reference(assuming that's how you added your service to your plugin project), you need to access your service programmatically if you want it to register it in sandbox mode.

    nishantrana.me/.../calling-wcf-service-in-plugin-in-crm

    Refer these threads as well-

    community.dynamics.com/.../227343

    community.dynamics.com/.../254531

    Hope this helps.

  • Parthiban.T Profile Picture
    15 on at

    onpremise .

    FYI  : url is also domain specific . Eg ( https://xyz.com/getlead)

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