If this has already been brought up and I somehow missed the issue, please feel free to close this.
Creating a new .NET 8 (8.0.101 in my case) console application, referencing Microsoft.ML.Probabilistic, and Microsoft.ML.Probabilistic.Compiler and replacing the contents of the Program.cs with the following:
using Microsoft.ML.Probabilistic.Models;
Variable<bool> firstCoin = Variable.Bernoulli(0.5).Named("firstCoin");
Variable<bool> secondCoin = Variable.Bernoulli(0.5).Named("secondCoin");
Variable<bool> bothHeads = (firstCoin & secondCoin).Named("bothHeads");
InferenceEngine engine = new InferenceEngine();
Console.WriteLine("Probability both coins are heads: " + engine.Infer(bothHeads));
generates this exception:
Unhandled exception. System.PlatformNotSupportedException: Current platform is not supported by the current compiler choice Auto. Try a different one.
---> System.PlatformNotSupportedException: Operation is not supported on this platform.
at Microsoft.CSharp.CSharpCodeGenerator.FromFileBatch(CompilerParameters options, String[] fileNames)
at Microsoft.CSharp.CSharpCodeGenerator.System.CodeDom.Compiler.ICodeCompiler.CompileAssemblyFromFileBatch(CompilerParameters options, String[] fileNames)
at System.CodeDom.Compiler.CodeDomProvider.CompileAssemblyFromFile(CompilerParameters options, String[] fileNames)
at Microsoft.ML.Probabilistic.Compiler.CodeCompiler.CompileWithCodeDom(List`1 filenames, List`1 sources, ICollection`1 referencedAssemblies)
at Microsoft.ML.Probabilistic.Compiler.CodeCompiler.Compile(List`1 filenames, List`1 sources, ICollection`1 referencedAssemblies)
--- End of inner exception stack trace ---
at Microsoft.ML.Probabilistic.Compiler.CodeCompiler.Compile(List`1 filenames, List`1 sources, ICollection`1 referencedAssemblies)
at Microsoft.ML.Probabilistic.Compiler.CodeCompiler.WriteAndCompile(List`1 typeDeclarations)
at Microsoft.ML.Probabilistic.Compiler.ModelCompiler.CompileWithoutParams[T](List`1 itds)
at Microsoft.ML.Probabilistic.Compiler.ModelCompiler.CompileWithoutParams(ITypeDeclaration itd, MethodBase method, AttributeRegistry`2 inputAttributes)
at Microsoft.ML.Probabilistic.Models.InferenceEngine.Compile()
at Microsoft.ML.Probabilistic.Models.InferenceEngine.BuildAndCompile(Boolean inferOnlySpecifiedVars, IEnumerable`1 vars)
at Microsoft.ML.Probabilistic.Models.InferenceEngine.GetCompiledInferenceAlgorithm(Boolean inferOnlySpecifiedVars, IVariable var)
at Microsoft.ML.Probabilistic.Models.InferenceEngine.InferAll(Boolean inferOnlySpecifiedVars, IVariable var)
at Microsoft.ML.Probabilistic.Models.InferenceEngine.Infer(IVariable var)
at Program.<Main>$(String[] args) in C:\Users\Jonah\Desktop\InferExamples\Program.cs:line 10
Process finished with exit code -532,462,766.
Creating a new .NET 8 (
8.0.101
in my case) console application, referencingMicrosoft.ML.Probabilistic
, andMicrosoft.ML.Probabilistic.Compiler
and replacing the contents of theProgram.cs
with the following:generates this exception:
This is the
*.csproj
for referenceFor what it's worth, it works totally fine if I change the target framework from
net8.0
tonet7.0
.