none
running the tutorials2008.sln using Visual Studio 2008 (version 9.0.21022.8 RTM) and Microsoft .NET 3.5 SP1

    Question

  • Dear Infer.NET team,
    This is a great package. Thank you all for the effort!
    When I tried to run the tutorials2008.sln using VS2008 and .NET 3.5 SP1, I see the following errors in the output window:
    ----------------------------
    Project file contains ToolsVersion="4.0", which is not supported by this version of MSBuild. Treating the project as if it had ToolsVersion="3.5".
    C:\Windows\Microsoft.NET\Framework\v3.5\Csc.exe /noconfig /nowarn:1701,1702 /errorreport:prompt /warn:4 /define:DEBUG;TRACE /reference:..\bin\Debug\Infer.Compiler.dll /reference:..\bin\Debug\Infer.Runtime.dll /reference:"C:\Program Files\Reference Assemblies\Microsoft\Framework\v3.5\System.Core.dll" /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Data.dll /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.dll /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Drawing.dll /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Windows.Forms.dll /reference:C:\Windows\Microsoft.NET\Framework\v2.0.50727\System.Xml.dll /debug+ /debug:full /optimize- /out:obj\Debug\Tutorials.exe /target:winexe /win32icon:Infer.ico BugsRats.cs ClickModel.cs BayesPointMachineExample.cs ClinicalTrial.cs LearningAGaussianWithRanges.cs LearningAGaussian.cs MixtureOfGaussians.cs TruncatedGaussianEfficient.cs FirstExample.cs Properties\AssemblyInfo.cs RunMe.cs TruncatedGaussian.cs
    C:\Users\User\Documents\Infer.NET 2.4\Examples and Tutorials\MixtureOfGaussians.cs(59,5): warning CS0618: 'MicrosoftResearch.Infer.InferenceEngine.InferAll(params MicrosoftResearch.Infer.Models.IVariable[])' is obsolete: 'Use OptimiseForVariables property and individual Infer() calls instead.'
    C:\Users\User\Documents\Infer.NET 2.4\Examples and Tutorials\ClickModel.cs(232,39): error CS1501: No overload for method 'Random' takes '1' arguments
    c:\Users\User\Documents\Infer.NET 2.4\bin\Debug\Infer.Compiler.dll: (Related file)
    C:\Users\User\Documents\Infer.NET 2.4\Examples and Tutorials\ClickModel.cs(233,39): error CS1501: No overload for method 'Random' takes '1' arguments
    c:\Users\User\Documents\Infer.NET 2.4\bin\Debug\Infer.Compiler.dll: (Related file)
    C:\Users\User\Documents\Infer.NET 2.4\Examples and Tutorials\ClickModel.cs(234,39): error CS1501: No overload for method 'Random' takes '1' arguments
    c:\Users\User\Documents\Infer.NET 2.4\bin\Debug\Infer.Compiler.dll: (Related file)
    C:\Users\User\Documents\Infer.NET 2.4\Examples and Tutorials\ClickModel.cs(235,39): error CS1501: No overload for method 'Random' takes '1' arguments
    c:\Users\User\Documents\Infer.NET 2.4\bin\Debug\Infer.Compiler.dll: (Related file)
    C:\Users\User\Documents\Infer.NET 2.4\Examples and Tutorials\ClickModel.cs(238,21): error CS1501: No overload for method 'Random' takes '1' arguments
    c:\Users\User\Documents\Infer.NET 2.4\bin\Debug\Infer.Compiler.dll: (Related file)
    Compile complete -- 5 errors, 1 warnings
    ========== Build: 0 succeeded or up-to-date, 1 failed, 0 skipped ==========
    I understand from the forum here that somebody has succeeded in using VS2008.
    So has my problem something to do with my .NET framework version not being 4.0?
    Will much appreciate any help and comments.
    thanks
    kwew
    Monday, December 05, 2011 7:05 PM

Answers

  • Apologies for this, and thanks for bringing it to our attention. The Random method on the SharedVariable class has an optional parameter; and optional parameters are only supported for VS2010. You can easily get around this by explicitly adding the second parameter (make it 'true' in all cases). So for example:

    SharedVariable<double> scoreMean = SharedVariable<double>.Random(priorScoreMean, true).Named("scoreMean");

    John

    Thursday, December 08, 2011 3:22 PM