Search code examples
c#cefsharpstrongname

CefSharp with Strong-Named binaries


Everything works on machines where the .NET Framework registry key AllowStrongNameBypass is enabled. However, we require that the AllowStrongNameBypass be disabled on our deployed environment.

We need to have CefSharp.BrowserSubProcess.exe and its unmanaged dependencies Strong-Named (preferably WITHOUT building CefSharp ourselves).

As a test, we tried giving the assemblies Strong-Name keys ourselves by disassembling CefSharp.BrowserSubProcess.exe using ildasm.exe and reassembling it using ilasm.exe and a key generated using sn.exe. Unfortunately, this failed with MethodAccessException.

Is there an available version of CefSharp where the assemblies are Strong-Named or a way around this issue?


Solution

  • CefSharp appears to have some invalid strong named assemblies. As @Fizz points out the post build step for CefSharp.BrowserSubProcess.exe under the 32-bit platform is the cause of this.

    Re-sign the problem assemblies with the CefSharp.snk key available in the CefSharp GitHub repo. You can re-sign them with the following command:

    sn.exe -R CefSharp.BrowserSubProcess.exe [CefSharp key]