diff --git a/BUILDING.md b/BUILDING.md index 749cfc01..d60376b1 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -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/common.props b/build/common.props index 4e6e4e19..4c15aa7a 100644 --- a/build/common.props +++ b/build/common.props @@ -8,7 +8,7 @@ false true $(MSBuildThisFileDirectory)\..\Infer.snk - + false $(MSBuildThisFileDirectory)\..\CodeAnalysis.ruleset diff --git a/build/copyassemblies.sh b/build/copyassemblies.sh index be0cc6cc..3d2a786a 100644 --- a/build/copyassemblies.sh +++ b/build/copyassemblies.sh @@ -51,6 +51,14 @@ mkdir "${out}/net6.0-windows" dst="${out}/net6.0-windows" src="bin/${configuration}/net6.0-windows" +cp ../src/Visualizers/Windows/${src}/Microsoft.ML.Probabilistic.Compiler.Visualizers.Windows.dll ${dst} +cp ../src/Visualizers/Windows/${src}/Microsoft.ML.Probabilistic.Compiler.Visualizers.Windows.pdb ${dst} +cp ../src/Visualizers/Windows/${src}/Microsoft.ML.Probabilistic.Compiler.Visualizers.Windows.xml ${dst} + +mkdir "${out}/net8.0-windows" +dst="${out}/net8.0-windows" +src="bin/${configuration}/net8.0-windows" + cp ../src/Visualizers/Windows/${src}/Microsoft.ML.Probabilistic.Compiler.Visualizers.Windows.dll ${dst} cp ../src/Visualizers/Windows/${src}/Microsoft.ML.Probabilistic.Compiler.Visualizers.Windows.pdb ${dst} cp ../src/Visualizers/Windows/${src}/Microsoft.ML.Probabilistic.Compiler.Visualizers.Windows.xml ${dst} \ No newline at end of file diff --git a/build/evaluator-netcore.yml b/build/evaluator-netcore.yml index 1fb8c272..739b14b6 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}/net6.0', parameters.Configuration) }} + workingDirectory: ${{ format('src/Learners/Runners/Evaluator/bin/{0}/net8.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 cceaa06d..4214e4a0 100644 --- a/build/nightly-netcore.yml +++ b/build/nightly-netcore.yml @@ -19,7 +19,7 @@ steps: - task: UseDotNet@2 inputs: packageType: 'sdk' - version: '6.x' + version: '8.x' - script: | dotnet build /p:DisableImplicitNuGetFallbackFolder=true --configuration $(BuildConfiguration)Core Infer.sln diff --git a/build/pr-factordocs.yml b/build/pr-factordocs.yml index 23a6ea4a..1f4fd4cb 100644 --- a/build/pr-factordocs.yml +++ b/build/pr-factordocs.yml @@ -14,7 +14,7 @@ steps: - task: UseDotNet@2 inputs: packageType: 'sdk' - version: '6.x' + version: '8.x' - script: | echo Checking $(Build.Repository.LocalPath)\src\Runtime\Factors\FactorDocs.xml... diff --git a/build/pr-netcore.yml b/build/pr-netcore.yml index ce9117ef..90d672ba 100644 --- a/build/pr-netcore.yml +++ b/build/pr-netcore.yml @@ -11,7 +11,7 @@ steps: - task: UseDotNet@2 inputs: packageType: 'sdk' - version: '6.x' + version: '8.x' - script: | dotnet build /p:DisableImplicitNuGetFallbackFolder=true --configuration $(buildConfiguration)Core Infer.sln diff --git a/build/release.yml b/build/release.yml index d81d85bf..9d15673c 100644 --- a/build/release.yml +++ b/build/release.yml @@ -22,7 +22,7 @@ jobs: - task: UseDotNet@2 inputs: packageType: 'sdk' - version: '6.x' + version: '8.x' - script: | dotnet build --configuration $(BuildConfiguration)Core Infer.sln @@ -37,7 +37,7 @@ jobs: - task: UseDotNet@2 inputs: packageType: 'sdk' - version: '6.x' + version: '8.x' - script: | dotnet build --configuration $(BuildConfiguration)Core Infer.sln diff --git a/src/Examples/ClickThroughModel/ClickThroughModel.csproj b/src/Examples/ClickThroughModel/ClickThroughModel.csproj index 772faa38..6f2ee344 100644 --- a/src/Examples/ClickThroughModel/ClickThroughModel.csproj +++ b/src/Examples/ClickThroughModel/ClickThroughModel.csproj @@ -17,12 +17,12 @@ - net6.0-windows + net8.0-windows - net6.0-windows;net472 + net8.0-windows;net472 diff --git a/src/Examples/ClinicalTrial/ClinicalTrial.csproj b/src/Examples/ClinicalTrial/ClinicalTrial.csproj index c5f7516a..afbbdd5a 100644 --- a/src/Examples/ClinicalTrial/ClinicalTrial.csproj +++ b/src/Examples/ClinicalTrial/ClinicalTrial.csproj @@ -18,12 +18,12 @@ - net6.0-windows + net8.0-windows - net6.0-windows;net472 + net8.0-windows;net472 diff --git a/src/Examples/Crowdsourcing/Crowdsourcing.csproj b/src/Examples/Crowdsourcing/Crowdsourcing.csproj index 69b6c3c2..70f9ef7c 100644 --- a/src/Examples/Crowdsourcing/Crowdsourcing.csproj +++ b/src/Examples/Crowdsourcing/Crowdsourcing.csproj @@ -17,12 +17,12 @@ - net6.0 + net8.0 - net6.0;net472 + net8.0;net472 diff --git a/src/Examples/CrowdsourcingWithWords/CrowdsourcingWithWords.csproj b/src/Examples/CrowdsourcingWithWords/CrowdsourcingWithWords.csproj index 0ef2fd6e..d7eb81d4 100644 --- a/src/Examples/CrowdsourcingWithWords/CrowdsourcingWithWords.csproj +++ b/src/Examples/CrowdsourcingWithWords/CrowdsourcingWithWords.csproj @@ -16,12 +16,12 @@ - net6.0 + net8.0 - net6.0;net472 + net8.0;net472 diff --git a/src/Examples/InferNET101/InferNET101.csproj b/src/Examples/InferNET101/InferNET101.csproj index 3f6eef0c..16be76a0 100644 --- a/src/Examples/InferNET101/InferNET101.csproj +++ b/src/Examples/InferNET101/InferNET101.csproj @@ -16,12 +16,12 @@ - net6.0 + net8.0 - net6.0;net472 + net8.0;net472 diff --git a/src/Examples/LDA/LDA.csproj b/src/Examples/LDA/LDA.csproj index 15b213dc..edf80724 100644 --- a/src/Examples/LDA/LDA.csproj +++ b/src/Examples/LDA/LDA.csproj @@ -18,12 +18,12 @@ - net6.0 + net8.0 - net6.0;net472 + net8.0;net472 diff --git a/src/Examples/MotifFinder/MotifFinder.csproj b/src/Examples/MotifFinder/MotifFinder.csproj index 2124709e..46da476e 100644 --- a/src/Examples/MotifFinder/MotifFinder.csproj +++ b/src/Examples/MotifFinder/MotifFinder.csproj @@ -18,12 +18,12 @@ - net6.0 + net8.0 - net6.0;net472 + net8.0;net472 diff --git a/src/Examples/ReviewerCalibration/ReviewerCalibration.csproj b/src/Examples/ReviewerCalibration/ReviewerCalibration.csproj index 5f8a8f46..28a1c34a 100644 --- a/src/Examples/ReviewerCalibration/ReviewerCalibration.csproj +++ b/src/Examples/ReviewerCalibration/ReviewerCalibration.csproj @@ -17,12 +17,12 @@ - net6.0 + net8.0 - net6.0;net472 + net8.0;net472 diff --git a/src/Examples/RobustGaussianProcess/RobustGaussianProcess.csproj b/src/Examples/RobustGaussianProcess/RobustGaussianProcess.csproj index 563e6b7a..99faa020 100644 --- a/src/Examples/RobustGaussianProcess/RobustGaussianProcess.csproj +++ b/src/Examples/RobustGaussianProcess/RobustGaussianProcess.csproj @@ -20,18 +20,18 @@ - net6.0-windows + net8.0-windows - net6.0 + net8.0 - net6.0-windows;net472 + net8.0-windows;net472 - net6.0;net472 + net8.0;net472 diff --git a/src/Learners/ClassifierModels/ClassifierModels.csproj b/src/Learners/ClassifierModels/ClassifierModels.csproj index efc140aa..002dff05 100644 --- a/src/Learners/ClassifierModels/ClassifierModels.csproj +++ b/src/Learners/ClassifierModels/ClassifierModels.csproj @@ -19,23 +19,23 @@ - net6.0 + net8.0 - net6.0;net6.0-windows;net472 + net8.0;net8.0-windows;net472 true - + true - + true diff --git a/src/Learners/RecommenderModels/RecommenderModels.csproj b/src/Learners/RecommenderModels/RecommenderModels.csproj index 1ea9b866..69533979 100644 --- a/src/Learners/RecommenderModels/RecommenderModels.csproj +++ b/src/Learners/RecommenderModels/RecommenderModels.csproj @@ -19,19 +19,19 @@ - net6.0 + net8.0 - net6.0;net472 + net8.0;net472 true - + true diff --git a/src/Learners/Runners/CommandLine/CommandLine.csproj b/src/Learners/Runners/CommandLine/CommandLine.csproj index 47f2639d..2756e213 100644 --- a/src/Learners/Runners/CommandLine/CommandLine.csproj +++ b/src/Learners/Runners/CommandLine/CommandLine.csproj @@ -18,12 +18,12 @@ - net6.0 + net8.0 - net6.0;net472 + net8.0;net472 diff --git a/src/Learners/Runners/Evaluator/Evaluator.csproj b/src/Learners/Runners/Evaluator/Evaluator.csproj index 07035983..0d18e4d3 100644 --- a/src/Learners/Runners/Evaluator/Evaluator.csproj +++ b/src/Learners/Runners/Evaluator/Evaluator.csproj @@ -20,12 +20,12 @@ - net6.0 + net8.0 - net6.0;net472 + net8.0;net472 diff --git a/src/Learners/Runners/Evaluator/Wrappers/ExternalCommandExecutionException.cs b/src/Learners/Runners/Evaluator/Wrappers/ExternalCommandExecutionException.cs index f761e866..6f95ca40 100644 --- a/src/Learners/Runners/Evaluator/Wrappers/ExternalCommandExecutionException.cs +++ b/src/Learners/Runners/Evaluator/Wrappers/ExternalCommandExecutionException.cs @@ -40,6 +40,7 @@ namespace Microsoft.ML.Probabilistic.Learners.Runners { } +#if NET472 /// /// Initializes a new instance of the class. /// @@ -49,5 +50,6 @@ namespace Microsoft.ML.Probabilistic.Learners.Runners : base(info, context) { } +#endif } } diff --git a/src/Runtime/Core/Serialization/InferDataContractResolver.cs b/src/Runtime/Core/Serialization/InferDataContractResolver.cs index e0b79bd1..841095d8 100644 --- a/src/Runtime/Core/Serialization/InferDataContractResolver.cs +++ b/src/Runtime/Core/Serialization/InferDataContractResolver.cs @@ -122,6 +122,12 @@ namespace Microsoft.ML.Probabilistic.Serialization foreach (var field in type.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.DeclaredOnly)) { + // In .NET8.0 we now have certain compiler generated fields without a proper type. + if (field.FieldType.FullName == null) + { + continue; + } + RecursivelyAddTypes(field.FieldType, types); } diff --git a/src/Tools/BuildFactorDoc/Tools.BuildFactorDoc.csproj b/src/Tools/BuildFactorDoc/Tools.BuildFactorDoc.csproj index 3aab9cbe..e67e400b 100644 --- a/src/Tools/BuildFactorDoc/Tools.BuildFactorDoc.csproj +++ b/src/Tools/BuildFactorDoc/Tools.BuildFactorDoc.csproj @@ -3,7 +3,7 @@ Exe - net6.0 + net8.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 099a89cf..f692f586 100644 --- a/src/Tools/PrepareSource/Tools.PrepareSource.csproj +++ b/src/Tools/PrepareSource/Tools.PrepareSource.csproj @@ -3,7 +3,7 @@ Exe - net6.0 + net8.0 Microsoft.ML.Probabilistic.Tools.PrepareSource Microsoft.ML.Probabilistic.Tools.PrepareSource diff --git a/src/Tutorials/Tutorials.csproj b/src/Tutorials/Tutorials.csproj index 8761e39d..54608655 100644 --- a/src/Tutorials/Tutorials.csproj +++ b/src/Tutorials/Tutorials.csproj @@ -19,12 +19,12 @@ - net6.0 + net8.0 - net6.0;net6.0-windows;net472 + net8.0;net8.0-windows;net472 false @@ -52,7 +52,7 @@ - + diff --git a/src/Visualizers/Windows/Visualizers.Windows.csproj b/src/Visualizers/Windows/Visualizers.Windows.csproj index f742a04a..421ad6ec 100644 --- a/src/Visualizers/Windows/Visualizers.Windows.csproj +++ b/src/Visualizers/Windows/Visualizers.Windows.csproj @@ -3,7 +3,7 @@ Infer.NET is a framework for running Bayesian inference in graphical models. It can also be used for probabilistic programming. This package contains visualization tools for exploring and analyzing models on Windows platform. - net6.0-windows;net472 + net8.0-windows;net6.0-windows;net472 Microsoft.ML.Probabilistic.Compiler.Visualizers.Windows Microsoft.ML.Probabilistic.Visualizers.Windows$(NuGetPackageIdSuffix) TRACE;SUPPRESS_XMLDOC_WARNINGS, SUPPRESS_UNREACHABLE_CODE_WARNINGS, SUPPRESS_AMBIGUOUS_REFERENCE_WARNINGS @@ -74,6 +74,7 @@ by the NuGet package format; so we list them explicitly here. --> + diff --git a/test/Learners/LearnersTests/LearnersTests.csproj b/test/Learners/LearnersTests/LearnersTests.csproj index 70e8219e..24a636b6 100644 --- a/test/Learners/LearnersTests/LearnersTests.csproj +++ b/test/Learners/LearnersTests/LearnersTests.csproj @@ -15,12 +15,12 @@ - net6.0 + net8.0 - net6.0;net472 + net8.0;net472 diff --git a/test/Learners/TestApp/TestApp.csproj b/test/Learners/TestApp/TestApp.csproj index 456b1c90..cfba3ccd 100644 --- a/test/Learners/TestApp/TestApp.csproj +++ b/test/Learners/TestApp/TestApp.csproj @@ -18,12 +18,12 @@ - net6.0 + net8.0 - net6.0;net472 + net8.0;net472 diff --git a/test/TestApp/TestApp.csproj b/test/TestApp/TestApp.csproj index a4416844..298fc0d4 100644 --- a/test/TestApp/TestApp.csproj +++ b/test/TestApp/TestApp.csproj @@ -20,12 +20,12 @@ - net6.0 + net8.0 - net6.0;net6.0-windows;net472 + net8.0;net8.0-windows;net472 diff --git a/test/TestFSharp/TestFSharp.fsproj b/test/TestFSharp/TestFSharp.fsproj index 6af9e1e9..937cbeda 100644 --- a/test/TestFSharp/TestFSharp.fsproj +++ b/test/TestFSharp/TestFSharp.fsproj @@ -19,12 +19,12 @@ - net6.0 + net8.0 - net6.0;net472 + net8.0;net472 diff --git a/test/TestPublic/TestPublic.csproj b/test/TestPublic/TestPublic.csproj index 44f392ae..18350776 100644 --- a/test/TestPublic/TestPublic.csproj +++ b/test/TestPublic/TestPublic.csproj @@ -17,12 +17,12 @@ - net6.0 + net8.0 - net6.0;net6.0-windows;net472 + net8.0;net8.0-windows;net472 diff --git a/test/Tests/InferDataContractResolverTests.cs b/test/Tests/InferDataContractResolverTests.cs index 27a801d2..95f84e45 100644 --- a/test/Tests/InferDataContractResolverTests.cs +++ b/test/Tests/InferDataContractResolverTests.cs @@ -83,6 +83,12 @@ namespace Microsoft.ML.Probabilistic.Tests foreach (var field in type.GetFields(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.DeclaredOnly)) { + // In .NET8.0 we now have certain compiler generated fields without a proper type. + if (field.FieldType.FullName == null) + { + continue; + } + VisitTypesRecursively(field.FieldType, visitType, alreadyReviewed); } } diff --git a/test/Tests/Tests.csproj b/test/Tests/Tests.csproj index df42173d..b7571684 100644 --- a/test/Tests/Tests.csproj +++ b/test/Tests/Tests.csproj @@ -18,12 +18,12 @@ - net6.0 + net8.0 - net6.0;net472 + net8.0;net472 diff --git a/test/netcoretest.sh b/test/netcoretest.sh index 8b1b4541..2c84b925 100644 --- a/test/netcoretest.sh +++ b/test/netcoretest.sh @@ -15,7 +15,7 @@ then configuration=Release fi -compath=/bin/${configuration}/net6.0/ +compath=/bin/${configuration}/net8.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'