简体   繁体   English

带有强命名二进制文件的 CefSharp

[英]CefSharp with Strong-Named binaries

Everything works on machines where the .NET Framework registry key AllowStrongNameBypass is enabled.一切都在启用了 .NET Framework 注册表项AllowStrongNameBypass机器上AllowStrongNameBypass However, we require that the AllowStrongNameBypass be disabled on our deployed environment.但是,我们要求在我们部署的环境中禁用AllowStrongNameBypass

We need to have CefSharp.BrowserSubProcess.exe and its unmanaged dependencies Strong-Named (preferably WITHOUT building CefSharp ourselves).我们需要CefSharp.BrowserSubProcess.exe及其非托管依赖项 Strong-Named(最好不要自己构建 CefSharp)。

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 .作为测试,我们尝试通过使用ildasm.exe反汇编CefSharp.BrowserSubProcess.exe并使用ilasm.exe和使用sn.exe生成的密钥重新组装它来自己为程序集提供强名称密钥。 Unfortunately, this failed with MethodAccessException .不幸的是,这失败了MethodAccessException

Is there an available version of CefSharp where the assemblies are Strong-Named or a way around this issue?是否有可用的 CefSharp 版本,其中程序集是强命名的或解决此问题的方法?

CefSharp appears to have some invalid strong named assemblies. CefSharp 似乎有一些无效的强命名程序集。 As @Fizz points out the post build step for CefSharp.BrowserSubProcess.exe under the 32-bit platform is the cause of this.正如@Fizz 指出 32 位平台下CefSharp.BrowserSubProcess.exe的后期构建步骤是造成这种情况的原因。

Re-sign the problem assemblies with the CefSharp.snk key available in the CefSharp GitHub repo.使用 CefSharp GitHub 存储库中提供的 CefSharp.snk 密钥对问题程序集重新签名。 You can re-sign them with the following command:您可以使用以下命令对它们重新签名:

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM