Skip to content

Commit

Permalink
Upgrade to CefSharp 88.2.90
Browse files Browse the repository at this point in the history
- Remove x86/x64 platforms from the solution
- Chromely.CefSharp.Integration.TestApp sets RuntimeIdentifier
- Change TargetFrameworks to net462;netcoreapp3.1;net5.0-windows

**KNOWN ISSUES**
- The generated Nuget package has exclude buildTransitive set which will likely break the package (not tested, though very likely)
  The CefSharp.Common.NETCore.targets included in the buildTransitive has a hack to support AnyCPU which adds package references
  directly to the chromiumembeddedframework.runtime.win-x64 and chromiumembeddedframework.runtime.win-x86 packages
  Will need to add some configuration options to CefSharp to disable this behaviour, I've added a task to cefsharp/CefSharp#3388
  • Loading branch information
amaitland committed Mar 5, 2021
1 parent a458089 commit 09b9a12
Show file tree
Hide file tree
Showing 6 changed files with 51 additions and 79 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,21 @@
<TargetFramework>netcoreapp3.1</TargetFramework>
<UseWindowsForms>true</UseWindowsForms>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<Platforms>x64</Platforms>
<ApplicationIcon>chromely.ico</ApplicationIcon>
<!--
When RuntimeIdentifier specified SelfContained defaults to true, which copies the whole runtime
to our bin folder, for purposes of this example set to false
-->
<RuntimeIdentifier Condition="'$(RuntimeIdentifier)' == ''">$(NETCoreSdkRuntimeIdentifier)</RuntimeIdentifier>
<SelfContained>false</SelfContained>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CefSharp.Common" Version="86.0.241" />
<PackageReference Include="CefSharp.Common" Version="88.2.90" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="3.1.5" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.5" />
<PackageReference Include="Microsoft.Extensions.Logging.Console" Version="3.1.5" />
<PackageReference Include="System.Text.Json" Version="4.7.2" />
<PackageReference Include="System.Text.Json" Version="5.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion src/Chromely.CefSharp/Browser/ChromiumBrowser.Dispose.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ private void InternalDispose(bool disposing)
}

//Dispose of BrowserSettings if we created it, if user created then they're responsible
if (_browserSettings != null && _browserSettings.FrameworkCreated)
if (_browserSettings != null && _browserSettings.AutoDispose)
{
_browserSettings.Dispose();
}
Expand Down
5 changes: 2 additions & 3 deletions src/Chromely.CefSharp/Browser/ChromiumBrowser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public abstract partial class ChromiumBrowser : IWebBrowserInternal
/// <summary>
/// The managed cef browser adapter
/// </summary>
protected ManagedCefBrowserAdapter _managedCefBrowserAdapter;
protected IBrowserAdapter _managedCefBrowserAdapter;
/// <summary>
/// The browser
/// </summary>
Expand Down Expand Up @@ -82,7 +82,6 @@ public ChromiumBrowser(IChromelyNativeHost nativeHost, IChromelyConfiguration co
{
NativeHost = nativeHost;
_config = config;
CefSharpSettings.LegacyJavascriptBindingEnabled = false;
}

public IChromelyNativeHost NativeHost { get; private set; }
Expand Down Expand Up @@ -404,7 +403,7 @@ private void InitializeFieldsAndCefIfRequired()
_browserSettings = new BrowserSettings();
}

_managedCefBrowserAdapter = new ManagedCefBrowserAdapter(this, false);
_managedCefBrowserAdapter = ManagedCefBrowserAdapter.Create(this, false);

_initialized = true;
}
Expand Down
47 changes: 33 additions & 14 deletions src/Chromely.CefSharp/Chromely.CefSharp.csproj
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.0;netstandard2.1</TargetFrameworks>
<CefSharpAnyCpuSupport>true</CefSharpAnyCpuSupport>
<TargetFrameworks>net462;netcoreapp3.1;net5.0-windows</TargetFrameworks>
<CefSharpBuildAction>NoAction</CefSharpBuildAction>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>None</ResolveAssemblyWarnOrErrorOnTargetArchitectureMismatch>
<ProductVersion>5.1.86.0</ProductVersion>
<AssemblyVersion>5.1.86.0</AssemblyVersion>
<FileVersion>5.1.86.0</FileVersion>
<Version>5.1.86.0</Version>
<ProductVersion>5.1.88.0</ProductVersion>
<AssemblyVersion>5.1.88.0</AssemblyVersion>
<FileVersion>5.1.88.0</FileVersion>
<Version>5.1.88.0</Version>
<Authors>Chromely Projects</Authors>
<Company>Chromely Projects</Company>
<Description>Chromely CefSharp implementation - this is in NetStandard as it can be used in both .NET Framework, .NET Core 3 and .NET 5 (Windows Only). Chromely.CefSharp version naming is based Chromely and Chromium versions implemented- major.minor.chromuim version.patch e.g 1.0.71.0.</Description>
<Copyright>Copyright © 2017-2020 Chromely Projects</Copyright>
<Description>Chromely CefSharp implementation - can be used in .Net 4.6.2, .NET Core 3.1 and .NET 5 (Windows Only) projects. Chromely.CefSharp version naming is based Chromely and Chromium versions implemented- major.minor.chromuim version.patch e.g 1.0.71.0.</Description>
<Copyright>Copyright © 2017-2021 Chromely Projects</Copyright>
<PackageLicenseUrl>https://github.com/chromelyapps/Chromely/blob/master/LICENSE.md</PackageLicenseUrl>
<PackageProjectUrl>https://github.com/chromelyapps/CefSharp</PackageProjectUrl>
<PackageIconUrl>https://github.com/chromelyapps/Chromely/blob/master/nugets/chromely.ico?raw=true</PackageIconUrl>
<PackageTags>CEF Chromium HTML5 Desktop Chromely CefSharp NetStandard .NET Core 3 .NET 5</PackageTags>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageReleaseNotes>
- Breaking changes.
- Fixes for frameless window - https://github.com/chromelyapps/Chromely/issues/266
- Upgraded to CefSharp/Chromium v86.
- Upgraded to CefSharp/Chromium v88.
- Can no longer target .Net Standard, must target .Net 4.6.2 or .Net Core 3.1 or .Net 5.0
- Update to System.Text.Json 5.0.0 (Required by CefSharp).
</PackageReleaseNotes>
<RepositoryType>Github Repository</RepositoryType>
<RepositoryUrl>https://github.com/chromelyapps/CefSharp</RepositoryUrl>
<Configurations>Debug;Release;ReleaseLinux;DebugLinux</Configurations>
<Configurations>Debug;Release;</Configurations>
<Platforms>AnyCPU</Platforms>
</PropertyGroup>

Expand All @@ -42,13 +42,32 @@
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' == 'NET462'">
<DefineConstants>$(DefineConstants);NET462</DefineConstants>
</PropertyGroup>

<PropertyGroup Condition=" '$(TargetFramework)' != 'NET462'">
<DefineConstants>$(DefineConstants);NETCOREAPP</DefineConstants>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net462'">
<PackageReference Include="CefSharp.Common" Version="88.2.90">
<ExcludeAssets>buildTransitive</ExcludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' != 'net462'">
<PackageReference Include="CefSharp.Common.NETCore" Version="88.2.90">
<ExcludeAssets>buildTransitive</ExcludeAssets>
</PackageReference>
</ItemGroup>

<ItemGroup>
<PackageReference Include="CefSharp.Common" Version="86.0.241" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="3.1.5" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="3.1.5" />
<PackageReference Include="Microsoft.CSharp" Version="4.6.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="3.1.5" />
<PackageReference Include="System.Text.Json" Version="4.7.2" />
<PackageReference Include="System.Text.Json" Version="5.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
5 changes: 5 additions & 0 deletions src/Chromely.CefSharp/Window.Services.cs
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,12 @@ protected virtual void RegisterJsHandlers()
{
var bindingOptions = handler.BindingOptions as BindingOptions;
bindingOptions = bindingOptions ?? BindingOptions.DefaultBinder;
#if NET462
repo.Register(name: handler.ObjectName, objectToBind: handler.BoundObject, isAsync: true, options: bindingOptions);
#else
repo.Register(name: handler.ObjectName, objectToBind: handler.BoundObject, options: bindingOptions);
#endif

}
else
{
Expand Down
60 changes: 2 additions & 58 deletions src/ChromelyCefSharp.sln
Original file line number Diff line number Diff line change
Expand Up @@ -17,91 +17,35 @@ EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
DebugLinux|Any CPU = DebugLinux|Any CPU
DebugLinux|x64 = DebugLinux|x64
DebugLinux|x86 = DebugLinux|x86
Release|Any CPU = Release|Any CPU
Release|x64 = Release|x64
Release|x86 = Release|x86
ReleaseLinux|Any CPU = ReleaseLinux|Any CPU
ReleaseLinux|x64 = ReleaseLinux|x64
ReleaseLinux|x86 = ReleaseLinux|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{D13B0961-3627-4428-BB9B-72F8E7023EAE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{D13B0961-3627-4428-BB9B-72F8E7023EAE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D13B0961-3627-4428-BB9B-72F8E7023EAE}.Debug|x64.ActiveCfg = Debug|Any CPU
{D13B0961-3627-4428-BB9B-72F8E7023EAE}.Debug|x64.Build.0 = Debug|Any CPU
{D13B0961-3627-4428-BB9B-72F8E7023EAE}.Debug|x86.ActiveCfg = Debug|Any CPU
{D13B0961-3627-4428-BB9B-72F8E7023EAE}.Debug|x86.Build.0 = Debug|Any CPU
{D13B0961-3627-4428-BB9B-72F8E7023EAE}.DebugLinux|Any CPU.ActiveCfg = DebugLinux|Any CPU
{D13B0961-3627-4428-BB9B-72F8E7023EAE}.DebugLinux|Any CPU.Build.0 = DebugLinux|Any CPU
{D13B0961-3627-4428-BB9B-72F8E7023EAE}.DebugLinux|x64.ActiveCfg = DebugLinux|Any CPU
{D13B0961-3627-4428-BB9B-72F8E7023EAE}.DebugLinux|x64.Build.0 = DebugLinux|Any CPU
{D13B0961-3627-4428-BB9B-72F8E7023EAE}.DebugLinux|x86.ActiveCfg = DebugLinux|Any CPU
{D13B0961-3627-4428-BB9B-72F8E7023EAE}.DebugLinux|x86.Build.0 = DebugLinux|Any CPU
{D13B0961-3627-4428-BB9B-72F8E7023EAE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D13B0961-3627-4428-BB9B-72F8E7023EAE}.Release|Any CPU.Build.0 = Release|Any CPU
{D13B0961-3627-4428-BB9B-72F8E7023EAE}.Release|x64.ActiveCfg = Release|Any CPU
{D13B0961-3627-4428-BB9B-72F8E7023EAE}.Release|x64.Build.0 = Release|Any CPU
{D13B0961-3627-4428-BB9B-72F8E7023EAE}.Release|x86.ActiveCfg = Release|Any CPU
{D13B0961-3627-4428-BB9B-72F8E7023EAE}.Release|x86.Build.0 = Release|Any CPU
{D13B0961-3627-4428-BB9B-72F8E7023EAE}.ReleaseLinux|Any CPU.ActiveCfg = ReleaseLinux|Any CPU
{D13B0961-3627-4428-BB9B-72F8E7023EAE}.ReleaseLinux|Any CPU.Build.0 = ReleaseLinux|Any CPU
{D13B0961-3627-4428-BB9B-72F8E7023EAE}.ReleaseLinux|x64.ActiveCfg = ReleaseLinux|Any CPU
{D13B0961-3627-4428-BB9B-72F8E7023EAE}.ReleaseLinux|x64.Build.0 = ReleaseLinux|Any CPU
{D13B0961-3627-4428-BB9B-72F8E7023EAE}.ReleaseLinux|x86.ActiveCfg = ReleaseLinux|Any CPU
{D13B0961-3627-4428-BB9B-72F8E7023EAE}.ReleaseLinux|x86.Build.0 = ReleaseLinux|Any CPU
{49A3A157-59CB-48E4-9DF8-BA1FF5F86A39}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{49A3A157-59CB-48E4-9DF8-BA1FF5F86A39}.Debug|Any CPU.Build.0 = Debug|Any CPU
{49A3A157-59CB-48E4-9DF8-BA1FF5F86A39}.Debug|x64.ActiveCfg = Debug|Any CPU
{49A3A157-59CB-48E4-9DF8-BA1FF5F86A39}.Debug|x64.Build.0 = Debug|Any CPU
{49A3A157-59CB-48E4-9DF8-BA1FF5F86A39}.Debug|x86.ActiveCfg = Debug|Any CPU
{49A3A157-59CB-48E4-9DF8-BA1FF5F86A39}.Debug|x86.Build.0 = Debug|Any CPU
{49A3A157-59CB-48E4-9DF8-BA1FF5F86A39}.DebugLinux|Any CPU.ActiveCfg = Debug|Any CPU
{49A3A157-59CB-48E4-9DF8-BA1FF5F86A39}.DebugLinux|Any CPU.Build.0 = Debug|Any CPU
{49A3A157-59CB-48E4-9DF8-BA1FF5F86A39}.DebugLinux|x64.ActiveCfg = Debug|Any CPU
{49A3A157-59CB-48E4-9DF8-BA1FF5F86A39}.DebugLinux|x64.Build.0 = Debug|Any CPU
{49A3A157-59CB-48E4-9DF8-BA1FF5F86A39}.DebugLinux|x86.ActiveCfg = Debug|Any CPU
{49A3A157-59CB-48E4-9DF8-BA1FF5F86A39}.DebugLinux|x86.Build.0 = Debug|Any CPU
{49A3A157-59CB-48E4-9DF8-BA1FF5F86A39}.Release|Any CPU.ActiveCfg = Release|Any CPU
{49A3A157-59CB-48E4-9DF8-BA1FF5F86A39}.Release|Any CPU.Build.0 = Release|Any CPU
{49A3A157-59CB-48E4-9DF8-BA1FF5F86A39}.Release|x64.ActiveCfg = Release|Any CPU
{49A3A157-59CB-48E4-9DF8-BA1FF5F86A39}.Release|x64.Build.0 = Release|Any CPU
{49A3A157-59CB-48E4-9DF8-BA1FF5F86A39}.Release|x86.ActiveCfg = Release|Any CPU
{49A3A157-59CB-48E4-9DF8-BA1FF5F86A39}.Release|x86.Build.0 = Release|Any CPU
{49A3A157-59CB-48E4-9DF8-BA1FF5F86A39}.ReleaseLinux|Any CPU.ActiveCfg = Release|Any CPU
{49A3A157-59CB-48E4-9DF8-BA1FF5F86A39}.ReleaseLinux|Any CPU.Build.0 = Release|Any CPU
{49A3A157-59CB-48E4-9DF8-BA1FF5F86A39}.ReleaseLinux|x64.ActiveCfg = Release|Any CPU
{49A3A157-59CB-48E4-9DF8-BA1FF5F86A39}.ReleaseLinux|x64.Build.0 = Release|Any CPU
{49A3A157-59CB-48E4-9DF8-BA1FF5F86A39}.ReleaseLinux|x86.ActiveCfg = Release|Any CPU
{49A3A157-59CB-48E4-9DF8-BA1FF5F86A39}.ReleaseLinux|x86.Build.0 = Release|Any CPU
{5DD9EF52-6E7E-4818-99CB-3FC40B2FE4E0}.Debug|Any CPU.ActiveCfg = Debug|x64
{5DD9EF52-6E7E-4818-99CB-3FC40B2FE4E0}.Debug|Any CPU.Build.0 = Debug|x64
{5DD9EF52-6E7E-4818-99CB-3FC40B2FE4E0}.Debug|x64.ActiveCfg = Debug|x64
{5DD9EF52-6E7E-4818-99CB-3FC40B2FE4E0}.Debug|x64.Build.0 = Debug|x64
{5DD9EF52-6E7E-4818-99CB-3FC40B2FE4E0}.Debug|x86.ActiveCfg = Debug|x86
{5DD9EF52-6E7E-4818-99CB-3FC40B2FE4E0}.Debug|x86.Build.0 = Debug|x86
{5DD9EF52-6E7E-4818-99CB-3FC40B2FE4E0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5DD9EF52-6E7E-4818-99CB-3FC40B2FE4E0}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5DD9EF52-6E7E-4818-99CB-3FC40B2FE4E0}.DebugLinux|Any CPU.ActiveCfg = Release|x86
{5DD9EF52-6E7E-4818-99CB-3FC40B2FE4E0}.DebugLinux|Any CPU.Build.0 = Release|x86
{5DD9EF52-6E7E-4818-99CB-3FC40B2FE4E0}.DebugLinux|x64.ActiveCfg = Debug|x64
{5DD9EF52-6E7E-4818-99CB-3FC40B2FE4E0}.DebugLinux|x64.Build.0 = Debug|x64
{5DD9EF52-6E7E-4818-99CB-3FC40B2FE4E0}.DebugLinux|x86.ActiveCfg = Debug|x86
{5DD9EF52-6E7E-4818-99CB-3FC40B2FE4E0}.DebugLinux|x86.Build.0 = Debug|x86
{5DD9EF52-6E7E-4818-99CB-3FC40B2FE4E0}.Release|Any CPU.ActiveCfg = Release|x86
{5DD9EF52-6E7E-4818-99CB-3FC40B2FE4E0}.Release|Any CPU.Build.0 = Release|x86
{5DD9EF52-6E7E-4818-99CB-3FC40B2FE4E0}.Release|x64.ActiveCfg = Release|x64
{5DD9EF52-6E7E-4818-99CB-3FC40B2FE4E0}.Release|x64.Build.0 = Release|x64
{5DD9EF52-6E7E-4818-99CB-3FC40B2FE4E0}.Release|x86.ActiveCfg = Release|x86
{5DD9EF52-6E7E-4818-99CB-3FC40B2FE4E0}.Release|x86.Build.0 = Release|x86
{5DD9EF52-6E7E-4818-99CB-3FC40B2FE4E0}.ReleaseLinux|Any CPU.ActiveCfg = Release|x86
{5DD9EF52-6E7E-4818-99CB-3FC40B2FE4E0}.ReleaseLinux|Any CPU.Build.0 = Release|x86
{5DD9EF52-6E7E-4818-99CB-3FC40B2FE4E0}.ReleaseLinux|x64.ActiveCfg = Release|x64
{5DD9EF52-6E7E-4818-99CB-3FC40B2FE4E0}.ReleaseLinux|x64.Build.0 = Release|x64
{5DD9EF52-6E7E-4818-99CB-3FC40B2FE4E0}.ReleaseLinux|x86.ActiveCfg = Release|x86
{5DD9EF52-6E7E-4818-99CB-3FC40B2FE4E0}.ReleaseLinux|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down

0 comments on commit 09b9a12

Please sign in to comment.