Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Unanswered

Dynamics 1612 (9.0.22.8)on premise plugin issue

(1) ShareShare
ReportReport
Posted on by Microsoft Employee

Hello community,

I'm facing an issue with a Dynamics 365 On premise Plugin where I'm getting a SecurityException related to System.Net.WebPermission. The exact error message is as follows:

Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: Unexpected exception from plug-in (Execute): Crm.Plugins.Outbound: System.Security.SecurityException: Request for the permission of type 'System.Net.WebPermission, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.Detail:
<OrganizationServiceFault xmlns:i="">www.w3.org/.../XMLSchema-instance" xmlns="">schemas.microsoft.com/.../Contracts">
<ActivityId>55b753a0-2e1c-4058-8d8f-5fce997c0c73</ActivityId>
<ErrorCode>-2147220956</ErrorCode>
<ErrorDetails xmlns:d2p1="">schemas.datacontract.org/.../System.Collections.Generic" />
<Message>Unexpected exception from plug-in (Execute): Crm.Plugins.Outbound: System.Security.SecurityException: Request for the permission of type 'System.Net.WebPermission, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.</Message>
<Timestamp>2023-05-18T07:50:09.8190886Z</Timestamp>
<ExceptionRetriable>false</ExceptionRetriable>
<ExceptionSource i:nil="true" />
<InnerFault i:nil="true" />
<OriginalException i:nil="true" />
<TraceText>

Error: System.Security.SecurityException: Request for the permission of type 'System.Net.WebPermission, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark&amp; stackMark, Boolean isPermSet)
at System.Security.CodeAccessPermission.Demand()
at System.Net.HttpWebRequest.CheckConnectPermission(Uri uri, Boolean needExecutionContext)
at System.Net.HttpWebRequest..ctor(Uri uri, ServicePoint servicePoint)
at System.Net.HttpRequestCreator.Create(Uri Uri)
at System.Net.WebRequest.Create(Uri requestUri, Boolean useUriBase)

The action that failed was:
Demand
The type of the first permission that failed was:
System.Net.WebPermission
The Zone of the assembly that failed was:
MyComputer


This issue occurs when the Plugin tries to make a web request. I have already checked the necessary permissions and tried also webClient but the problem persists (upgraded to dot net framework 4.6.1 also). Could anyone provide some suggestions on how to resolve this issue? Are there any specific CRM configuration settings or permissions that need to be adjusted?. Initially plugin was able to call the web api but now stopped working suddenly. tried Manifest.xml but no luck

Any help or insights would be greatly appreciated. Thank you in advance!"

  • Kadir Kurt Profile Picture
    Kadir Kurt 38 on at
    RE: Dynamics 1612 (9.0.22.8)on premise plugin issue

    Hi,

    I think the link below will help you

       

    If you find the answer as useful, please mark it as verified.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    Dynamics 365 V 9.0 On premise Plugin exception -System.Net.WebPermission

    Hello community,

    I'm facing an issue with a Dynamics 365 On premise Plugin where I'm getting a SecurityException related to System.Net.WebPermission. The exact error message is as follows:

    Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: Unexpected exception from plug-in (Execute): Crm.Plugins.Outbound: System.Security.SecurityException: Request for the permission of type 'System.Net.WebPermission, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.Detail:
    <OrganizationServiceFault xmlns:i="">www.w3.org/.../XMLSchema-instance" xmlns="">schemas.microsoft.com/.../Contracts">
    <ActivityId>55b753a0-2e1c-4058-8d8f-5fce997c0c73</ActivityId>
    <ErrorCode>-2147220956</ErrorCode>
    <ErrorDetails xmlns:d2p1="">schemas.datacontract.org/.../System.Collections.Generic" />
    <Message>Unexpected exception from plug-in (Execute): Crm.Plugins.Outbound: System.Security.SecurityException: Request for the permission of type 'System.Net.WebPermission, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.</Message>
    <Timestamp>2023-05-18T07:50:09.8190886Z</Timestamp>
    <ExceptionRetriable>false</ExceptionRetriable>
    <ExceptionSource i:nil="true" />
    <InnerFault i:nil="true" />
    <OriginalException i:nil="true" />
    <TraceText>

    Error: System.Security.SecurityException: Request for the permission of type 'System.Net.WebPermission, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
    at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark&amp; stackMark, Boolean isPermSet)
    at System.Security.CodeAccessPermission.Demand()
    at System.Net.HttpWebRequest.CheckConnectPermission(Uri uri, Boolean needExecutionContext)
    at System.Net.HttpWebRequest..ctor(Uri uri, ServicePoint servicePoint)
    at System.Net.HttpRequestCreator.Create(Uri Uri)
    at System.Net.WebRequest.Create(Uri requestUri, Boolean useUriBase)

    The action that failed was:
    Demand
    The type of the first permission that failed was:
    System.Net.WebPermission
    The Zone of the assembly that failed was:
    MyComputer


    This issue occurs when the Plugin tries to make a web request. I have already checked the necessary permissions and tried also webClient but the problem persists (upgraded to dot net framework 4.6.1 also). Could anyone provide some suggestions on how to resolve this issue? Are there any specific CRM configuration settings or permissions that need to be adjusted?. Initially plugin was able to call the web api but now stopped working suddenly. tried Manifest.xml but no luck

    Any help or insights would be greatly appreciated. Thank you in advance!"

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,391 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,445 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans