locked
Plug-in registration: Trying to load a plug-in DLL with the plug-in registration tool always return an error RRS feed

  • Question

  • Hello,

    I am trying to register the Workflow from CRM Manipulation Library but every trime I try to register a plug-in I get the following error:

    Unhandled Exception: System.IO.FileLoadException: Could not load file or assembly 'file:///D:\CRM Updates\ManipulationLibrary.dll' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)
       at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
       at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks)
       at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark)
       at System.Reflection.Assembly.LoadFrom(String assemblyFile)
       at PluginRegistrationTool.AssemblyReader.LoadAssembly(String path)
       at PluginRegistrationTool.AssemblyReader.RetrievePluginsFromAssembly(String path)
       at PluginRegistrationTool.AssemblyReader.RetrievePluginsFromAssembly(String path)
       at PluginRegistrationTool.RegistrationHelper.RetrievePluginsFromAssembly(String pathToAssembly)
       at PluginRegistrationTool.PluginRegistrationForm.btnLoadAssembly_Click(Object sender, EventArgs e)
    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. See http://go.microsoft.com/fwlink/?LinkId=155569 for more information.

    UPDATE: What I am trying to do is load a plug-in DLL with the Plug-in registration tool so I can ultimately replace a deprecated plug-in dll which fails when I try to remove otherwise.

    any ideas?

    Regards,

    P.


    MCC, MCT, MCP, MCTS
    If you find this post helpful then please "Vote as Helpful". If I helped you with an answer to a question then please "Mark As Answer".


    • Edited by pmdci Tuesday, May 15, 2012 3:41 PM
    Tuesday, May 15, 2012 3:20 PM

Answers

  • The solution was to right click the DLL on the Windows Explorer, set its properties and UNBLOCK the file.

    Then I was able to register DLLS. Unfortunately I can't just replace an assembly with any other assembly, so I am back to square one on my main issue.

    but for registering plug-in DLLs, I sorted out the problem.


    MCC, MCT, MCP, MCTS
    If you find this post helpful then please "Vote as Helpful". If I helped you with an answer to a question then please "Mark As Answer".

    • Marked as answer by pmdci Tuesday, May 15, 2012 3:49 PM
    Tuesday, May 15, 2012 3:49 PM

All replies

  • Hi,

    I am assuming that you are doing the above registration step as per their readme document. There is a step before this, to import their solution. I have given below the screenshot from their readme document. If you haven't imported the solution please import it. If you have already imported their solution, have you published all the customizations after the import? If not try doing that and then registering he workflow.

    I hope this helps. If my response answered your question, please mark the response as an answer and also vote as helpful.


    Ashish Mahajan, CRM Developer, CSG (Melbourne)
    My Personal Website: http://www.ashishmahajan.com
    My Blogs: http://ashishmahajancrm.blogspot.com.au and http://ashishmahajancrm.wordpress.com
    My Youtube Channel: http://www.youtube.com/user/ashishmahajanmscrm

    My Linkedin: View Ashish Mahajan's profile on LinkedIn
    My Twitter: https://twitter.com/#!/ashishmahajan74

    Tuesday, May 15, 2012 3:34 PM
  • Actually I had only download the DLL and was trying to register it directly using the Plug-in registration tool.

    what I am trying to do is to ultimately replace a broken plug-in dll with a new one so I can delete the assembly from the CRM database.

    Regards,

    P.


    MCC, MCT, MCP, MCTS
    If you find this post helpful then please "Vote as Helpful". If I helped you with an answer to a question then please "Mark As Answer".

    Tuesday, May 15, 2012 3:37 PM
  • Ashish,

    the plug-in above was just an example. What I ultimately want to do is register a DLL with the plug-in registration tool. Never mind what the plug-in is.

    I need to do this so I can replace a deprecated plug-in which I can't remove otherwise.

    Anyway, the readme you pointed explains in section 2.2 that I could also load the assembly using the plug-in registration tool.

    • Edited by pmdci Tuesday, May 15, 2012 3:43 PM
    Tuesday, May 15, 2012 3:39 PM
  • Are you having issue in unregistering plugin ??, are you able to register any plugin at all with this plugin registeration tool.


    Mahain : Check My Blog
    Follow me on Twitter
    Make sure to "Vote as Helpful" and "Mark As Answer",if you get answer of your question.

    Tuesday, May 15, 2012 3:46 PM
    Moderator
  • The solution was to right click the DLL on the Windows Explorer, set its properties and UNBLOCK the file.

    Then I was able to register DLLS. Unfortunately I can't just replace an assembly with any other assembly, so I am back to square one on my main issue.

    but for registering plug-in DLLs, I sorted out the problem.


    MCC, MCT, MCP, MCTS
    If you find this post helpful then please "Vote as Helpful". If I helped you with an answer to a question then please "Mark As Answer".

    • Marked as answer by pmdci Tuesday, May 15, 2012 3:49 PM
    Tuesday, May 15, 2012 3:49 PM
  • ah.. this is becuase you downloaded dll.

    I can't just replace an assembly with any other assembly, so I am back to square one on my main issue- Are you are tying to update same assembly ??


    Mahain : Check My Blog
    Follow me on Twitter
    Make sure to "Vote as Helpful" and "Mark As Answer",if you get answer of your question.

    Tuesday, May 15, 2012 3:55 PM
    Moderator