From 5cedd14dc04dc9abde818e6c3b28e8531ac3db7a Mon Sep 17 00:00:00 2001 From: Andrii Kurdiumov Date: Tue, 23 Aug 2022 20:38:02 +0600 Subject: [PATCH] Update to .NET 6 (#391) * Disable warning for usage of WebClient in Evaluator * vmImage: windows-latest * Adjust to new DeflateStream behaviour in .NET 6 --- BUILDING.md | 18 +++++----- build/evaluator-netcore.yml | 2 +- build/nightly-netcore.yml | 2 +- build/nightly-windows.yml | 2 +- build/pr-factordocs.yml | 2 +- build/pr-msbuild.yml | 4 +-- build/pr-netcore.yml | 2 +- build/release.yml | 8 ++--- docs/_build/makeApiDocs.ps1 | 2 +- .../ClickThroughModel.csproj | 4 +-- .../ClinicalTrial/ClinicalTrial.csproj | 4 +-- .../Crowdsourcing/Crowdsourcing.csproj | 4 +-- .../CrowdsourcingWithWords.csproj | 4 +-- src/Examples/InferNET101/InferNET101.csproj | 4 +-- src/Examples/LDA/LDA.csproj | 4 +-- src/Examples/MotifFinder/MotifFinder.csproj | 4 +-- .../ReviewerCalibration.csproj | 4 +-- .../RobustGaussianProcess.csproj | 8 ++--- .../ClassifierModels/ClassifierModels.csproj | 6 ++-- .../RecommenderModels.csproj | 6 ++-- .../Runners/CommandLine/CommandLine.csproj | 4 +-- .../Runners/Evaluator/Evaluator.csproj | 6 ++-- .../Core/Serialization/MatlabReader.cs | 35 +++++++++++++------ .../Tools.BuildFactorDoc.csproj | 2 +- .../PrepareSource/Tools.PrepareSource.csproj | 2 +- src/Tutorials/Tutorials.csproj | 4 +-- .../LearnersTests/LearnersTests.csproj | 4 +-- test/Learners/TestApp/TestApp.csproj | 4 +-- test/TestApp/TestApp.csproj | 4 +-- test/TestFSharp/TestFSharp.fsproj | 2 +- test/TestPublic/TestPublic.csproj | 4 +-- test/Tests/Core/MatlabSerializationTests.cs | 14 ++++---- test/Tests/Tests.csproj | 4 +-- test/netcoretest.sh | 2 +- 34 files changed, 101 insertions(+), 84 deletions(-) diff --git a/BUILDING.md b/BUILDING.md index 30e37f9a..548417b8 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -1,23 +1,23 @@ # Building Infer.NET from its source code -- [Building with Visual Studio 2019](#building-with-visual-studio-2019) +- [Building with Visual Studio](#building-with-visual-studio) - [Building from the command line](#building-from-the-command-line) To build from source, you must first clone the repository. Next decide whether you want to use a code editor like Visual Studio (recommended) or the command line. When building, you must select a configuration. -All of the Infer.NET libraries target .NET Standard 2.0. Projects that produce executables (including test projects) mostly target .NET Framework 4.6.2, .NET Core 3.1, or both depending on build configuration: +All of the Infer.NET libraries target .NET Standard 2.0. Projects that produce executables (including test projects) mostly target .NET Framework 4.6.2, .NET 6, or both depending on build configuration: | Configurations | Targeted Frameworks | |:---|---:| -| Debug, Release | both .NET Framework 4.6.2 and .NET Core 3.1 | +| Debug, Release | both .NET Framework 4.6.2 and .NET 6 | | DebugFull, ReleaseFull | .NET Framework 4.6.2 only | -| DebugCore, ReleaseCore | .NET Core 3.1 only | +| DebugCore, ReleaseCore | .NET 6 only | -## Building with Visual Studio 2019 +## Building with Visual Studio -1. If you don't have Visual Studio 2019, you can install the free [Visual Studio 2019 Community](https://visualstudio.microsoft.com/vs/community/). +1. If you don't have Visual Studio, you can install the free [Visual Studio Community Edition](https://visualstudio.microsoft.com/vs/community/). 1. Start Visual Studio. 1. Select `File -> Open -> Project/Solution` and open the `Infer.sln` solution file located in your cloned repository. 1. Select a build configuration using `Build -> Configuration Manager...`. After switching between configurations that change the targeted frameworks, Visual Studio currently requires you to close and re-open the solution file using `File -> Close Solution` and `File -> Open`. @@ -37,12 +37,12 @@ All of the Infer.NET libraries target .NET Standard 2.0. Projects that produ ## Building from the command line -The core components of Infer.NET run on .NET Core 3.1. Some optional code, such as the [Examples Browser](https://dotnet.github.io/infer/userguide/The%20examples%20browser.html), use [Windows Forms](https://docs.microsoft.com/en-us/dotnet/framework/winforms/) and therefore require .NET framework or Mono. +The core components of Infer.NET run on .NET Core. Some optional code, such as the [Examples Browser](https://dotnet.github.io/infer/userguide/The%20examples%20browser.html), use [Windows Forms](https://docs.microsoft.com/en-us/dotnet/framework/winforms/) and therefore require .NET framework or Mono. Some samples, such as the [Monty Hall problem](https://dotnet.github.io/infer/userguide/Monty%20Hall%20problem.html), use [WPF](https://docs.microsoft.com/en-us/visualstudio/designers/introduction-to-wpf) and therefore require Windows. ### Prerequisites -* **[.NET Core 3.1 SDK](https://www.microsoft.com/net/download/)** to build and run .NET Standard and .NET Core projects. +* **[.NET SDK](https://www.microsoft.com/net/download/)** to build and run .NET Standard and .NET Core projects. * (Optional) On Windows, the **[.NET framework developer pack](https://www.microsoft.com/net/download)**. On other platforms, **[Mono](https://www.mono-project.com/download/stable/)** (version 5.0 and higher) and the **[NuGet](https://docs.microsoft.com/en-us/nuget/install-nuget-client-tools)** package manager. @@ -76,7 +76,7 @@ There are three test assemblies in the solution: - **TestPublic.dll** in the folder `test/TestPublic`. - **Microsoft.ML.Probabilistic.Learners.Tests.dll** in the folder `test/Learners/LearnersTests`. -Depending on the build configuration and targeted framework, the assemblies will be located in the `bin/Debug/` or `bin/Release/` subdirectories +Depending on the build configuration and targeted framework, the assemblies will be located in the `bin/Debug/` or `bin/Release/` subdirectories of the test project. Runner executes tests in parallel by default. However, some test category must be run diff --git a/build/evaluator-netcore.yml b/build/evaluator-netcore.yml index 7990a74c..1fb8c272 100644 --- a/build/evaluator-netcore.yml +++ b/build/evaluator-netcore.yml @@ -14,6 +14,6 @@ steps: inputs: targetType: 'inline' script: dotnet Evaluator.dll InferNetRunsOnly.xml - workingDirectory: ${{ format('src/Learners/Runners/Evaluator/bin/{0}/net5.0', parameters.Configuration) }} + workingDirectory: ${{ format('src/Learners/Runners/Evaluator/bin/{0}/net6.0', parameters.Configuration) }} displayName: Running Evaluator continueOnError: true \ No newline at end of file diff --git a/build/nightly-netcore.yml b/build/nightly-netcore.yml index 0780ced0..cceaa06d 100644 --- a/build/nightly-netcore.yml +++ b/build/nightly-netcore.yml @@ -19,7 +19,7 @@ steps: - task: UseDotNet@2 inputs: packageType: 'sdk' - version: '5.x' + version: '6.x' - script: | dotnet build /p:DisableImplicitNuGetFallbackFolder=true --configuration $(BuildConfiguration)Core Infer.sln diff --git a/build/nightly-windows.yml b/build/nightly-windows.yml index 728481e0..9e603170 100644 --- a/build/nightly-windows.yml +++ b/build/nightly-windows.yml @@ -13,7 +13,7 @@ resources: trigger: none # disable CI build pool: - vmImage: 'windows-2019' + vmImage: 'windows-latest' # Cannot use matrix strategy to create jobs for different platforms, # since then the platform is given as a variable which cannot be passed as a parameter to a template, diff --git a/build/pr-factordocs.yml b/build/pr-factordocs.yml index 38dd67d9..23a6ea4a 100644 --- a/build/pr-factordocs.yml +++ b/build/pr-factordocs.yml @@ -14,7 +14,7 @@ steps: - task: UseDotNet@2 inputs: packageType: 'sdk' - version: '5.x' + version: '6.x' - script: | echo Checking $(Build.Repository.LocalPath)\src\Runtime\Factors\FactorDocs.xml... diff --git a/build/pr-msbuild.yml b/build/pr-msbuild.yml index 84ed286f..21516b03 100644 --- a/build/pr-msbuild.yml +++ b/build/pr-msbuild.yml @@ -17,7 +17,7 @@ jobs: - job: Win64 # Hosted Windows agent, VS 2017, testing on x64 timeoutInMinutes: 120 pool: - vmImage: windows-2019 + vmImage: windows-latest steps: - task: NuGetToolInstaller@1 inputs: @@ -41,7 +41,7 @@ jobs: - job: Win32 # Hosted Windows agent, VS 2017, testing on x86 timeoutInMinutes: 120 pool: - vmImage: windows-2019 + vmImage: windows-latest steps: - task: NuGetToolInstaller@1 inputs: diff --git a/build/pr-netcore.yml b/build/pr-netcore.yml index b0cab4c6..ce9117ef 100644 --- a/build/pr-netcore.yml +++ b/build/pr-netcore.yml @@ -11,7 +11,7 @@ steps: - task: UseDotNet@2 inputs: packageType: 'sdk' - version: '5.x' + version: '6.x' - script: | dotnet build /p:DisableImplicitNuGetFallbackFolder=true --configuration $(buildConfiguration)Core Infer.sln diff --git a/build/release.yml b/build/release.yml index b9e571cc..3df7f53d 100644 --- a/build/release.yml +++ b/build/release.yml @@ -22,7 +22,7 @@ jobs: - task: UseDotNet@2 inputs: packageType: 'sdk' - version: '5.x' + version: '6.x' - script: | dotnet build --configuration $(BuildConfiguration)Core Infer.sln @@ -37,7 +37,7 @@ jobs: - task: UseDotNet@2 inputs: packageType: 'sdk' - version: '5.x' + version: '6.x' - script: | dotnet build --configuration $(BuildConfiguration)Core Infer.sln @@ -149,10 +149,10 @@ jobs: condition: in(variables.SignType, 'real', 'test') - task: UseDotNet@2 - displayName: Get dotnet 5.x + displayName: Get dotnet 6.x inputs: packageType: 'sdk' - version: '5.x' + version: '6.x' - task: DotNetCoreCLI@2 displayName: Restore Infer.sln to enable packaging. diff --git a/docs/_build/makeApiDocs.ps1 b/docs/_build/makeApiDocs.ps1 index 574b58b0..6778fcd7 100644 --- a/docs/_build/makeApiDocs.ps1 +++ b/docs/_build/makeApiDocs.ps1 @@ -41,7 +41,7 @@ if (!(Test-Path $projPath)) { & "$dotnetExe" build "$projPath" /p:Configuration=Release Write-Host "Run PrepareSource for InferNet_Copy_Temp folder" -$prepareSourcePath = [IO.Path]::GetFullPath((join-path $sourceDirectory 'src/Tools/PrepareSource/bin/Release/net5.0/Microsoft.ML.Probabilistic.Tools.PrepareSource.dll')) +$prepareSourcePath = [IO.Path]::GetFullPath((join-path $sourceDirectory 'src/Tools/PrepareSource/bin/Release/net6.0/Microsoft.ML.Probabilistic.Tools.PrepareSource.dll')) & "$dotnetExe" "$prepareSourcePath" "$destinationDirectory" Write-Host "Install nuget package docfx.console" diff --git a/src/Examples/ClickThroughModel/ClickThroughModel.csproj b/src/Examples/ClickThroughModel/ClickThroughModel.csproj index 81a15145..697fca4a 100644 --- a/src/Examples/ClickThroughModel/ClickThroughModel.csproj +++ b/src/Examples/ClickThroughModel/ClickThroughModel.csproj @@ -17,12 +17,12 @@ - net5.0-windows + net6.0-windows - net5.0-windows;net462 + net6.0-windows;net462 diff --git a/src/Examples/ClinicalTrial/ClinicalTrial.csproj b/src/Examples/ClinicalTrial/ClinicalTrial.csproj index db90decc..d8eeefca 100644 --- a/src/Examples/ClinicalTrial/ClinicalTrial.csproj +++ b/src/Examples/ClinicalTrial/ClinicalTrial.csproj @@ -18,12 +18,12 @@ - net5.0-windows + net6.0-windows - net5.0-windows;net462 + net6.0-windows;net462 diff --git a/src/Examples/Crowdsourcing/Crowdsourcing.csproj b/src/Examples/Crowdsourcing/Crowdsourcing.csproj index 16c1828e..ee5d76b6 100644 --- a/src/Examples/Crowdsourcing/Crowdsourcing.csproj +++ b/src/Examples/Crowdsourcing/Crowdsourcing.csproj @@ -17,12 +17,12 @@ - net5.0 + net6.0 - net5.0;net462 + net6.0;net462 diff --git a/src/Examples/CrowdsourcingWithWords/CrowdsourcingWithWords.csproj b/src/Examples/CrowdsourcingWithWords/CrowdsourcingWithWords.csproj index 2a60acd4..0f4303fd 100644 --- a/src/Examples/CrowdsourcingWithWords/CrowdsourcingWithWords.csproj +++ b/src/Examples/CrowdsourcingWithWords/CrowdsourcingWithWords.csproj @@ -16,12 +16,12 @@ - net5.0 + net6.0 - net5.0;net462 + net6.0;net462 diff --git a/src/Examples/InferNET101/InferNET101.csproj b/src/Examples/InferNET101/InferNET101.csproj index 25473f3b..569e1e30 100644 --- a/src/Examples/InferNET101/InferNET101.csproj +++ b/src/Examples/InferNET101/InferNET101.csproj @@ -16,12 +16,12 @@ - net5.0 + net6.0 - net5.0;net462 + net6.0;net462 diff --git a/src/Examples/LDA/LDA.csproj b/src/Examples/LDA/LDA.csproj index 8ba56390..7c07023a 100644 --- a/src/Examples/LDA/LDA.csproj +++ b/src/Examples/LDA/LDA.csproj @@ -18,12 +18,12 @@ - net5.0 + net6.0 - net5.0;net462 + net6.0;net462 diff --git a/src/Examples/MotifFinder/MotifFinder.csproj b/src/Examples/MotifFinder/MotifFinder.csproj index 40a109f3..6ae021e4 100644 --- a/src/Examples/MotifFinder/MotifFinder.csproj +++ b/src/Examples/MotifFinder/MotifFinder.csproj @@ -18,12 +18,12 @@ - net5.0 + net6.0 - net5.0;net462 + net6.0;net462 diff --git a/src/Examples/ReviewerCalibration/ReviewerCalibration.csproj b/src/Examples/ReviewerCalibration/ReviewerCalibration.csproj index 2cd5ea6a..3abae317 100644 --- a/src/Examples/ReviewerCalibration/ReviewerCalibration.csproj +++ b/src/Examples/ReviewerCalibration/ReviewerCalibration.csproj @@ -17,12 +17,12 @@ - net5.0 + net6.0 - net5.0;net462 + net6.0;net462 diff --git a/src/Examples/RobustGaussianProcess/RobustGaussianProcess.csproj b/src/Examples/RobustGaussianProcess/RobustGaussianProcess.csproj index 49ef58e8..048439bb 100644 --- a/src/Examples/RobustGaussianProcess/RobustGaussianProcess.csproj +++ b/src/Examples/RobustGaussianProcess/RobustGaussianProcess.csproj @@ -20,18 +20,18 @@ - net5.0-windows + net6.0-windows - net5.0 + net6.0 - net5.0-windows;net462 + net6.0-windows;net462 - net5.0;net462 + net6.0;net462 diff --git a/src/Learners/ClassifierModels/ClassifierModels.csproj b/src/Learners/ClassifierModels/ClassifierModels.csproj index 86092ffb..dfebd982 100644 --- a/src/Learners/ClassifierModels/ClassifierModels.csproj +++ b/src/Learners/ClassifierModels/ClassifierModels.csproj @@ -19,19 +19,19 @@ - net5.0 + net6.0 - net5.0;net462 + net6.0;net462 true - + true diff --git a/src/Learners/RecommenderModels/RecommenderModels.csproj b/src/Learners/RecommenderModels/RecommenderModels.csproj index 7a1af76e..9f8ddf17 100644 --- a/src/Learners/RecommenderModels/RecommenderModels.csproj +++ b/src/Learners/RecommenderModels/RecommenderModels.csproj @@ -19,19 +19,19 @@ - net5.0 + net6.0 - net5.0;net462 + net6.0;net462 true - + true diff --git a/src/Learners/Runners/CommandLine/CommandLine.csproj b/src/Learners/Runners/CommandLine/CommandLine.csproj index 87d36873..7ae898ad 100644 --- a/src/Learners/Runners/CommandLine/CommandLine.csproj +++ b/src/Learners/Runners/CommandLine/CommandLine.csproj @@ -18,12 +18,12 @@ - net5.0 + net6.0 - net5.0;net462 + net6.0;net462 diff --git a/src/Learners/Runners/Evaluator/Evaluator.csproj b/src/Learners/Runners/Evaluator/Evaluator.csproj index 4044028a..cf730f7f 100644 --- a/src/Learners/Runners/Evaluator/Evaluator.csproj +++ b/src/Learners/Runners/Evaluator/Evaluator.csproj @@ -9,6 +9,8 @@ TRACE Microsoft.ML.Probabilistic.Learners.Runners Debug;Release;DebugFull;DebugCore;ReleaseFull;ReleaseCore + + SYSLIB0014;$(NoWarn) @@ -18,12 +20,12 @@ - net5.0 + net6.0 - net5.0;net462 + net6.0;net462 diff --git a/src/Runtime/Core/Serialization/MatlabReader.cs b/src/Runtime/Core/Serialization/MatlabReader.cs index 647fcda0..4306aada 100644 --- a/src/Runtime/Core/Serialization/MatlabReader.cs +++ b/src/Runtime/Core/Serialization/MatlabReader.cs @@ -96,7 +96,7 @@ namespace Microsoft.ML.Probabilistic.Serialization MatType dataType = (MatType) ReadInt(); int numBytes = ReadInt(); byte[] bytes = new byte[numBytes]; - if (reader.Read(bytes, 0, numBytes) < numBytes) throw new EndOfStreamException(); + if (Read(reader, bytes, 0, numBytes) < numBytes) throw new EndOfStreamException(); if (dataType == MatType.COMPRESSED) { // MAT file compression uses Zlib format, which is the same as Deflate but with an extra header and footer. @@ -573,7 +573,7 @@ namespace Microsoft.ML.Probabilistic.Serialization { string header = ReadString(124); byte[] bytes = new byte[4]; - if (reader.Read(bytes, 0, 4) < 4) throw new EndOfStreamException(); + if (Read(reader, bytes, 0, 4) < 4) throw new EndOfStreamException(); if ((bytes[0] != 0x00) || (bytes[1] != 0x01) || (bytes[2] != 'I') || (bytes[3] != 'M')) throw new NotImplementedException("Unrecognized header"); return header.TrimEnd(' '); @@ -586,7 +586,7 @@ namespace Microsoft.ML.Probabilistic.Serialization protected int ReadInt() { byte[] bytes = new byte[4]; - if (reader.Read(bytes, 0, 4) < 4) throw new EndOfStreamException(); + if (Read(reader, bytes, 0, 4) < 4) throw new EndOfStreamException(); return BitConverter.ToInt32(bytes, 0); } @@ -597,7 +597,7 @@ namespace Microsoft.ML.Probabilistic.Serialization protected uint ReadUInt() { byte[] bytes = new byte[4]; - if (reader.Read(bytes, 0, 4) < 4) throw new EndOfStreamException(); + if (Read(reader, bytes, 0, 4) < 4) throw new EndOfStreamException(); return BitConverter.ToUInt32(bytes, 0); } @@ -608,7 +608,7 @@ namespace Microsoft.ML.Probabilistic.Serialization protected short ReadInt16() { byte[] bytes = new byte[2]; - if (reader.Read(bytes, 0, 2) < 2) throw new EndOfStreamException(); + if (Read(reader, bytes, 0, 2) < 2) throw new EndOfStreamException(); return BitConverter.ToInt16(bytes, 0); } @@ -619,7 +619,7 @@ namespace Microsoft.ML.Probabilistic.Serialization protected ushort ReadUInt16() { byte[] bytes = new byte[2]; - if (reader.Read(bytes, 0, 2) < 2) throw new EndOfStreamException(); + if (Read(reader, bytes, 0, 2) < 2) throw new EndOfStreamException(); return BitConverter.ToUInt16(bytes, 0); } @@ -630,7 +630,7 @@ namespace Microsoft.ML.Probabilistic.Serialization protected long ReadInt64() { byte[] bytes = new byte[8]; - if (reader.Read(bytes, 0, 8) < 8) throw new EndOfStreamException(); + if (Read(reader, bytes, 0, 8) < 8) throw new EndOfStreamException(); return BitConverter.ToInt64(bytes, 0); } @@ -641,7 +641,7 @@ namespace Microsoft.ML.Probabilistic.Serialization protected ulong ReadUInt64() { byte[] bytes = new byte[8]; - if (reader.Read(bytes, 0, 8) < 8) throw new EndOfStreamException(); + if (Read(reader, bytes, 0, 8) < 8) throw new EndOfStreamException(); return BitConverter.ToUInt64(bytes, 0); } @@ -652,7 +652,7 @@ namespace Microsoft.ML.Probabilistic.Serialization protected float ReadSingle() { byte[] bytes = new byte[4]; - if (reader.Read(bytes, 0, 4) < 4) throw new EndOfStreamException(); + if (Read(reader, bytes, 0, 4) < 4) throw new EndOfStreamException(); return BitConverter.ToSingle(bytes, 0); } @@ -663,7 +663,7 @@ namespace Microsoft.ML.Probabilistic.Serialization protected double ReadDouble() { byte[] bytes = new byte[8]; - if (reader.Read(bytes, 0, 8) < 8) throw new EndOfStreamException(); + if (Read(reader, bytes, 0, 8) < 8) throw new EndOfStreamException(); return BitConverter.ToDouble(bytes, 0); } @@ -675,7 +675,7 @@ namespace Microsoft.ML.Probabilistic.Serialization protected string ReadString(int length) { byte[] bytes = new byte[length]; - if (reader.Read(bytes, 0, length) < length) throw new EndOfStreamException(); + if (Read(reader, bytes, 0, length) < length) throw new EndOfStreamException(); return ParseString(bytes, 0, bytes.Length); } @@ -766,5 +766,18 @@ namespace Microsoft.ML.Probabilistic.Serialization if (row != matrix.GetLength(0)) throw new InferRuntimeException("Expected " + matrix.GetLength(0) + " rows, but were " + row + " rows."); return matrix; } + + protected int Read(Stream stream, byte[] bytes, int offset, int count) + { + // https://docs.microsoft.com/en-us/dotnet/core/compatibility/core-libraries/6.0/partial-byte-reads-in-streams + var totalRead = 0; + while (totalRead < count) + { + var byteRead = stream.Read(bytes, offset + totalRead, count - totalRead); + if (byteRead == 0) break; + totalRead += byteRead; + } + return totalRead; + } } } \ No newline at end of file diff --git a/src/Tools/BuildFactorDoc/Tools.BuildFactorDoc.csproj b/src/Tools/BuildFactorDoc/Tools.BuildFactorDoc.csproj index b823b063..3aab9cbe 100644 --- a/src/Tools/BuildFactorDoc/Tools.BuildFactorDoc.csproj +++ b/src/Tools/BuildFactorDoc/Tools.BuildFactorDoc.csproj @@ -3,7 +3,7 @@ Exe - net5.0 + net6.0 Microsoft.ML.Probabilistic.Tools.BuildFactorDoc Microsoft.ML.Probabilistic.Tools.BuildFactorDoc diff --git a/src/Tools/PrepareSource/Tools.PrepareSource.csproj b/src/Tools/PrepareSource/Tools.PrepareSource.csproj index be851146..099a89cf 100644 --- a/src/Tools/PrepareSource/Tools.PrepareSource.csproj +++ b/src/Tools/PrepareSource/Tools.PrepareSource.csproj @@ -3,7 +3,7 @@ Exe - net5.0 + net6.0 Microsoft.ML.Probabilistic.Tools.PrepareSource Microsoft.ML.Probabilistic.Tools.PrepareSource diff --git a/src/Tutorials/Tutorials.csproj b/src/Tutorials/Tutorials.csproj index 6cc253ee..0f1aded9 100644 --- a/src/Tutorials/Tutorials.csproj +++ b/src/Tutorials/Tutorials.csproj @@ -20,12 +20,12 @@ - net5.0 + net6.0 - net5.0;net462 + net6.0;net462 false diff --git a/test/Learners/LearnersTests/LearnersTests.csproj b/test/Learners/LearnersTests/LearnersTests.csproj index cf241961..1739780d 100644 --- a/test/Learners/LearnersTests/LearnersTests.csproj +++ b/test/Learners/LearnersTests/LearnersTests.csproj @@ -15,12 +15,12 @@ - net5.0 + net6.0 - net5.0;net462 + net6.0;net462 diff --git a/test/Learners/TestApp/TestApp.csproj b/test/Learners/TestApp/TestApp.csproj index 34cdd6db..a954398e 100644 --- a/test/Learners/TestApp/TestApp.csproj +++ b/test/Learners/TestApp/TestApp.csproj @@ -18,12 +18,12 @@ - net5.0 + net6.0 - net5.0;net462 + net6.0;net462 diff --git a/test/TestApp/TestApp.csproj b/test/TestApp/TestApp.csproj index 1333aa3b..d2252f62 100644 --- a/test/TestApp/TestApp.csproj +++ b/test/TestApp/TestApp.csproj @@ -20,12 +20,12 @@ - net5.0 + net6.0 - net5.0;net462 + net6.0;net462 diff --git a/test/TestFSharp/TestFSharp.fsproj b/test/TestFSharp/TestFSharp.fsproj index c8a16c4d..045fc157 100644 --- a/test/TestFSharp/TestFSharp.fsproj +++ b/test/TestFSharp/TestFSharp.fsproj @@ -19,7 +19,7 @@ - net5.0 + net6.0 diff --git a/test/TestPublic/TestPublic.csproj b/test/TestPublic/TestPublic.csproj index c6efb0ba..a0f0cdef 100644 --- a/test/TestPublic/TestPublic.csproj +++ b/test/TestPublic/TestPublic.csproj @@ -17,12 +17,12 @@ - net5.0 + net6.0 - net5.0;net462 + net6.0;net462 diff --git a/test/Tests/Core/MatlabSerializationTests.cs b/test/Tests/Core/MatlabSerializationTests.cs index 47baeb1a..c560506d 100644 --- a/test/Tests/Core/MatlabSerializationTests.cs +++ b/test/Tests/Core/MatlabSerializationTests.cs @@ -18,14 +18,16 @@ namespace Microsoft.ML.Probabilistic.Tests.Core Dictionary dict = MatlabReader.Read(Path.Combine(TestUtils.DataFolderPath, "IRT2PL_10_250.mat")); Assert.Equal(5, dict.Count); Matrix m = (Matrix)dict["Y"]; - Assert.True(m.Rows == 250); - Assert.True(m.Cols == 10); - Assert.True(m[0, 1] == 0.0); - Assert.True(m[1, 0] == 1.0); + Assert.Equal(250, m.Rows); + Assert.Equal(10, m.Cols); + Assert.Equal(0.0, m[0, 1]); + Assert.Equal(1.0, m[1, 0]); m = (Matrix)dict["difficulty"]; - Assert.True(m.Rows == 10); - Assert.True(m.Cols == 1); + Assert.Equal(10, m.Rows); + Assert.Equal(1, m.Cols); Assert.True(MMath.AbsDiff(m[1], 0.7773) < 2e-4); + m = (Matrix)dict["p"]; + Assert.Equal(0.68150001272133187, m[0, 7]); } [Fact] diff --git a/test/Tests/Tests.csproj b/test/Tests/Tests.csproj index f1adb27e..115d7bcf 100644 --- a/test/Tests/Tests.csproj +++ b/test/Tests/Tests.csproj @@ -18,12 +18,12 @@ - net5.0 + net6.0 - net5.0;net462 + net6.0;net462 diff --git a/test/netcoretest.sh b/test/netcoretest.sh index 9f6365d2..52c4d8f0 100644 --- a/test/netcoretest.sh +++ b/test/netcoretest.sh @@ -15,7 +15,7 @@ then configuration=Release fi -compath=/bin/${configuration}/net5.0/ +compath=/bin/${configuration}/net6.0/ # filter for parallel test run #parallel_filter='-notrait Platform=x86 -notrait Category=OpenBug -notrait Category=BadTest -notrait Category=CompilerOptionsTest -notrait Category=CsoftModel -notrait Category=ModifiesGlobals -notrait Category=DistributedTest -notrait Category=Performance'