Views:

Applies to Product - Power Automate


What’s happening?
Error when updating a custom DLL file for a class library built on .NET Framework in Power Automate Desktop. The error message states, "Could not load file or assembly '..., Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified."


Reason:
This is related to how Power Automate Desktop (PAD) behaves when referencing a DLL. Specifically, the error occurs when the updated DLL is loaded, which works correctly when called from a console application. The logs indicate that an attempt was made to load an assembly from a network location, which may cause the assembly to be sandboxed in previous versions of the .NET Framework. The current version of the .NET Framework does not enable Code Access Security (CAS) policy by default, which may lead to this loading issue.


Resolution:

  1. Ensure that all DLLs and their dependencies are present in the folder from which the flow loads them.
  2. Check the properties of the DLL file and click 'Unblock' if the option is available.
  3. If this persists, enable the loadFromRemoteSources switch in the application configuration file to allow loading assemblies from network locations. For more information, refer to the documentation.
  4. Review the error logs for any additional details that may indicate further issues with assembly loading.
.