FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

AnyCPU - Simplify support via ModuleInitializer by amaitland · Pull Request #4063 · cefsharp/CefSharp · GitHub

AnyCPU - Simplify support via ModuleInitializer - #4063

Open
amaitland wants to merge 2 commits into
cefsharp:masterfrom
amaitland:anycpu/simplify
Open

AnyCPU - Simplify support via ModuleInitializer#4063
amaitland wants to merge 2 commits into
cefsharp:masterfrom
amaitland:anycpu/simplify

Conversation

amaitland commented Apr 13, 2022
edited
Loading

Copy link
Copy Markdown
Member

Summary:
Now that we use the SDK Style csproj files and target VS2019 we can use a custom attribute
(same as in .Net Core 3.1) to get the compiler to output a ModuleInitializer.
ModuleInitializer can be used to resolve AnyCpu dlls at runtime. Should greatly simplify AnyCpu
support.

Changes:

  • Checks if the Assembly.GetEntryAssembly() is MSIL
  • Change CefSharp.Core.csproj to use LangVersion 9 so we can get the compiler to output
    the ModuleInitializer
  • Remove CefSharpPlatformCheck and other CefSharpAnyCpuSupport checks
  • CefSharp.Common.targets still has CefSharpAnyCpuSupport references for backwards compatibility with those with it set and Prefer32bit
    The default behaviour for this case is to simply copy the 32bit libs
  • Calling CefRuntime.SubscribeAnyCpuAssemblyResolver multiple times now will simply Unsubscribe the previous resolver

How Has This Been Tested?
Further testing required.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Updated documentation

Checklist:

  • Tested the code(if applicable)
  • Commented my code
  • Changed the documentation(if applicable)
  • New files have a license disclaimer
  • The formatting is consistent with the project (project supports .editorconfig)

Reference:

Copy link
Copy Markdown
Member Author

This will need more testing before merging.

Copy link
Copy Markdown

- Checks if the Assembly.GetEntryAssembly() is MSIL
- Change CefSharp.Core.csproj to use LangVersion 9 so we can get the compiler to output
  the ModuleInitializer
- Remove CefSharpPlatformCheck and other CefSharpAnyCpuSupport checks
- CefSharp.Common.targets still has CefSharpAnyCpuSupport references for backwards compatibility with those with it set and Prefer32bit
  The default behaviour for this case is to simply copy the 32bit libs
- Calling CefRuntime.SubscribeAnyCpuAssemblyResolver multiple times now will simply Unsubscribe the previous resolver

This change should remove the need for users to perform any action when supporting AnyCpu.

Copy link
Copy Markdown

amaitland changed the title AnyCPU - Simply support via ModuleInitializer AnyCPU - Simplify support via ModuleInitializer Apr 13, 2022
amaitland modified the milestones: 101.0.x, 102.0.x May 3, 2022
amaitland removed this from the 102.0.x milestone May 30, 2022

Copy link
Copy Markdown
Member Author

On the MSBuild related code, rather than aggressively removing the code, we could just set the value to True effectively disabling the checks, just incase they needed to be rolled back quickly. Then actively removed at a later point in time.

Some additional extensibility points for the user and an even that'll make it easier to debug when the module initializer has run, possibly the ability to cancel it's execution allowing the user to perform their own action directly.

  • Allow event to trigger when module initializer has run (with option to cancel the execution)
  • Allow path configuration
  • Default CefSharpAnyCpuSupport to true for short term.

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants


Back | FazBrowse Home | New Git URL