Outlook Cannot load file or assembly CefSharp.Core.dll

534 views Asked by At

I am trying to host CefSharp.Winform (Chromium web browser control for winform) in VSTO Outlook addin using VS2015 with no success.

The steps I am following are:

  1. Create a outlook 2013 addin project.
  2. change solution setting from any CPU to x86
  3. install CefSharp.Winfom using nugget.
  4. Access Cef, such as cef.initialize() in code.
  5. compile the project without error.

But when run the addin, it gives error of "Cannot load file or assembly CefSharp.Core.dll or one of the dependencies.."

I have compiled the sample winform project and run it without an issue. Also, I have tried to copy all dependency from winform project to outlook and still there is a same issue.

Any idea how to get CefSharp.WinForm to work in addin environment?

1

There are 1 answers

3
Eugene Astafiev On

First of all, I'd suggest leaving the target platform set to AnyCPU.

Second, you can enable Fusion logs to detect missing dependencies. To enable Fusion logs, you can either use the “Assembly Binding Log Viewer” (fuslogvw) .NET framework tool or make registry entries to enable logging.

Here are the registry entries that need to be made:

a) Open regedit and browse to “HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Fusion”

b) Create a DWORD value by name “EnableLog” and set its value to 1.

c) Create a DWORD value by name “ForceLog” and set its value to 1.

d) Create a DWORD value by name “LogFailures” and set its value to 1.

e) Create a String value by name “LogPath” and set its value to “c:\Fusion”

f) Create the folder “c:\Fusion”

After reproducing the issue, look at each of the files created under “C:\Fusion\ Default \\” folder. Fix any failures and retry. To know more about Assembly Binding Log Viewer (fuslogvw), please refer to Assembly Binding Log Viewer (Fuslogvw.exe).