Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.NET 9 #3576

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open

.NET 9 #3576

Show file tree
Hide file tree
Changes from 15 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
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
FROM mcr.microsoft.com/devcontainers/dotnet:8.0-jammy
FROM mcr.microsoft.com/devcontainers/dotnet:9.0-jammy
# Install the libleveldb-dev package
RUN apt-get update && apt-get install -y libleveldb-dev
1 change: 1 addition & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ indent_size = 2
[*.{cs,vb}]
# Use block-scoped namespace
csharp_style_namespace_declarations = block_scoped:error
dotnet_diagnostic.CA2265.severity = none
dotnet_diagnostic.IDE0160.severity = error
dotnet_diagnostic.IDE0161.severity = error

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
types: [published]

env:
DOTNET_VERSION: 8.0.x
DOTNET_VERSION: 9.0.x
DIST_DIR: ./dist

jobs:
Expand All @@ -29,7 +29,7 @@ jobs:
- name: Build (neo-cli)
run: |
dotnet publish ./src/Neo.CLI \
--framework net8.0 \
--framework net9.0 \
--configuration Release \
--runtime linux-x64 \
--self-contained true \
Expand All @@ -49,7 +49,7 @@ jobs:
- name: Build (LevelDbStore)
run: |
dotnet build ./src/Plugins/LevelDBStore \
--framework net8.0 \
--framework net9.0 \
--configuration Release \
--output ${{ env.DIST_DIR }}/Plugins/LevelDBStore \
--verbosity normal \
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
pull_request:

env:
DOTNET_VERSION: 8.0.x
DOTNET_VERSION: 9.0.x

jobs:

Expand Down Expand Up @@ -69,7 +69,7 @@ jobs:
run: |
brew install leveldb
dotnet build
cp -vp /opt/homebrew/Cellar/leveldb/1.23_1/lib/libleveldb.dylib ./tests/Neo.Plugins.Storage.Tests/bin/Debug/net8.0/
cp -vp /opt/homebrew/Cellar/leveldb/1.23_1/lib/libleveldb.dylib ./tests/Neo.Plugins.Storage.Tests/bin/Debug/net9.0/
dotnet test --blame-hang --blame-crash --no-build

- name: Test (windows)
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

# Define environment variables
env:
DOTNET_VERSION: 8.0.x
DOTNET_VERSION: 9.0.x
CONFIGURATION: Release

jobs:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:

# Define environment variables
env:
DOTNET_VERSION: 8.0.x
DOTNET_VERSION: 9.0.x
CONFIGURATION: Release
DIST_PATH: /tmp/dist
OUTPUT_PATH: /tmp/out
Expand Down Expand Up @@ -106,7 +106,7 @@ jobs:
run: |
dotnet publish ./src/Neo.CLI \
--version-suffix ${{ matrix.runtime }} \
--framework net8.0 \
--framework net9.0 \
--configuration ${{ env.CONFIGURATION }} \
--runtime ${{ matrix.runtime }} \
--self-contained true \
Expand All @@ -128,7 +128,7 @@ jobs:
run: |
dotnet build ./src/Plugins/LevelDBStore \
--version-suffix ${{ matrix.runtime }} \
--framework net8.0 \
--framework net9.0 \
--configuration ${{ env.CONFIGURATION }} \
--output ${{ env.OUTPUT_PATH }}/${{ matrix.runtime }}/Plugins/LevelDBStore \
--verbosity normal \
Expand Down
6 changes: 3 additions & 3 deletions benchmarks/Neo.Benchmarks/Neo.Benchmarks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net8.0</TargetFrameworks>
<TargetFrameworks>net9.0</TargetFrameworks>
<RootNamespace>Neo</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="System.IO.Hashing" Version="8.0.0" />
<PackageReference Include="System.IO.Hashing" Version="9.0.0" />
<ProjectReference Include="..\..\src\Neo\Neo.csproj" />
<PackageReference Include="BenchmarkDotNet" Version="0.13.12" />
<PackageReference Include="BenchmarkDotNet" Version="0.14.0" />
</ItemGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<RootNamespace>Neo.Extensions</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="MSTest.TestFramework" Version="3.5.0" />
<PackageReference Include="MSTest.TestFramework" Version="3.6.3" />
<ProjectReference Include="..\..\src\Neo.Extensions\Neo.Extensions.csproj" />
<PackageReference Include="BenchmarkDotNet" Version="0.13.12" />
<PackageReference Include="BenchmarkDotNet" Version="0.14.0" />
</ItemGroup>

</Project>
6 changes: 3 additions & 3 deletions benchmarks/Neo.VM.Benchmarks/Neo.VM.Benchmarks.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFrameworks>net8.0</TargetFrameworks>
<TargetFrameworks>net9.0</TargetFrameworks>
<RootNamespace>Neo.VM</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="MSTest.TestFramework" Version="3.5.0" />
<PackageReference Include="MSTest.TestFramework" Version="3.6.3" />
<ProjectReference Include="..\..\src\Neo.Extensions\Neo.Extensions.csproj" />
<ProjectReference Include="..\..\src\Neo.Json\Neo.Json.csproj" />
<ProjectReference Include="..\..\src\Neo.VM\Neo.VM.csproj" />
<PackageReference Include="BenchmarkDotNet" Version="0.13.12" />
<PackageReference Include="BenchmarkDotNet" Version="0.14.0" />
<ProjectReference Include="..\..\tests\Neo.VM.Tests\Neo.VM.Tests.csproj" />
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"sdk": {
"version": "8.0.202",
"version": "9.0.100",
"rollForward": "latestFeature",
"allowPrerelease": false
}
Expand Down
2 changes: 1 addition & 1 deletion scripts/Neo.CLI/test-neo-cli.exp
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ set timeout 10
exp_internal true

# Start neo-cli
spawn dotnet ./bin/Neo.CLI/net8.0/neo-cli.dll
spawn dotnet ./bin/Neo.CLI/net9.0/neo-cli.dll

# Expect the main input prompt
expect {
Expand Down
4 changes: 2 additions & 2 deletions src/Neo.CLI/CLI/MainService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -521,13 +521,13 @@ private void WriteBlocks(uint start, uint count, string path, bool writeStart)
if (writeStart)
{
fs.Seek(sizeof(uint), SeekOrigin.Begin);
fs.Read(buffer, 0, buffer.Length);
fs.ReadExactly(buffer);
start += BitConverter.ToUInt32(buffer, 0);
fs.Seek(sizeof(uint), SeekOrigin.Begin);
}
else
{
fs.Read(buffer, 0, buffer.Length);
fs.ReadExactly(buffer);
Copy link
Contributor

@Jim8y Jim8y Nov 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the only place where code is changed in the core. @shargon , basically all rest are version number updates.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This paragraph was automatically changed after running dotnet format in dotnet 9, and I saw that the logic hadn't changed, so I submitted it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

turn it off in the .editorconfig

start = BitConverter.ToUInt32(buffer, 0);
fs.Seek(0, SeekOrigin.Begin);
}
Expand Down
6 changes: 3 additions & 3 deletions src/Neo.CLI/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:8.0 AS Build
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:9.0 AS Build

# Run this from the repository root folder
COPY src .
COPY NuGet.Config /Neo.CLI

WORKDIR /Neo.CLI
RUN dotnet restore && dotnet publish -f net8.0 -c Release -o /app
RUN dotnet restore && dotnet publish -f net9.0 -c Release -o /app

FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/aspnet:8.0 AS Final
FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/aspnet:9.0 AS Final
RUN apt-get update && apt-get install -y \
screen \
libleveldb-dev \
Expand Down
2 changes: 1 addition & 1 deletion src/Neo.CLI/Neo.CLI.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<TargetFramework>net9.0</TargetFramework>
<AssemblyTitle>Neo.CLI</AssemblyTitle>
<AssemblyName>neo-cli</AssemblyName>
<OutputType>Exe</OutputType>
Expand Down
4 changes: 2 additions & 2 deletions src/Neo.ConsoleService/Neo.ConsoleService.csproj
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.1;net8.0</TargetFrameworks>
<TargetFrameworks>netstandard2.1;net9.0</TargetFrameworks>
<PackageId>Neo.ConsoleService</PackageId>
<Nullable>enable</Nullable>
<OutputPath>../../bin/$(PackageId)</OutputPath>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="System.Runtime.Loader" Version="4.3.0" />
<PackageReference Include="System.ServiceProcess.ServiceController" Version="8.0.0" />
<PackageReference Include="System.ServiceProcess.ServiceController" Version="9.0.0" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

<PropertyGroup>
<VersionPrefix>0.3.0</VersionPrefix>
<TargetFrameworks>netstandard2.1;net8.0</TargetFrameworks>
<TargetFrameworks>netstandard2.1;net9.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<PackageId>Neo.Cryptography.BLS12_381</PackageId>
<OutputPath>../../bin/$(PackageId)</OutputPath>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="6.0.0" />
<PackageReference Include="System.Runtime.CompilerServices.Unsafe" Version="6.1.0" />
</ItemGroup>

<ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions src/Neo.Extensions/Neo.Extensions.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.1;net8.0</TargetFrameworks>
<TargetFrameworks>netstandard2.1;net9.0</TargetFrameworks>
<Nullable>enable</Nullable>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<PackageId>Neo.Extensions</PackageId>
Expand All @@ -10,8 +10,8 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Akka" Version="1.5.26" />
<PackageReference Include="System.IO.Hashing" Version="8.0.0" />
<PackageReference Include="Akka" Version="1.5.31" />
<PackageReference Include="System.IO.Hashing" Version="9.0.0" />
</ItemGroup>

<ItemGroup>
Expand Down
3 changes: 3 additions & 0 deletions src/Neo.GUI/GUI/ChangePasswordDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,14 @@
// modifications are permitted.

using System;
using System.ComponentModel;
using System.Windows.Forms;

namespace Neo.GUI
{
internal partial class ChangePasswordDialog : Form
{
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string OldPassword
{
get
Expand All @@ -28,6 +30,7 @@ public string OldPassword
}
}

[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string NewPassword
{
get
Expand Down
3 changes: 3 additions & 0 deletions src/Neo.GUI/GUI/CreateWalletDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
// modifications are permitted.

using System;
using System.ComponentModel;
using System.Windows.Forms;

namespace Neo.GUI
Expand All @@ -21,6 +22,7 @@ public CreateWalletDialog()
InitializeComponent();
}

[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string Password
{
get
Expand All @@ -34,6 +36,7 @@ public string Password
}
}

[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string WalletPath
{
get
Expand Down
2 changes: 2 additions & 0 deletions src/Neo.GUI/GUI/ImportPrivateKeyDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
// modifications are permitted.

using System;
using System.ComponentModel;
using System.Windows.Forms;

namespace Neo.GUI
Expand All @@ -21,6 +22,7 @@ public ImportPrivateKeyDialog()
InitializeComponent();
}

[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string[] WifStrings
{
get
Expand Down
3 changes: 3 additions & 0 deletions src/Neo.GUI/GUI/OpenWalletDialog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
// modifications are permitted.

using System;
using System.ComponentModel;
using System.Windows.Forms;

namespace Neo.GUI
Expand All @@ -21,6 +22,7 @@ public OpenWalletDialog()
InitializeComponent();
}

[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string Password
{
get
Expand All @@ -33,6 +35,7 @@ public string Password
}
}

[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public string WalletPath
{
get
Expand Down
3 changes: 3 additions & 0 deletions src/Neo.GUI/GUI/TxOutListBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,14 @@ internal partial class TxOutListBox : UserControl
{
public event EventHandler ItemsChanged;

[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public AssetDescriptor Asset { get; set; }

public int ItemCount => listBox1.Items.Count;

public IEnumerable<TxOutListBoxItem> Items => listBox1.Items.OfType<TxOutListBoxItem>();

[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public bool ReadOnly
{
get
Expand All @@ -42,6 +44,7 @@ public bool ReadOnly
}

private UInt160 _script_hash = null;
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public UInt160 ScriptHash
{
get
Expand Down
2 changes: 1 addition & 1 deletion src/Neo.GUI/Neo.GUI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Copyright>2016-2024 The Neo Project</Copyright>
<AssemblyTitle>Neo.GUI</AssemblyTitle>
<OutputType>WinExe</OutputType>
<TargetFramework>net8.0-windows</TargetFramework>
<TargetFramework>net9.0-windows</TargetFramework>
<EnableWindowsTargeting>true</EnableWindowsTargeting>
<RootNamespace>Neo</RootNamespace>
<UseWindowsForms>true</UseWindowsForms>
Expand Down
2 changes: 1 addition & 1 deletion src/Neo.IO/Neo.IO.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>netstandard2.1;net8.0</TargetFrameworks>
<TargetFrameworks>netstandard2.1;net9.0</TargetFrameworks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Nullable>enable</Nullable>
<PackageId>Neo.IO</PackageId>
Expand Down
Loading
Loading