What also might help is a code fix in the method “VerifyInteropCompatibility” method of the UiFactory class.
Version version1 = File.Exists(Path.Combine(this.NativeLibrariesFolder, fileName)) ? AssemblyName.GetAssemblyName(Path.Combine(this.NativeLibrariesFolder, "UiPath.Interop.dll")).Version : throw new Exception(string.Format("Custom UiPath native libraries base folder: '{0}' does not contain '{1}'.", this.NativeLibrariesFolder, fileName));
this.NativeLibrariesFolder translates to registry key “UIPATH_RUNTIME” which is set to: “C:\Users\XXXXXX.nuget\packages\uipath\20.10.XXXX.XXXXX\build\UiPath”. But in this folder the “UiPath.Interop.dll” is not present.
So either the UiPath.Interop.dll needs to be placed in this folder when installing UiPath (I did re-install UiPath twice in hope it would resolve the error.) or the code for calling the Interop Library should be changed to:
Version version1 = File.Exists(Path.Combine(this.NativeLibrariesFolder, fileName)) ? AssemblyName.GetAssemblyName(Path.GetFullPath(Path.Combine(this.NativeLibrariesFolder, "..\..\lib\UiPath.Interop.dll"))).Version : throw new Exception(string.Format("Custom UiPath native libraries base folder: '{0}' does not contain '{1}'.", this.NativeLibrariesFolder, fileName));
For your information this error started occuring when enabling the ‘Modern Design Experience’ in the project settings. I must say, it is quite an experience.
What solved the issue for me in the end is copying the UiPath.Interop.dll from the lib folder
Follow the below steps:
1)Just open “Project output folder”.
2)close the UiPath project
3)and delete all the folder starting with dot “.” ex: .nuget. in “project output folder”. 4)Now open the studio and run it, it will work for sure