Cannot Run Invoke Code on Studio v18.2.0 Error compiling code BC2000 NLog.dll

Hello, I just updated to 18.2.0 this morning and suddenly cannot run Invoke Code even just showing a message box. Opened the previous working workflows with Invoke Code too and it threw the same error:

XXX has thrown an exception
Source: Invoke code
Message: Error compiling code
error BC2000: 予期しないコンパイラ初期化エラーが発生しました: プロジェクトには既にアセンブリ NLog への参照が指定されています。'C:\Users\MyRobo\AppData\Local\UiPath\app-18.2.0-beta0011\NLog.dll' への 2 番目の参照を追加することはできません。 At line -27


Exception Type: ArgumentException

System.ArgumentException: Error compiling code
error BC2000: 予期しないコンパイラ初期化エラーが発生しました: プロジェクトには既にアセンブリ NLog への参照が指定されています。'C:\Users\MyRobo\AppData\Local\UiPath\app-18.2.0-beta0011\NLog.dll' への 2 番目の参照を追加することはできません。 At line -27

   at UiPath.Core.Activities.Workflow.CompilerRunner.Compile(String code, Int32 errLineOffset, Boolean generateInMemory)
   at UiPath.Core.Activities.Workflow.CompilerRunner..ctor(String code, String className, String methodName, Int32 errLineOffset, Boolean generateInMemory)
   at UiPath.Core.Activities.InvokeCode.GetCompilerRunner(String userCode, List`1 args, String imps)
   at UiPath.Core.Activities.InvokeCode.Execute(CodeActivityContext context)
   at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager)
   at System.Activities.ActivityInstance.Execute(ActivityExecutor executor, BookmarkManager bookmarkManager)
   at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)

It seems like the NLog assembly is already defined in the project, and we cannot add the second declaration on ‘C:\Users\MyRobo\AppData\Local\UiPath\app-18.2.0-beta0011\NLog.dll’ at line -27.

I checked the app-18.2.0-beta0011\NLog.dll and cannot seem to open it by text editor. Is there something I am missing in upgrading to 18.2.0?

Still cannot resolve the problem, sorry for direct mentioning but may be you could help me on this, @ovi ?

Hello,

This issue is related to missing activities. I have seen similar issue with my project last month, my workflow was working well without any issue and suddenly found that it started giving error message related to <>.DLL

We have raised the ticket with UiPath, They have suggested to validate missing packages or dependent packages. We verified and found all packages are in place.

Finally we uninstall Uipath Studio and Reinstalled, It resolved the issue without any code.

To me, this issue looks same. If it is possible, I would recommend you to reinstall UiPath Studio to resolve this issue.

If you are running this process on unattended bot, I would recommend you to install UiPath Studio, compile the code, run it and uninstall studio.

Regards
Pawan

Thank you @pawanbag, it resolved my problem.
I don’t know exactly which one the problem was, but reinstalling then reupdating the Studio and installing previously used activities helped.