CefSharp icon indicating copy to clipboard operation
CefSharp copied to clipboard

Feature Request - Minor Self Update at Runtime

Open amaitland opened this issue 5 years ago • 2 comments

I have yet to prove this is possible, so there is a chance this issue will be closed if it's deemed technically impossible.


For each major release there are a number of minor releases, usually these include an updated chromium version, often with security fixes. In theory there should be no breaking changes in these releases, so downloading and overriding the CefSharp/CEF dlls at runtime should be possible.

  • [ ] Manually test using minimal example

If the manual test is successful then there are a number of consideration

  • Versioning of old files to allow rollback
  • Write permissions
  • Update checks
  • Background downloading
  • Binary diff

amaitland avatar Aug 13 '21 00:08 amaitland

For the full .Net Framework is appears that the C++/CLI dll requires a Binding Redirect to load correctly. The managed dlls don't appear to have a problem, just CefSharp.Core.Runtime.dll won't load correctly without a redirect for CefSharp.dll (it's only dependency).

<?xml version="1.0"?>
<configuration>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2"/>
  </startup>

  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="CefSharp" publicKeyToken="40c4b6fc221f4138" culture="neutral" />
        <bindingRedirect oldVersion="93.1.111.0" newVersion="93.1.140.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
</configuration>

So technically possible, this likely makes it impractical as rewriting the app.config at runtime would require permissions to do so.

I haven't tested with .Net Core/.Net 5.0 yet, the loader mechanism is different, so additional testing is required.

amaitland avatar Sep 21 '21 23:09 amaitland

.Net Core 3.1 appears to be more promising, simply replacing the files without modifying the .deps.json file appears to work as expected for a Debug build, not sure if this will be different when it's published.

amaitland avatar Sep 21 '21 23:09 amaitland