Skip to main content

Dynamics365 PluginRegistration tool throws exception "System.IO.FileLoadException: Could not load file or assembly 'file:///C:\Users\...\xyz.dll' or one of its dependencies."

If you are facing below highlighted error detail with PluginRegistration meaning you are trying to register signed/unsigned dll download over the network. 
Unhandled Exception: System.IO.FileLoadException: Could not load file or assembly 'file:///C:\Users\\...\xyz.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, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)   at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, 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 Microsoft.Crm.Tools.Libraries.CrmAssemblyReader.LoadAssembly(String path)   at Microsoft.Crm.Tools.Libraries.CrmAssemblyReader.RetrievePluginsFromAssembly(String path)   at Microsoft.Crm.Tools.Libraries.CrmAssemblyReader.RetrievePluginsFromAssembly(String path)   at Microsoft.Crm.Tools.Libraries.RegistrationHelper.RetrievePluginsFromAssembly(String pathToAssembly, String appPath)   at Microsoft.Crm.Tools.AssemblyRegistration.PluginRegistrationViewModel.BtnLoadAssemblyClicked()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.


Quick fix would be to unblock the dll as shown in the below screenshot: 

Popular posts from this blog

Remote debugging Windows azure cloud service - Worker Role

Remote debugging Windows azure cloud service - Worker Role Very recently I was working on design and development of a worker role component of cloud service. Locally debugging worker role is pretty easy. You just need to know that you need to set Cloud project as a start-up project and ready to go. Problem is when you deploy worker role to azure and trying to troubleshoot an unknown issue.  Thankfully we have remote debugging enable for cloud services – both web and worker roles. This is really handy tool to remotely debug without having to putting a lot of tracing and digging into it. However, remote debugging in worker role/web role requires few steps to be followed: Make sure you are debugging from same machine where you published Make sure to turn on Remote debugger on while you publish (This should be turned off for Production publish profiles) Make sure to Select Debug mode With all the above settings after you publish, you should be able to Attach D

Differences between Object Serialization and Deserialization?

Serialization = putting the relevant state of the object into a streamable representation. That can mean converting it to a byte stream. This does not necessarily include copying every member variable into the stream. Deserialization = restoring an object from a serial representation and ensuring the invariants of the object. Deserialization can be thought of a separate constructor for the object.

Web-API - RESTful Services on Microsoft .net for building Ubiquitous web world

It's been very interesting to note about the fantastic things happening in the world of web development. Finally, we got the solid framework for building RESTful services on Microsoft platform. Let's have a very  quick look at the basic detail. REST [Representation State Transfer Protocol]           A representation is a opaque string of bytes that is effectively manifestation of a resource. REST was never about pretty URLs. The whole point of the hypermedia is that client should not need to know how to construct these URLs in the first place. For your clients, they are just STRINGS.           Web-API can be used when you have clients which consumes data from server over HTTP. Now a days, lot of browser applications are rich clients with web server returns some static html and then may be it uses client side framework like jquery, backbonejs or knockoutjs and makes calls back to server to pull data to execute some client-side functionality. Web-API's role is not j