Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/dotnetcore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,16 @@ jobs:
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout source
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
# Checkout libvt100 & litehtml
submodules: 'true'

# Setup .NET
- name: Setup .NET Core
uses: actions/setup-dotnet@v1
- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 3.1.101
dotnet-version: 10.0.x

# Restore packages
- name: Restore
Expand Down
70 changes: 70 additions & 0 deletions UPGRADE_NOTES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# .NET 10 and C# 12 Upgrade Notes

## Completed Upgrades

### Main Repository Projects

All projects in the main repository have been successfully upgraded to .NET 10 and C# 12:

- **WinPrint.Core**: netcoreapp3.1 → net10.0-windows, C# 8.0 → C# 12
- **WinPrint.LiteHtml**: netcoreapp3.1 → net10.0-windows
- **WinPrint.Console**: netcoreapp3.1 → net10.0-windows
- **WinPrint.WinForms**: netcoreapp3.1 → net10.0-windows
- **WinPrint.Core.UnitTests**: netcoreapp3.1 → net10.0-windows

### Package Updates

Major package updates include:
- System.Linq.Dynamic.Core: 1.1.0 → 1.7.1 (fixes CVE vulnerability)
- PowerShell SDK: 7.0.0 → 7.4.0
- Serilog: 2.9.1 → 4.0.0
- xUnit: 2.4.1 → 2.7.0
- Microsoft.NET.Test.Sdk: 16.6.1 → 17.9.0
- System.Drawing.Common: 4.7.0 → 8.0.0

### Build System

- GitHub Actions workflow updated to use .NET 10.0.x
- PostBuild events made cross-platform compatible with OS conditionals

## Submodule Updates Required

The following submodules need to be updated in their respective repositories:

### 1. libvt100 (https://github.com/tig/libvt100.git)

**File**: `src/libvt100.csproj`

Changes made:
- SDK: Microsoft.NET.Sdk.WindowsDesktop → Microsoft.NET.Sdk
- TargetFrameworks: netcoreapp3.1 → net10.0;net10.0-windows (multi-target)
- LangVersion: 8.0 → 12
- Added: EnableWindowsTargeting = true
- System.Drawing.Common: 4.7.0 → 8.0.0
- Added conditional UseWindowsForms for net10.0-windows target

**Reason**: The library needed multi-targeting to support both Windows and non-Windows builds. The net10.0 target allows the library to be referenced by cross-platform projects, while net10.0-windows provides Windows Forms support.

### 2. PowershellAsync (https://github.com/tig/PowershellAsync.git)

**File**: `PowerShellAsync/PowerShellAsync.csproj`

Changes made:
- TargetFramework: netcoreapp3.1 → net10.0
- System.Management.Automation: 7.0.0 → 7.4.0

**Reason**: Updated to support .NET 10 and latest PowerShell SDK.

## Next Steps

1. **For submodule owners**: The changes made to libvt100 and PowershellAsync should be committed to their respective repositories
2. **After submodule updates**: Update the submodule references in this repository to point to the new commits
3. **Testing**: Run full integration tests on Windows to ensure all functionality works correctly
4. **Optional**: Consider updating the installer project (currently uses .NET Framework 4.7.2)

## Verification

✅ All projects build successfully on Linux (CI environment)
✅ All unit tests pass
✅ Cross-platform build compatibility verified
✅ Security vulnerability in System.Linq.Dynamic.Core resolved
17 changes: 9 additions & 8 deletions src/WinPrint.Console/WinPrint.Console.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net10.0-windows</TargetFramework>
<RootNamespace>WinPrint.Console</RootNamespace>
<AssemblyTitle>winprint Console App</AssemblyTitle>
<AssemblyName>winprint</AssemblyName>
<StartupObject></StartupObject>
<EnableWindowsTargeting>true</EnableWindowsTargeting>

<Version>2.0.5.103</Version>
<Company>Kindel Systems</Company>
Expand All @@ -21,16 +22,16 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.CodeAnalysis.FxCopAnalyzers" Version="3.0.0">
<PackageReference Include="Microsoft.CodeAnalysis.NetAnalyzers" Version="8.0.0">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.PowerShell.Commands.Diagnostics" Version="7.0.0" />
<PackageReference Include="Microsoft.PowerShell.Commands.Management" Version="7.0.0" />
<PackageReference Include="Microsoft.PowerShell.ConsoleHost" Version="7.0.0" />
<PackageReference Include="Microsoft.PowerShell.Commands.Diagnostics" Version="7.4.0" />
<PackageReference Include="Microsoft.PowerShell.Commands.Management" Version="7.4.0" />
<PackageReference Include="Microsoft.PowerShell.ConsoleHost" Version="7.4.0" />
<PackageReference Include="System.Dynamic.Runtime" Version="4.3.0" />
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.1.0" />
<PackageReference Include="System.Management.Automation" Version="7.0.0" />
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.7.1" />
<PackageReference Include="System.Management.Automation" Version="7.4.0" />
</ItemGroup>

<ItemGroup>
Expand All @@ -53,7 +54,7 @@
</EmbeddedResource>
</ItemGroup>

<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Target Name="PostBuild" AfterTargets="PostBuildEvent" Condition="'$(OS)' == 'Windows_NT'">
<Exec Command="copy ..\..\tools\pygmentize.exe $(TargetDir)" />
</Target>

Expand Down
29 changes: 15 additions & 14 deletions src/WinPrint.Core/WinPrint.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net10.0-windows</TargetFramework>
<Platforms>AnyCPU;x64;x86</Platforms>
<Version>2.0.5.102</Version>
<Company>Kindel Systems</Company>
Expand All @@ -12,7 +12,8 @@
<Copyright>Copyright Kindel Systems, LLC</Copyright>
<PackageReleaseNotes>No release notes.</PackageReleaseNotes>
<PackageProjectUrl>https://github.com/tig/winprint</PackageProjectUrl>
<LangVersion>8.0</LangVersion>
<LangVersion>12</LangVersion>
<EnableWindowsTargeting>true</EnableWindowsTargeting>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
Expand All @@ -36,20 +37,20 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="CommandLineParser" Version="2.8.0" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="3.1.3" />
<PackageReference Include="Microsoft.Win32.Registry" Version="4.7.0" />
<PackageReference Include="CommandLineParser" Version="2.9.1" />
<PackageReference Include="Microsoft.Extensions.Logging" Version="8.0.0" />
<PackageReference Include="Microsoft.Win32.Registry" Version="5.0.0" />
<PackageReference Include="MvvmLightLibsStd10" Version="5.4.1.1" />
<PackageReference Include="Octokit" Version="0.47.0" />
<PackageReference Include="Serilog" Version="2.9.1-dev-01154" />
<PackageReference Include="Serilog.Sinks.ApplicationInsights" Version="3.1.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="4.0.0-dev-00839" />
<PackageReference Include="Serilog.Sinks.Debug" Version="1.0.2-dev-00020" />
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0-dev-00864" />
<PackageReference Include="System.Drawing.Common" Version="4.7.0" />
<PackageReference Include="Octokit" Version="13.0.1" />
<PackageReference Include="Serilog" Version="4.0.0" />
<PackageReference Include="Serilog.Sinks.ApplicationInsights" Version="4.0.0" />
<PackageReference Include="Serilog.Sinks.Console" Version="6.0.0" />
<PackageReference Include="Serilog.Sinks.Debug" Version="3.0.0" />
<PackageReference Include="Serilog.Sinks.File" Version="6.0.0" />
<PackageReference Include="System.Drawing.Common" Version="8.0.0" />
<PackageReference Include="System.Dynamic.Runtime" Version="4.3.0" />
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.1.0" />
<PackageReference Include="UTF.Unknown" Version="2.3.0" />
<PackageReference Include="System.Linq.Dynamic.Core" Version="1.7.1" />
<PackageReference Include="UTF.Unknown" Version="2.5.1" />
</ItemGroup>

<ItemGroup>
Expand Down
9 changes: 5 additions & 4 deletions src/WinPrint.LiteHtml/WinPrint.LiteHtml.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net10.0-windows</TargetFramework>
<AssemblyTitle>winprint LiteHtml</AssemblyTitle>
<AssemblyName>WinPrint.LiteHtml</AssemblyName>
<EnableWindowsTargeting>true</EnableWindowsTargeting>

<Version>2.0.5.100</Version>
<Company>Kindel Systems</Company>
Expand Down Expand Up @@ -42,9 +43,9 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.Win32.Registry" Version="4.7.0" />
<PackageReference Include="Serilog" Version="2.9.1-dev-01154" />
<PackageReference Include="System.Drawing.Common" Version="4.7.0" />
<PackageReference Include="Microsoft.Win32.Registry" Version="5.0.0" />
<PackageReference Include="Serilog" Version="4.0.0" />
<PackageReference Include="System.Drawing.Common" Version="8.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
9 changes: 5 additions & 4 deletions src/WinPrint.WinForms/WinPrint.WinForms.csproj
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk.WindowsDesktop">
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>WinExe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net10.0-windows</TargetFramework>
<UseWindowsForms>true</UseWindowsForms>
<CefSharpAnyCpuSupport>true</CefSharpAnyCpuSupport>
<StartupObject>WinPrint.Winforms.Program</StartupObject>
<ApplicationIcon>Document.ico</ApplicationIcon>
<EnableWindowsTargeting>true</EnableWindowsTargeting>

<AssemblyTitle>winprint GUI</AssemblyTitle>
<AssemblyName>winprintgui</AssemblyName>
Expand All @@ -30,7 +31,7 @@

<ItemGroup>

<PackageReference Include="CommandLineParser" Version="2.8.0" />
<PackageReference Include="CommandLineParser" Version="2.9.1" />
<PackageReference Include="MvvmLightLibsStd10" Version="5.4.1.1" />
</ItemGroup>

Expand All @@ -54,7 +55,7 @@
</EmbeddedResource>
</ItemGroup>

<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Target Name="PostBuild" AfterTargets="PostBuildEvent" Condition="'$(OS)' == 'Windows_NT'">
<Exec Command="rem copy $(TargetDir)$(TargetName).runtimeconfig.json $(SolutionDir)WinPrint.Console\$(OutDir)&#xD;&#xA;rem copy $(OutDir)\$(TargetName).exe $(SolutionDir)..\release\&#xD;&#xA;rem copy $(OutDir)\$(TargetName).dll $(SolutionDir)..\release\&#xD;&#xA;rem copy $(OutDir)\$(TargetName).runtimeconfig.json $(SolutionDir)..\release&#xD;&#xA;copy $(SolutionDir)..\tools\pygmentize.exe $(TargetDir)" />
</Target>

Expand Down
15 changes: 8 additions & 7 deletions tests/WinPrint.Core.UnitTests/WinPrint.Core.UnitTests.csproj
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFramework>net10.0-windows</TargetFramework>
<EnableWindowsTargeting>true</EnableWindowsTargeting>

<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.6.1" />
<PackageReference Include="Serilog.Sinks.XUnit" Version="2.0.4" />
<PackageReference Include="xunit" Version="2.4.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.4.1">
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageReference Include="Serilog.Sinks.XUnit" Version="3.0.5" />
<PackageReference Include="xunit" Version="2.7.0" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.5.7">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="coverlet.collector" Version="1.2.1">
<PackageReference Include="coverlet.collector" Version="6.0.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand All @@ -24,7 +25,7 @@
<ProjectReference Include="..\..\src\WinPrint.Core\WinPrint.Core.csproj" />
</ItemGroup>

<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Target Name="PostBuild" AfterTargets="PostBuildEvent" Condition="'$(OS)' == 'Windows_NT'">
<Exec Command="copy ..\..\tools\pygmentize.exe $(TargetDir)" />
</Target>

Expand Down