How to resolve error Could not load assembly in C#

How to resolve error Could not load assembly in C#

There are two ways to load assembly in the C# block - from file and from GAC (Global Assembly Cache).

At times, you could face an error "Could not load assembly" while trying to load an assembly from a file. In that case, follow the steps below -

  1. Right-click on the DLL file at your end and check the Unblock checkbox and save/Apply.

  2. After applying, close your Leapwork studio after saving all the test flows.

  3. Go to the folder path C:\Program Files\Leapwork\Studio and open the LEAPWORK.AutomationStudio.exe.config file.

  4. Scroll to the last of this config file and add this tag in the config file; in case the tag is already present, make sure the value is set as "true".

  5. Save the config file and then open the studio and try to add the DLL.

In case where you are trying to add an assembly directly from GAC and face a similar issue, check the version of the assembly you are trying to load if it's present in GAC or not.

For any clarification, please contact our Priority Support.