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

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

CRM plugin : Request for the permission of type 'System.Net.WebPermission, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed

(0) ShareShare
ReportReport
Posted on by 902

Hi,

I am using dynamic 365 version 9.0.1. It is a sandbox instance.

I am using web service in plugin to get some data in CRM.

Webservice : http://dev.xxxxx-systems.com:7047/DynamicsNAV90B49326-02/WS/xxxxx%20Pvt%20Ltd/Codeunit/CRMManagement

Web service IP address is accessible publicaly and also give DNS. 

Code :

CRMManagement.Credentials = new System.Net.NetworkCredential("xxxxxxx", "xxxxxxx", "xxxxxxxxxx");
                            CRMManagement.Url = "dev.xxxxxx-systems.com/.../CRMManagement";

 CRMManagement.GetSalesPrice_gFnc(customer_no, item_no, uom_code, orderline.CreatedOn.Value, currency_code, ref unitPrice);

I have used same web service in crm2016. It is working fine.

Thanks,

keyur shah.

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Michel van den Brink Profile Picture
    4,697 on at
    RE: CRM plugin : Request for the permission of type 'System.Net.WebPermission, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed

    EDIT: This is incorrect suggestion, apologies for the confusion.

    Hello,

    All plug-ins in Dynamics 365 Online run in an isolation sandbox, which limits your capabilities for security purposes.

    You are unfortunately not allowed to use non-standard port numbers, I see you are using 7047 (  http ://dev.xxxxx-systems.com : 7047 ), which is not allowed.

    You are only allowed to use port 80 for HTTP or port 443 for HTTPS as standards define.

      

    Please refer to this article about the isolation and limitations of plug-ins in Dynamics 365, specifically the section "Web Access":

    https://docs.microsoft.com/en-us/dynamics365/customer-engagement/developer/plugin-isolation-trusts-statistics#web-access 

    Alternative article:

    https://docs.microsoft.com/en-us/dynamics365/customer-engagement/developer/write-plugin#web-access-for-isolated-sandboxed-plug-ins

     

  • Shahbaaz Ansari Profile Picture
    6,211 on at
    RE: CRM plugin : Request for the permission of type 'System.Net.WebPermission, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed

    Hi Keyur,

    You wont be able to access Web service having IP address. You need to host that service and also you need domain name for your service then only it will work. I had this issue in past.

    Best Regards,

    Shahbaaz

  • Shaminderpal Singh Profile Picture
    1,565 on at
    RE: CRM plugin : Request for the permission of type 'System.Net.WebPermission, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed

    Hi Keyur,

    Can you share your code for better understanding.Also ,you can try to make http request with raw soap envelopes.

    Regards,

    Shaminder

  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at
    RE: CRM plugin : Request for the permission of type 'System.Net.WebPermission, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed

    Hi Keyur,

    What is the authentication you have used ?

    As you cannot use integrated windows authentication inside a sandboxed plugin.

    Please try with  HttpProxyCredentialType.Basic  .

    Please check HttpProxyCredentialType reference -

    referencesource.microsoft.com

  • keyur7379 Profile Picture
    902 on at
    RE: CRM plugin : Request for the permission of type 'System.Net.WebPermission, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed

    Hi Goutam,

    This web service is made in Navison.

    I have to use this web service like this. I already used in past.

    Thanks,

    keyur shah.

  • Suggested answer
    keyur7379 Profile Picture
    902 on at
    RE: CRM plugin : Request for the permission of type 'System.Net.WebPermission, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed

    Hi All,

    I got solution.

    We are using .net framework 4.5.2.

    Now We are change to .net framework 4.6.2 for dynamic 365 v9.0 and it is working fine.

    : We can use windows authentication for web service with sandbox plugin.

    Thanks,

    keyur shah.

  • Suggested answer
    gdas Profile Picture
    50,091 Moderator on at
    RE: CRM plugin : Request for the permission of type 'System.Net.WebPermission, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed

    Great !! Good Job Keyur!

  • Learn@mscrm Profile Picture
    50 on at
    RE: CRM plugin : Request for the permission of type 'System.Net.WebPermission, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed

    Hi Keyur,

    I'm facing similar issue. Through web service we are getting details like customer name , mail id passing the mobile number of customer. This was working fine in 8.2 version. After upgrading to version 9 it is not working in dev and uat environment. It is working properly in production environment as it is still in version 8.2. If we just change framework to 4.6 and add latest dll and reregister it is enough. The original plugin is working , only to get customer details it is not working as we use webservcies

  • Suggested answer
    keyur7379 Profile Picture
    902 on at
    RE: CRM plugin : Request for the permission of type 'System.Net.WebPermission, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed

    Hello,

    Yup, Go ahead.

     

    Thanks,

    Keyur Shah.

  • Learn@mscrm Profile Picture
    50 on at
    RE: CRM plugin : Request for the permission of type 'System.Net.WebPermission, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed

    Hi Keyur,

    I updated to .net framework 4.6.2 and i added Microsoft.Xrm.sdk dll and Microsoft.crm.sdk.proxy dll from new sdk downloading using nugget packages. I'm getting following error when i tried to register the assembly using plugin registration tool. This plugin assembly uses version 4.6.2 of the .NET Framework. At this time Microsoft Dynamics 365 requires version 4.5.2 of the .NET Framework for plugin assemblies. Rebuild this assembly using .NET Framework version 4.5.2 and try again. when i change framework back to 4.5.2 i'm able to register the plugin. I'm not able to get the required output.

    Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: This plugin assembly uses version 4.6.2 of the .NET Framework. At this time Microsoft Dynamics 365 requires version 4.5.2 of the .NET Framework for plugin assemblies. Rebuild this assembly using .NET Framework version 4.5.2 and try again.

    Detail: <OrganizationServiceFault xmlns="schemas.microsoft.com/.../Contracts&quot; xmlns:i="www.w3.org/.../XMLSchema-instance&quot;>

     <ActivityId>4f65c1cf-93a4-4f1e-a5da-35db56b0a73b</ActivityId>

     <ErrorCode>-2147204597</ErrorCode>

     <ErrorDetails xmlns:a="schemas.datacontract.org/.../System.Collections.Generic&quot;>

       <KeyValuePairOfstringanyType>

         <a:key>ApiExceptionSourceKey</a:key>

         <a:value i:type="b:string" xmlns:b="www.w3.org/.../XMLSchema&quot;>Plugin/Microsoft.Crm.ObjectModel.PluginAssemblyService</a:value>

       </KeyValuePairOfstringanyType>

       <KeyValuePairOfstringanyType>

         <a:key>ApiOriginalExceptionKey</a:key>

         <a:value i:type="b:string" xmlns:b="www.w3.org/.../XMLSchema&quot;>Microsoft.Crm.CrmException: This plugin assembly uses version 4.6.2 of the .NET Framework. At this time Microsoft Dynamics 365 requires version 4.5.2 of the .NET Framework for plugin assemblies. Rebuild this assembly using .NET Framework version 4.5.2 and try again. ---> Microsoft.Crm.CrmException: This plugin assembly uses version 4.6.2 of the .NET Framework. At this time Microsoft Dynamics 365 requires version 4.5.2 of the .NET Framework for plugin assemblies. Rebuild this assembly using .NET Framework version 4.5.2 and try again.

      at Microsoft.Crm.ObjectModel.TargetFrameworkVersionValidator.ValidateInternal()

      at Microsoft.Crm.ObjectModel.PluginValidatorBase.Validate()

      at Microsoft.Crm.ObjectModel.PluginAssemblyServiceInternal`1.ValidateAssemblyMetadata(ExecutionContext context, IBusinessEntity pluginAssembly, CrmPluginAssemblyMetadata assemblyMetadata)

      at Microsoft.Crm.ObjectModel.PluginAssemblyServiceInternal`1.VerifyRegistrationAbility(IBusinessEntity pluginAssembly, Boolean createCall, ExecutionContext context, CrmPluginAssemblyMetadata assemblyMetadata)

      at Microsoft.Crm.ObjectModel.PluginAssemblyServiceInternal`1.ValidateOperation(String operationName, IBusinessEntity entity, ExecutionContext context)

      at Microsoft.Crm.ObjectModel.SdkEntityServiceBase.UpdateInternal(IBusinessEntity entity, ExecutionContext context, Boolean verifyAction)

      at Microsoft.Crm.ObjectModel.PluginAssemblyServiceInternal`1.Update(IBusinessEntity entity, ExecutionContext context)

      --- End of inner exception stack trace ---

      at Microsoft.Crm.Extensibility.VersionedPluginProxyStepBase.Execute(PipelineExecutionContext context)

      at Microsoft.Crm.Extensibility.PipelineInstrumentationHelper.Execute(Boolean instrumentationEnabled, String stopwatchName, ExecuteWithInstrumentation action, PipelineExecutionContext context)

      at Microsoft.Crm.Extensibility.Pipeline.<>c__DisplayClass2_1.<Execute>b__0()</a:value>

       </KeyValuePairOfstringanyType>

       <KeyValuePairOfstringanyType>

         <a:key>ApiStepKey</a:key>

         <a:value i:type="b:guid" xmlns:b="schemas.microsoft.com/.../&quot;>a0cdbb1b-ea3e-db11-86a7-000a3a5473e8</a:value>

       </KeyValuePairOfstringanyType>

       <KeyValuePairOfstringanyType>

         <a:key>ApiDepthKey</a:key>

         <a:value i:type="b:int" xmlns:b="www.w3.org/.../XMLSchema&quot;>1</a:value>

       </KeyValuePairOfstringanyType>

       <KeyValuePairOfstringanyType>

         <a:key>ApiActivityIdKey</a:key>

         <a:value i:type="b:guid" xmlns:b="schemas.microsoft.com/.../&quot;>4f65c1cf-93a4-4f1e-a5da-35db56b0a73b</a:value>

       </KeyValuePairOfstringanyType>

       <KeyValuePairOfstringanyType>

         <a:key>ApiPluginSolutionNameKey</a:key>

         <a:value i:type="b:string" xmlns:b="www.w3.org/.../XMLSchema&quot;>System</a:value>

       </KeyValuePairOfstringanyType>

       <KeyValuePairOfstringanyType>

         <a:key>ApiStepSolutionNameKey</a:key>

         <a:value i:type="b:string" xmlns:b="www.w3.org/.../XMLSchema&quot;>System</a:value>

       </KeyValuePairOfstringanyType>

     </ErrorDetails>

     <Message>This plugin assembly uses version 4.6.2 of the .NET Framework. At this time Microsoft Dynamics 365 requires version 4.5.2 of the .NET Framework for plugin assemblies. Rebuild this assembly using .NET Framework version 4.5.2 and try again.</Message>

     <Timestamp>2018-11-23T21:08:40.1398219Z</Timestamp>

     <ExceptionRetriable>false</ExceptionRetriable>

     <ExceptionSource i:nil="true" />

     <InnerFault>

       <ActivityId>4f65c1cf-93a4-4f1e-a5da-35db56b0a73b</ActivityId>

       <ErrorCode>-2147204597</ErrorCode>

       <ErrorDetails xmlns:a="schemas.datacontract.org/.../System.Collections.Generic&quot; />

       <Message>This plugin assembly uses version 4.6.2 of the .NET Framework. At this time Microsoft Dynamics 365 requires version 4.5.2 of the .NET Framework for plugin assemblies. Rebuild this assembly using .NET Framework version 4.5.2 and try again.</Message>

       <Timestamp>2018-11-23T21:08:40.1398219Z</Timestamp>

       <ExceptionRetriable>false</ExceptionRetriable>

       <ExceptionSource i:nil="true" />

       <InnerFault i:nil="true" />

       <OriginalException i:nil="true" />

       <TraceText i:nil="true" />

     </InnerFault>

     <OriginalException i:nil="true" />

     <TraceText i:nil="true" />

    </OrganizationServiceFault>

    Server stack trace:

      at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc)

      at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)

      at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)

      at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)

    Exception rethrown at [0]:

      at Microsoft.Crm.Tools.Libraries.RegistrationHelper.UpdateAssembly(CrmOrganization org, String pathToAssembly, CrmPluginAssembly assembly, PluginType[] type)

      at Microsoft.Crm.Tools.AssemblyRegistration.PluginRegistrationViewModel.btnregisterClick(

    Thanks for your suggestion.

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…

Abhilash Warrier – Community Spotlight

We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
HR-09070029-0 Profile Picture

HR-09070029-0 2

#1
UllrSki Profile Picture

UllrSki 2

#3
ED-30091530-0 Profile Picture

ED-30091530-0 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans