locked
Loading assembly problem on CRM 2011 plugin registration tool RRS feed

  • Question

  • Hi,

    I'm trying to register my plug-in by using plugin registration tool . I had this error:

    Unhandled Exception: System.IO.FileLoadException: Could not load file or assembly 'file:///path/PluginRegistration.exe' or one of its dependencies. Operation is not supported.

    Inner Exception: System.NotSupportedException: An attempt was made to load an assembly from a network location which would have caused the assembly to be sandboxed in previous versions of the .NET Framework. This release of the .NET Framework does not enable CAS policy by default, so this load may be dangerous. If this load is not intended to sandbox the assembly, please enable the loadFromRemoteSources switch.

    I made a change on app.config and i added this code:

    <

    runtime>

    <

    loadFromRemoteSources enabled="true"/>

    </

    runtime>.I still have the same error. Thanks for help

    Friday, July 17, 2015 12:45 PM

Answers

  • I would say copy your assembly from a local directory.  If you are downloading it from the itnernet you might have to do something funky like right click the assembly show properties, and unblock it before you then try to load it also.  I personally have never really tried to register a plugin from a remote location.
    • Marked as answer by dc74 Tuesday, August 4, 2015 10:22 AM
    Friday, July 17, 2015 1:28 PM
    Moderator
  • Hi mate,

    Try this

    • Right click the plugin registration tool exe file
    • Click properties
    • File has been 'blocked' - right click and press 'unblock'

    Regards,

    Darrel

    Please Vote as helpful or Mark as answer if this reply has assisted you in any way.

    • Marked as answer by dc74 Tuesday, August 4, 2015 10:22 AM
    Tuesday, July 21, 2015 12:16 AM

All replies

  • I would say copy your assembly from a local directory.  If you are downloading it from the itnernet you might have to do something funky like right click the assembly show properties, and unblock it before you then try to load it also.  I personally have never really tried to register a plugin from a remote location.
    • Marked as answer by dc74 Tuesday, August 4, 2015 10:22 AM
    Friday, July 17, 2015 1:28 PM
    Moderator
  • Hi mate,

    Try this

    • Right click the plugin registration tool exe file
    • Click properties
    • File has been 'blocked' - right click and press 'unblock'

    Regards,

    Darrel

    Please Vote as helpful or Mark as answer if this reply has assisted you in any way.

    • Marked as answer by dc74 Tuesday, August 4, 2015 10:22 AM
    Tuesday, July 21, 2015 12:16 AM
  • Thanks. i unblocked it but now i had another issue when i tried to register a step

    Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=5.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: Unable to load the plugin type: CreateSiteSharePoint.UpdateAccount
    Detail: <OrganizationServiceFault xmlns="http://schemas.microsoft.com/xrm/2011/Contracts" xmlns:i="http://www.w3.org/2001/XMLSchema-instance">
      <ErrorCode>-2147204720</ErrorCode>
      <ErrorDetails xmlns:a="http://schemas.datacontract.org/2004/07/System.Collections.Generic">
        <KeyValuePairOfstringanyType>
          <a:key>CallStack</a:key>
          <a:value i:type="b:string" xmlns:b="http://www.w3.org/2001/XMLSchema">   at Microsoft.Crm.Extensibility.VersionedPluginProxyStepBase.Execute(PipelineExecutionContext context)
       at Microsoft.Crm.Extensibility.Pipeline.Execute(PipelineExecutionContext context)
       at Microsoft.Crm.Extensibility.MessageProcessor.Execute(PipelineExecutionContext context)
       at Microsoft.Crm.Extensibility.InternalMessageDispatcher.Execute(PipelineExecutionContext context)
       at Microsoft.Crm.Extensibility.ExternalMessageDispatcher.ExecuteInternal(IInProcessOrganizationServiceFactory serviceFactory, IPlatformMessageDispatcherFactory dispatcherFactory, String messageName, String requestName, Int32 primaryObjectTypeCode, Int32 secondaryObjectTypeCode, ParameterCollection fields, CorrelationToken correlationToken, CallerOriginToken originToken, UserAuth userAuth, Guid callerId, Guid transactionContextId, Int32 invocationSource, Nullable`1 requestId, Version endpointVersion)
       at Microsoft.Crm.Extensibility.OrganizationSdkServiceInternal.ExecuteRequest(OrganizationRequest request, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType, UserAuth userAuth, Guid targetUserId, Boolean traceRequest, OrganizationContext context, Boolean returnResponse)
       at Microsoft.Crm.Extensibility.OrganizationSdkServiceInternal.ExecuteRequest(OrganizationRequest request, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType)
       at Microsoft.Crm.Extensibility.OrganizationSdkServiceInternal.Create(Entity entity, CorrelationToken correlationToken, CallerOriginToken callerOriginToken, WebServiceType serviceType)</a:value>
        </KeyValuePairOfstringanyType>
      </ErrorDetails>
      <Message>Unable to load the plugin type: CreateSiteSharePoint.UpdateAccount</Message>
      <Timestamp>2015-08-04T10:24:28.5352017Z</Timestamp>
      <InnerFault>
        <ErrorCode>-2147204720</ErrorCode>
        <
       at PluginRegistrationTool.StepRegistrationForm.btnRegister_Click(Object sender, EventArgs e)

    Tuesday, August 4, 2015 10:28 AM