Skip to content

Commit e3dc4f4

Browse files
committed
Upgrade to .NET 6.0
1 parent d7eac9f commit e3dc4f4

File tree

5 files changed

+203
-143
lines changed

5 files changed

+203
-143
lines changed

src/.editorconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[*.cs]
2+
3+
# IDE0055: Fix formatting
4+
dotnet_diagnostic.IDE0055.severity = none

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.csproj.old

Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
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')" />
4+
<PropertyGroup>
5+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
6+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
7+
<ProjectGuid>{703472B8-B275-4F3F-95B6-426036F8462E}</ProjectGuid>
8+
<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>
18+
<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'">
51+
<OutputPath>bin\</OutputPath>
52+
<DefineConstants>TRACE</DefineConstants>
53+
<Optimize>true</Optimize>
54+
<DebugType>pdbonly</DebugType>
55+
<PlatformTarget>x86</PlatformTarget>
56+
<ErrorReport>prompt</ErrorReport>
57+
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
58+
</PropertyGroup>
59+
<PropertyGroup>
60+
<ApplicationIcon>Resources\sharpbrowser.ico</ApplicationIcon>
61+
</PropertyGroup>
62+
<PropertyGroup>
63+
<StartupObject>SharpBrowser.Program</StartupObject>
64+
</PropertyGroup>
65+
<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">
77+
<SubType>Component</SubType>
78+
</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">
83+
<SubType>Component</SubType>
84+
</Compile>
85+
<Compile Include="Controls\BrowserTabStrip\BrowserTabStripCloseButton.cs" />
86+
<Compile Include="Controls\BrowserTabStrip\BrowserTabStripItem.cs">
87+
<SubType>Component</SubType>
88+
</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>
135+
</ItemGroup>
136+
<ItemGroup>
137+
<EmbeddedResource Include="Resources\sharpbrowser.ico" />
138+
</ItemGroup>
139+
<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" />
147+
</ItemGroup>
148+
<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>
155+
</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+
-->
164+
</Project>

0 commit comments

Comments
 (0)