Skip to content

Commit 943e923

Browse files
Merge pull request #70 from LandarXT/net6
Upgrade to .NET 6.0 and CEFSharp 106
2 parents d7eac9f + da6a016 commit 943e923

File tree

4 files changed

+38
-146
lines changed

4 files changed

+38
-146
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ Ctrl+F | Open search bar (Enter to find next, Esc to close)
3434

3535
- You need [VC++ 2019 Runtime](https://aka.ms/vs/17/release/vc_redist.x64.exe) 32-bit and 64-bit versions
3636

37-
- You need .NET Framework 4.8.
37+
- You need .NET 6.
3838

39-
- You need to install the version of VC++ Runtime that CEFSharp needs. Since we are using CefSharp 104, according to [this](https://github.com/cefsharp/CefSharp/#release-branches) we need the above versions
39+
- You need to install the version of VC++ Runtime that CEFSharp needs. Since we are using CefSharp 106, according to [this](https://github.com/cefsharp/CefSharp/#release-branches) we need the above versions
4040

4141

4242
## Getting started
@@ -54,7 +54,7 @@ Ctrl+F | Open search bar (Enter to find next, Esc to close)
5454

5555
## Code
5656

57-
- SharpBrowser uses CefSharp 104 and is built on NET Framework 4.8
57+
- SharpBrowser uses CefSharp 106 and is built on NET 6
5858
- SharpBrowser supports AnyCPU as well as x86/x64 specific builds
5959
- `MainForm.cs` - main web browser UI and related functionality
6060
- `Handlers` - various handlers that we have registered with CefSharp that enable deeper integration between us and CefSharp

src/MainForm.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@ public void InitTooltips(System.Windows.Forms.Control.ControlCollection parent)
143143
private void InitBrowser() {
144144

145145
//CefSharpSettings.LegacyJavascriptBindingEnabled = true;
146-
CefSharpSettings.WcfEnabled = false;
146+
147147
Cef.EnableHighDPISupport();
148148
CefSettings settings = new CefSettings();
149149

@@ -383,7 +383,7 @@ private BrowserTab AddNewBrowser(BrowserTabStripItem tabStrip, String url) {
383383
tabStrip.Tag = tab;
384384

385385
if (url.StartsWith(BrowserConfig.InternalURL + ":")) {
386-
browser.JavascriptObjectRepository.Register("host", host, true, BindingOptions.DefaultBinder);
386+
browser.JavascriptObjectRepository.Register("host", host, BindingOptions.DefaultBinder);
387387
}
388388
return tab;
389389
}

src/SharpBrowser.csproj

Lines changed: 14 additions & 136 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,14 @@
1-
<?xml version="1.0" encoding="utf-8"?>
2-
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3-
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
1+
<Project Sdk="Microsoft.NET.Sdk">
42
<PropertyGroup>
5-
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6-
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7-
<ProjectGuid>{703472B8-B275-4F3F-95B6-426036F8462E}</ProjectGuid>
3+
<TargetFramework>net6.0-windows</TargetFramework>
84
<OutputType>WinExe</OutputType>
9-
<AppDesignerFolder>Properties</AppDesignerFolder>
10-
<RootNamespace>SharpBrowser</RootNamespace>
11-
<AssemblyName>SharpBrowser</AssemblyName>
12-
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
13-
<FileAlignment>512</FileAlignment>
14-
<TargetFrameworkProfile>
15-
</TargetFrameworkProfile>
16-
<NuGetPackageImportStamp>
17-
</NuGetPackageImportStamp>
185
<CefSharpAnyCpuSupport>true</CefSharpAnyCpuSupport>
19-
</PropertyGroup>
20-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
21-
<PlatformTarget>x86</PlatformTarget>
22-
<DebugSymbols>true</DebugSymbols>
23-
<DebugType>pdbonly</DebugType>
24-
<Optimize>false</Optimize>
25-
<OutputPath>bin\</OutputPath>
26-
<DefineConstants>DEBUG;TRACE</DefineConstants>
27-
<ErrorReport>prompt</ErrorReport>
28-
<WarningLevel>4</WarningLevel>
29-
<UseVSHostingProcess>false</UseVSHostingProcess>
30-
</PropertyGroup>
31-
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
32-
<PlatformTarget>x86</PlatformTarget>
33-
<DebugType>pdbonly</DebugType>
34-
<Optimize>true</Optimize>
35-
<OutputPath>bin\</OutputPath>
36-
<DefineConstants>TRACE</DefineConstants>
37-
<ErrorReport>prompt</ErrorReport>
38-
<WarningLevel>4</WarningLevel>
39-
<UseVSHostingProcess>false</UseVSHostingProcess>
40-
</PropertyGroup>
41-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
42-
<DebugSymbols>true</DebugSymbols>
43-
<OutputPath>bin\</OutputPath>
44-
<DefineConstants>DEBUG;TRACE</DefineConstants>
45-
<DebugType>full</DebugType>
46-
<PlatformTarget>x86</PlatformTarget>
47-
<ErrorReport>prompt</ErrorReport>
48-
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
49-
</PropertyGroup>
50-
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
6+
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
7+
<UseWindowsForms>true</UseWindowsForms>
8+
<ImportWindowsDesktopTargets>true</ImportWindowsDesktopTargets>
519
<OutputPath>bin\</OutputPath>
52-
<DefineConstants>TRACE</DefineConstants>
53-
<Optimize>true</Optimize>
54-
<DebugType>pdbonly</DebugType>
55-
<PlatformTarget>x86</PlatformTarget>
56-
<ErrorReport>prompt</ErrorReport>
5710
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
11+
<Platforms>AnyCPU;x64</Platforms>
5812
</PropertyGroup>
5913
<PropertyGroup>
6014
<ApplicationIcon>Resources\sharpbrowser.ico</ApplicationIcon>
@@ -63,102 +17,26 @@
6317
<StartupObject>SharpBrowser.Program</StartupObject>
6418
</PropertyGroup>
6519
<ItemGroup>
66-
<Compile Include="Browser\BrowserConfig.cs" />
67-
<Compile Include="Browser\Model\BrowserHotKey.cs" />
68-
<Compile Include="Browser\Model\BrowserTab.cs" />
69-
<Compile Include="Data\JSON.cs" />
70-
<Compile Include="Handlers\ResourceRequestHandler.cs" />
71-
<Compile Include="Properties\Settings.Designer.cs">
72-
<AutoGen>True</AutoGen>
73-
<DesignTimeSharedInput>True</DesignTimeSharedInput>
74-
<DependentUpon>Settings.settings</DependentUpon>
75-
</Compile>
76-
<Compile Include="Controls\BrowserTabStrip\BaseStyledPanel.cs">
20+
<Compile Update="Controls\BrowserTabStrip\BaseStyledPanel.cs">
7721
<SubType>Component</SubType>
7822
</Compile>
79-
<Compile Include="Controls\BrowserTabStrip\Data\CollectionChange.cs" />
80-
<Compile Include="Controls\BrowserTabStrip\Data\CollectionClear.cs" />
81-
<Compile Include="Controls\BrowserTabStrip\Data\CollectionWithEvents.cs" />
82-
<Compile Include="Controls\BrowserTabStrip\BrowserTabStrip.cs">
23+
<Compile Update="Controls\BrowserTabStrip\BrowserTabStrip.cs">
8324
<SubType>Component</SubType>
8425
</Compile>
85-
<Compile Include="Controls\BrowserTabStrip\BrowserTabStripCloseButton.cs" />
86-
<Compile Include="Controls\BrowserTabStrip\BrowserTabStripItem.cs">
26+
<Compile Update="Controls\BrowserTabStrip\BrowserTabStripItem.cs">
8727
<SubType>Component</SubType>
8828
</Compile>
89-
<Compile Include="Controls\BrowserTabStrip\Enums\BrowserTabStripItemChangeTypes.cs" />
90-
<Compile Include="Controls\BrowserTabStrip\Data\BrowserTabStripItemCollection.cs" />
91-
<Compile Include="Controls\BrowserTabStrip\Enums\HitTestResult.cs" />
92-
<Compile Include="Controls\BrowserTabStrip\Events\BrowserTabStripItemChangedEventArgs.cs" />
93-
<Compile Include="Controls\BrowserTabStrip\Events\BrowserTabStripItemChangedHandler.cs" />
94-
<Compile Include="Controls\BrowserTabStrip\Events\BrowserTabStripItemClosingEventArgs.cs" />
95-
<Compile Include="Controls\BrowserTabStrip\Events\BrowserTabStripItemClosingHandler.cs" />
96-
<Compile Include="Utils\MiscUtils.cs" />
97-
<Compile Include="Handlers\HostHandler.cs" />
98-
<Compile Include="Handlers\RequestHandler.cs" />
99-
<Compile Include="Handlers\SchemeHandler.cs" />
100-
<Compile Include="Handlers\SchemeHandlerFactory.cs" />
101-
<Compile Include="Handlers\DownloadHandler.cs" />
102-
<Compile Include="Handlers\KeyboardHandler.cs" />
103-
<Compile Include="Handlers\LifeSpanHandler.cs" />
104-
<Compile Include="MainForm.cs">
105-
<SubType>Form</SubType>
106-
</Compile>
107-
<Compile Include="MainForm.Designer.cs">
108-
<DependentUpon>MainForm.cs</DependentUpon>
109-
</Compile>
110-
<Compile Include="Handlers\ContextMenuHandler.cs" />
111-
<Compile Include="Program.cs" />
112-
<Compile Include="Properties\AssemblyInfo.cs" />
113-
<Compile Include="Utils\FileIconUtils.cs" />
114-
<Compile Include="Utils\URLUtils.cs" />
115-
<EmbeddedResource Include="MainForm.resx">
116-
<DependentUpon>MainForm.cs</DependentUpon>
117-
</EmbeddedResource>
118-
<EmbeddedResource Include="Properties\Resources.resx">
119-
<Generator>ResXFileCodeGenerator</Generator>
120-
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
121-
<SubType>Designer</SubType>
122-
</EmbeddedResource>
123-
<Compile Include="Properties\Resources.Designer.cs">
124-
<AutoGen>True</AutoGen>
125-
<DependentUpon>Resources.resx</DependentUpon>
126-
<DesignTime>True</DesignTime>
127-
</Compile>
128-
<None Include="App.config">
129-
<SubType>Designer</SubType>
130-
</None>
131-
<None Include="Properties\Settings.settings">
132-
<Generator>SettingsSingleFileGenerator</Generator>
133-
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
134-
</None>
13529
</ItemGroup>
13630
<ItemGroup>
13731
<EmbeddedResource Include="Resources\sharpbrowser.ico" />
13832
</ItemGroup>
13933
<ItemGroup>
140-
<Reference Include="System" />
141-
<Reference Include="System.Data" />
142-
<Reference Include="System.Drawing" />
143-
<Reference Include="System.Net" />
144-
<Reference Include="System.Web" />
145-
<Reference Include="System.Windows.Forms" />
146-
<Reference Include="System.XML" />
34+
<PackageReference Include="CefSharp.Common" Version="106.0.260" />
35+
<PackageReference Include="CefSharp.Common.NETCore" Version="106.0.260" />
36+
<PackageReference Include="CefSharp.WinForms.NETCore" Version="106.0.260" />
14737
</ItemGroup>
14838
<ItemGroup>
149-
<PackageReference Include="CefSharp.Common">
150-
<Version>104.4.240</Version>
151-
</PackageReference>
152-
<PackageReference Include="CefSharp.WinForms">
153-
<Version>104.4.240</Version>
154-
</PackageReference>
39+
<Reference Include="System.Net" />
40+
<Reference Include="System.Web" />
15541
</ItemGroup>
156-
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
157-
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
158-
Other similar extension points exist, see Microsoft.Common.targets.
159-
<Target Name="BeforeBuild">
160-
</Target>
161-
<Target Name="AfterBuild">
162-
</Target>
163-
-->
16442
</Project>

src/SharpBrowser.sln

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,42 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 14
4-
VisualStudioVersion = 14.0.23107.0
3+
# Visual Studio Version 17
4+
VisualStudioVersion = 17.3.32901.215
55
MinimumVisualStudioVersion = 10.0.40219.1
6-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SharpBrowser", "SharpBrowser.csproj", "{703472B8-B275-4F3F-95B6-426036F8462E}"
6+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SharpBrowser", "SharpBrowser.csproj", "{703472B8-B275-4F3F-95B6-426036F8462E}"
7+
EndProject
8+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{41B061E7-4B20-47D6-8B61-C022FA944C24}"
9+
ProjectSection(SolutionItems) = preProject
10+
.editorconfig = .editorconfig
11+
EndProjectSection
712
EndProject
813
Global
914
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1015
Debug|Any CPU = Debug|Any CPU
16+
Debug|x64 = Debug|x64
1117
Debug|x86 = Debug|x86
1218
Release|Any CPU = Release|Any CPU
19+
Release|x64 = Release|x64
1320
Release|x86 = Release|x86
1421
EndGlobalSection
1522
GlobalSection(ProjectConfigurationPlatforms) = postSolution
1623
{703472B8-B275-4F3F-95B6-426036F8462E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
1724
{703472B8-B275-4F3F-95B6-426036F8462E}.Debug|Any CPU.Build.0 = Debug|Any CPU
18-
{703472B8-B275-4F3F-95B6-426036F8462E}.Debug|x86.ActiveCfg = Debug|x86
19-
{703472B8-B275-4F3F-95B6-426036F8462E}.Debug|x86.Build.0 = Debug|x86
25+
{703472B8-B275-4F3F-95B6-426036F8462E}.Debug|x64.ActiveCfg = Debug|x64
26+
{703472B8-B275-4F3F-95B6-426036F8462E}.Debug|x64.Build.0 = Debug|x64
27+
{703472B8-B275-4F3F-95B6-426036F8462E}.Debug|x86.ActiveCfg = Debug|Any CPU
28+
{703472B8-B275-4F3F-95B6-426036F8462E}.Debug|x86.Build.0 = Debug|Any CPU
2029
{703472B8-B275-4F3F-95B6-426036F8462E}.Release|Any CPU.ActiveCfg = Release|Any CPU
2130
{703472B8-B275-4F3F-95B6-426036F8462E}.Release|Any CPU.Build.0 = Release|Any CPU
31+
{703472B8-B275-4F3F-95B6-426036F8462E}.Release|x64.ActiveCfg = Release|x64
32+
{703472B8-B275-4F3F-95B6-426036F8462E}.Release|x64.Build.0 = Release|x64
2233
{703472B8-B275-4F3F-95B6-426036F8462E}.Release|x86.ActiveCfg = Release|x86
2334
{703472B8-B275-4F3F-95B6-426036F8462E}.Release|x86.Build.0 = Release|x86
2435
EndGlobalSection
2536
GlobalSection(SolutionProperties) = preSolution
2637
HideSolutionNode = FALSE
2738
EndGlobalSection
39+
GlobalSection(ExtensibilityGlobals) = postSolution
40+
SolutionGuid = {565C1009-C43D-4D6E-996B-E4069AE8A18B}
41+
EndGlobalSection
2842
EndGlobal

0 commit comments

Comments
 (0)