I have a F# fake script which works with Nuge.Core to extract package files. If I try to do this with c# console app everything works properly. However if I execute exactly the same script in a f# fake script it is not working. There are so many dependencies here and I have no idea where to look for a help: docker.dotnet, fake, f#, nuget.core
To reproduce this you need to download Docker.DotNet.2.124.3.nupkg
For the c# sample you need console application and to install nuget.core nuget package. This is working!
class Program
{
static void Main()
{
var zip = new NuGet.ZipPackage(#"Docker.DotNet.2.124.3.nupkg");
foreach (var file in zip.GetFiles())
{
System.Console.WriteLine(file.Path);
}
}
}
For the f# sample you need these two files side by side:
https://gist.github.com/mynkow/e6f0e550fcacc268dd1e9b743e17d344
ERROR:
==============================================================================
FsiEvaluationException:
Error: System.InvalidOperationException: 'NETStandard.Library' already has a dependency defined for 'Microsoft.NETCore.Platforms'.
at NuGet.Manifest.ValidateDependencySets(IPackageMetadata metadata)
at NuGet.Manifest.Validate(Manifest manifest)
at NuGet.Manifest.ReadFrom(Stream stream, IPropertyProvider propertyProvider, Boolean validateSchema)
at NuGet.LocalPackage.ReadManifest(Stream manifestStream)
at NuGet.ZipPackage.EnsureManifest(Func`1 manifestStreamFactory)
at NuGet.ZipPackage..ctor(String filePath, Boolean enableCaching)
at <StartupCode$FSI_0005>.$FSI_0005_Test$fsx.main#() in C:\Users\mynkow\Desktop\Reproduce\test.fsx:line 12
Stopped due to error
Output: [Loading C:\Users\mynkow\Desktop\Reproduce\test.fsx]
==============================================================================
Input: C:\Users\mynkow\Desktop\Reproduce\test.fsx
\Arguments:
C:\fsi.exe
Exception: Yaaf.FSharp.Scripting.FsiEvaluationException: Error while compiling or executing fsharp snippet. ---> System.Exception: Operation failed. The error text has been print the error stream. To return the corresponding FSharpErrorInfo use the EvalInteractionNonThrowing, EvalScriptNonThrowing or EvalExpressionNonThrowing
at Microsoft.FSharp.Compiler.Interactive.Shell.FsiEvaluationSession.commitResult[a,b](FSharpChoice`2 res)
at Microsoft.FSharp.Compiler.Interactive.Shell.FsiEvaluationSession.EvalScript(String filePath)
at Yaaf.FSharp.Scripting.Helper.evalScript#1303.Invoke(String arg00) in C:\code\FAKE\paket-files\matthid\Yaaf.FSharp.Scripting\src\source\Yaaf.FSharp.Scripting\YaafFSharpScripting.fs:line 1303
at Yaaf.FSharp.Scripting.Helper.save_#1276-2.Invoke(Unit unitVar0) in C:\code\FAKE\paket-files\matthid\Yaaf.FSharp.Scripting\src\source\Yaaf.FSharp.Scripting\YaafFSharpScripting.fs:line 1277
at Yaaf.FSharp.Scripting.Helper.consoleCapture[a](TextWriter out, TextWriter err, FSharpFunc`2 f) in C:\code\FAKE\paket-files\matthid\Yaaf.FSharp.Scripting\src\source\Yaaf.FSharp.Scripting\YaafFSharpScripting.fs:line 1221
at Yaaf.FSharp.Scripting.Helper.redirectOut#1247[a](Boolean preventStdOut, OutStreamHelper out, OutStreamHelper err, FSharpFunc`2 f) in C:\code\FAKE\paket-files\matthid\Yaaf.FSharp.Scripting\src\source\Yaaf.FSharp.Scripting\YaafFSharpScripting.fs:line 1254
at Yaaf.FSharp.Scripting.Helper.save_#1275-1.Invoke(String text) in C:\code\FAKE\paket-files\matthid\Yaaf.FSharp.Scripting\src\source\Yaaf.FSharp.Scripting\YaafFSharpScripting.fs:line 1276
--- End of inner exception stack trace ---
at Yaaf.FSharp.Scripting.Helper.save_#1275-1.Invoke(String text) in C:\code\FAKE\paket-files\matthid\Yaaf.FSharp.Scripting\src\source\Yaaf.FSharp.Scripting\YaafFSharpScripting.fs:line 1284
at Yaaf.FSharp.Scripting.Helper.session#1306.Yaaf-FSharp-Scripting-IFsiSession-EvalScriptWithOutput(String ) in C:\code\FAKE\paket-files\matthid\Yaaf.FSharp.Scripting\src\source\Yaaf.FSharp.Scripting\YaafFSharpScripting.fs:line 1308
at Fake.FSIHelper.runScriptUncached(Boolean useCache, String scriptPath, IEnumerable`1 fsiOptions, Boolean printDetails, CacheInfo cacheInfo, TextWriter out, TextWriter err) in C:\code\FAKE\src\app\FakeLib\FSIHelper.fs:line 471
System.InvalidOperationException: 'NETStandard.Library' already has a dependency defined for 'Microsoft.NETCore.Platforms'.
at NuGet.Manifest.ValidateDependencySets(IPackageMetadata metadata)
at NuGet.Manifest.Validate(Manifest manifest)
at NuGet.Manifest.ReadFrom(Stream stream, IPropertyProvider propertyProvider, Boolean validateSchema)
at NuGet.LocalPackage.ReadManifest(Stream manifestStream)
at NuGet.ZipPackage.EnsureManifest(Func`1 manifestStreamFactory)
at NuGet.ZipPackage..ctor(String filePath, Boolean enableCaching)
at <StartupCode$FSI_0005>.$FSI_0005_Test$fsx.main#() in C:\Users\mynkow\Desktop\Reproduce\test.fsx:line 12
Stopped due to error
I have tried with the 5 latest versions of all possible dependencies and the results are exactly the same => c# is working, f# is not. Do you have any clue or just anything which you can advise me to try to fix this?
DIRTY SOLUTION:
This is how the Docker.DotNet.2.124.3.nupkg looks like inside
If I remove for example the netstandard1.6 everything works. This means that the problem is in nuget.core, right? But why it is working in c# console app? No idea!
UPDATE: I am able to execute properly the code from F# console application
I've downloaded the packages with paket, and changed the script this way:
#r #"./packages/FAKE/tools/FakeLib.dll"
#r #"./packages/NuGet.Core/lib/net40-Client/NuGet.Core.dll"
open System
open System.Collections.Generic
open System.IO
open Fake
Target "Test" (fun _ ->
printfn "=============================================================================="
global.NuGet.ZipPackage(#"Docker.DotNet.2.124.3.nupkg").GetFiles() |> Seq.iter(fun x -> printfn "%s" x.Path )
)
RunParameterTargetOrDefault "target" "test"
It gives this
Microsoft (R) F# Interactive version 14.0.23413.0
Copyright (c) Microsoft Corporation. All Rights Reserved.
For help type #help;;
>
--> Referenced 'C:\tmp\visualfsharp.issue.nuget\./packages/FAKE/tools/FakeLib.dll'
--> Referenced 'C:\tmp\visualfsharp.issue.nuget\./packages/NuGet.Core/lib/net40-Client/NuGet.Core.dll'
Building project with version: LocalBuild
Shortened DependencyGraph for Target Test:
<== Test
The resulting target order is:
- Test
Starting Target: Test
==============================================================================
Running build failed.
Error:
System.InvalidOperationException: The schema version of 'Docker.DotNet' is incompatible with version 1.6.30117.9648 of NuGet. Please upgrade NuGet to the latest version from http://go.microsoft.com/fwlink/?LinkId=213942.
at NuGet.Manifest.CheckSchemaVersion(XDocument document)
at NuGet.Manifest.ValidateManifestSchema(XDocument document, String schemaNamespace)
at NuGet.Manifest.ReadFrom(Stream stream, IPropertyProvider propertyProvider)
at NuGet.ZipPackage.EnsureManifest()
at FSI_0002.clo#9.Invoke(Unit _arg1) in C:\tmp\visualfsharp.issue.nuget\test.fsx:line 11
at Fake.TargetHelper.runSingleTarget(TargetTemplate`1 target) in C:\code\FAKE\src\app\FakeLib\TargetHelper.fs:line 493
---------------------------------------------------------------------
Build Time Report
No target was successfully completed
---------------------------------------------------------------------
---------------------------------------------------------------------
val it : unit = ()
>
The version of NuGet.Core is 2.12, and I'm seeing it is referencing Microsoft.Web.Xdt which is not loaded.
Maybe you can achieve what you want by simply using paket and adding Docker.DotNet as a dependency, it will extract it for you.
If you have reproducible error that you described, please make a zip and post an issue to visualfsharp repository.
Related
I'm back to C++ after a 31-year absence and have spent the last few months learning everything I can about Windows app development, UWP, C++/WinRT, DirectX, WinUI 3, XAML, etc. All within Visual Studio 2022 Community.
I'm currently working on creating an app template that brings together DirectX and WinUI 3, allowing me to draw on a surface within XAML/UI3. So far I've been able to create separate apps with each component (modifying existing Microsoft templates), but I'm struggling a bit bringing them all together.
The closest example I've found (using C++/WinRT) is the "DirectX and XAML interop" tutorial. I copied the example into my WinUI 3 project and it compiles no errors and the UI runs fine until I click on the button that invokes the tutorial code. Then it crashes trying to create a winrt::com_ptr to the SurfaceImageSource. I've spent a couple of days now trying to figure out why. The code in question is :
(C++/WinRT)
SurfaceImageSource surfaceImageSource( 500, 500 ) ;
winrt :: com_ptr <::ISurfaceImageSourceNativeWithD2D> sisNativeWithD2D {
surfaceImageSource.as <::ISurfaceImageSourceNativeWithD2D> () } ;
If I replace "surfaceImageSource.as" with "surfaceImageSource.try_as" the call returns, but .get() on the com_ptr returns nullptr. So it looks like internally, QueryInterface is not succeeding.
Any help with this would be greatly appreciated since I don't know where to go from here.
Thanks.
*** EDIT *** : additional information added per IInspectable's comment
Thanks IInspectable for your help. I can reproduce this with the following minimal setup :
1 - Create a new project from "Blank App, Packaged (WinUI 3 in Desktop)" C++/WinRT template. This project creates a blank window with a UI3 "Click Me" button in its center.
2 - In the file "MainWindow.xaml.cpp" :
a - at the top, add :
#include <windows.ui.xaml.media.dxinterop.h>
#include <winrt/Microsoft.UI.Xaml.Media.Imaging.h>
using namespace winrt::Microsoft::UI::Xaml::Media::Imaging;
b - further down, in the method "MainWindow::myButton_Click()" add the two lines mentioned earlier :
SurfaceImageSource surfaceImageSource(500, 500);
winrt::com_ptr <::ISurfaceImageSourceNativeWithD2D> sisNativeWithD2D{
surfaceImageSource.as <::ISurfaceImageSourceNativeWithD2D>() };
3 - that's it. Rebuild and the program crashes on the button click.
I put a breakpoint between the two lines above.
I then put another breakpoint in "Generated Files\winrt\base.h" on first line of "struct IUnknown :: as()":
template <typename To>
auto as() const
{ (breakpoint here)
return impl::as<To>(m_ptr);
}
When I continue execution, the program crashes immediately before returning to the next line of myButton_Click() (as far as I can determine).
Debug Output
'My_WinUI_3_project_4.exe' (Win32): Loaded 'C:\Program Files\WindowsApps\Microsoft.WindowsAppRuntime.1.1_1004.584.2120.0_x64__8wekyb3d8bbwe\Microsoft.DirectManipulation.dll'.
onecoreuap\windows\frameworkudk\dxprivatescommon.cpp(53)\Microsoft.Internal.FrameworkUdk.dll!00007FFFABE09BC5: (caller: 00007FFFABE5ED0D) ReturnHr(1) tid(2508) 80004002 This interface is not supported
onecoreuap\windows\frameworkudk\dxprivatescommon.cpp(53)\Microsoft.Internal.FrameworkUdk.dll!00007FFFABE09BC5: (caller: 00007FFFABE5ED0D) ReturnHr(2) tid(2508) 80004002 This interface is not supported
onecoreuap\windows\frameworkudk\dxprivatescommon.cpp(53)\Microsoft.Internal.FrameworkUdk.dll!00007FFFABE09BC5: (caller: 00007FFFABE5ED0D) ReturnHr(3) tid(3670) 80004002 This interface is not supported
'My_WinUI_3_project_4.exe' (Win32): Loaded 'C:\Windows\System32\cabinet.dll'.
'My_WinUI_3_project_4.exe' (Win32): Loaded 'C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\XamlDiagnostics\x64\WinUI3\Microsoft.VisualStudio.DesignTools.WinUITap.dll'.
Microsoft.UI.Xaml.dll!00007FFF8DAF3D45: (caller: 00007FFF90651CAF) ReturnHr(1) tid(2508) 80070057 Incorrect parameter.
Microsoft.UI.Xaml.dll!00007FFF8DAF3D45: (caller: 00007FFF90651CAF) ReturnHr(2) tid(2508) 80070057 Incorrect parameter.
Microsoft.UI.Xaml.dll!00007FFF8DAF3D45: (caller: 00007FFF90651CAF) ReturnHr(3) tid(2508) 80070057 Incorrect parameter.
Exception thrown at 0x00007FF83C644FD9 (KernelBase.dll) in My_WinUI_3_project_4.exe: WinRT originate error - 0x80004002 : 'This interface is not supported'.
Exception thrown at 0x00007FF83C644FD9 in My_WinUI_3_project_4.exe: Microsoft C++ exception: winrt::hresult_no_interface at memory location 0x0000005C234FA538.
Exception thrown at 0x00007FF83C644FD9 in My_WinUI_3_project_4.exe: Microsoft C++ exception: [rethrow] at memory location 0x0000000000000000.
A breakpoint instruction (__debugbreak() statement or a similar call) was executed in My_WinUI_3_project_4.exe.
Call Stack
My_WinUI_3_project_4.exe!winrt::My_WinUI_3_project_4::implementation::App::{ctor}::__l2::<lambda>(const winrt::Windows::Foundation::IInspectable & __formal, const winrt::Microsoft::UI::Xaml::UnhandledExceptionEventArgs & e) Line 31 C++
My_WinUI_3_project_4.exe!winrt::impl::delegate<winrt::Microsoft::UI::Xaml::UnhandledExceptionEventHandler,void <lambda>(const winrt::Windows::Foundation::IInspectable &, const winrt::Microsoft::UI::Xaml::UnhandledExceptionEventArgs &)>::Invoke(void * sender, void * e) Line 4824 C++
[External Code]
My_WinUI_3_project_4.exe!winrt::impl::consume_Microsoft_UI_Xaml_IApplicationStatics<winrt::Microsoft::UI::Xaml::IApplicationStatics>::Start(const winrt::Microsoft::UI::Xaml::ApplicationInitializationCallback & callback) Line 157 C++
My_WinUI_3_project_4.exe!winrt::Microsoft::UI::Xaml::Application::Start::__l2::<lambda>(const winrt::Microsoft::UI::Xaml::IApplicationStatics & f) Line 12146 C++
My_WinUI_3_project_4.exe!winrt::impl::factory_cache_entry<winrt::Microsoft::UI::Xaml::Application,winrt::Microsoft::UI::Xaml::IApplicationStatics>::call<void <lambda>(const winrt::Microsoft::UI::Xaml::IApplicationStatics &) &>(winrt::Microsoft::UI::Xaml::Application::Start::__l2::void <lambda>(const winrt::Microsoft::UI::Xaml::IApplicationStatics &) & callback) Line 6286 C++
My_WinUI_3_project_4.exe!winrt::impl::call_factory<winrt::Microsoft::UI::Xaml::Application,winrt::Microsoft::UI::Xaml::IApplicationStatics,void <lambda>(const winrt::Microsoft::UI::Xaml::IApplicationStatics &)>(winrt::Microsoft::UI::Xaml::Application::Start::__l2::void <lambda>(const winrt::Microsoft::UI::Xaml::IApplicationStatics &) && callback) Line 6309 C++
My_WinUI_3_project_4.exe!winrt::Microsoft::UI::Xaml::Application::Start(const winrt::Microsoft::UI::Xaml::ApplicationInitializationCallback & callback) Line 12147 C++
[External Code]
This:
#include <windows.ui.xaml.media.dxinterop.h>
should be this:
#include <microsoft.ui.xaml.media.dxinterop.h>
when working with WinUI 3.0 Desktop apps and not UWP.
Every time I try to do anything with Code Analysis, Visual Studio crashes. The event viewer shows the crash is caused by an invalid window-splitter size.
Stacktrace:
Application: devenv.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.ArgumentOutOfRangeException
at System.Windows.Forms.SplitContainer.set_SplitterDistance(Int32)
at Microsoft.VisualStudio.CodeAnalysis.AdvancedRuleSetEdit.LoadHelpPaneSizeString(System.String)
at Microsoft.VisualStudio.CodeAnalysis.AdvancedRuleSetEdit.LoadHelpPaneSettings()
at Microsoft.VisualStudio.CodeAnalysis.AdvancedRuleSetEdit.SplitterResized(System.Object, System.EventArgs)
at System.Windows.Forms.Control.OnResize(System.EventArgs)
at System.Windows.Forms.Control.OnSizeChanged(System.EventArgs)
at System.Windows.Forms.Control.UpdateBounds(Int32, Int32, Int32, Int32, Int32, Int32)
at System.Windows.Forms.Control.UpdateBounds()
at System.Windows.Forms.Control.WmWindowPosChanged(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.Control.WndProc(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.ScrollableControl.WndProc(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.ContainerControl.WndProc(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.SplitContainer.WndProc(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.Control+ControlNativeWindow.OnMessage(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.Control+ControlNativeWindow.WndProc(System.Windows.Forms.Message ByRef)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr, Int32, IntPtr, IntPtr)
Procmon shows this value is stored in the private registry bin file.
Deleting the window settings for Code Analysis fixes the cause of the crash. You may need to do this every time you close Visual Studio.
Export from the private registry bin:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\vs2019\Software\Microsoft\VisualStudio\16.0_ad070b97\CodeAnalysis]
"RuleSetMRUList"=""
"RuleSelectionControl_Settings"="True,True,True,7,2,0,True,0;True;0.385#1;False;0.160#2;True;0.429#3;False;0.160#4;False;0.100#5;True;0.186#6;False;0.150#7;False;0.150#"
"RuleSetEditorHelpPaneSize"="573,573"
If you are running into this, to resolve:
// put your instance id in the next line instead of ad070b97
cd C:\Users\Administrator\AppData\Local\Microsoft\VisualStudio\16.0_ad070b97
reg load HKLM\vs2019 privateregistry.bin
reg delete HKLM\vs2019\Software\Microsoft\VisualStudio\16.0_ad070b97\CodeAnalysis /v RuleSetEditorHelpPaneSize
reg unload HKLM\vs2019
Fixed in latest VS 2019 versions
This is caused by the scaling options for your display. (the part that makes text and icons larger.)
Reset your scaling to 100% and it will show the window. There are other control in vs that cause issues as well, but this one crashes it. If it's larger then 100, various parts of vs 2017 don't work. This crashes it, forms designer complains, and an error message shows up in the Solutions properties page. (not project properties)
Seems Microsoft never got around to testing or fixing this.
Test it to confirm.
New F# Program
Add nuget package FSharp.Data
Attempt to run this code
open FSharp.Data
let doc = #"<!DOCTYPE html><html><body><p>FSharp!</p></body></html>" |> Encoding.UTF8.GetBytes |> MemoryStream |> HtmlDocument.Load
CssSelectorExtensions.CssSelect (doc, "p") |> LINQPad.Extensions.Dump
The execution of the CssSelect function throws the error
Method not found: 'Microsoft.FSharp.Collections.FSharpList`1<FSharp.Data.HtmlNode> CssSelectorExtensions.CssSelect(FSharp.Data.HtmlDocument, System.String)'.
Same error in both LinqPad 5 and 6.
Code runs fine in VS 2019 (without the Dump function obviously)
Can anyone repo ? Why the error in LinqPad ?
Adding FSharp.Core from nuget to the query got rid of the error
I want to automate the build process of my project using FAKE which requires me to run a grunt task.
In particular, I want to create a target that runs the grunt build task in a subfolder of the solution folder. Due to my lack of F# knowledge, I was not able to pass multiple parameters to the static Exec method of the Shell class. https://fsharp.github.io/FAKE/apidocs/fake-processhelper-shell.html
This is what I have got so far:
Target "RunGrunt" (fun _ ->
let errorCode = Shell.Exec "grunt" "build" "\Frontend"
()
)
This fails with the following error message:
build.fsx(38,23): error FS0003: This value is not a function and cannot be applied
If I remove the last 2 parameters, it works, but fails to find grunt at runtime:
System.ComponentModel.Win32Exception (0x80004005): The system cannot find the file specified
at System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
at System.Diagnostics.Process.Start()
at Fake.ProcessHelper.start(Process proc) in C:\code\fake\src\app\FakeLib\ProcessHelper.fs:line 22
at Fake.ProcessHelper.asyncShellExec#424-2.Invoke(Process _arg1) in C:\code\fake\src\app\FakeLib\ProcessHelper.fs:line 428
at Microsoft.FSharp.Control.AsyncBuilderImpl.callA#851.Invoke(AsyncParams`1 args)
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.FSharp.Control.AsyncBuilderImpl.commit[a](Result`1 res)
at Microsoft.FSharp.Control.CancellationTokenOps.RunSynchronously[a](CancellationToken token, FSharpAsync`1 computation, FSharpOption`1 timeout)
at Microsoft.FSharp.Control.FSharpAsync.RunSynchronously[T](FSharpAsync`1 computation, FSharpOption`1 timeout, FSharpOption`1 cancellationToken)
at FSI_0001.Build.clo#34-6.Invoke(Unit _arg5) in D:\Development\Repos\FMVEAv2\Fmvea2-frontend\build.fsx:line 36
at Fake.TargetHelper.runSingleTarget(TargetTemplate`1 target) in C:\code\fake\src\app\FakeLib\TargetHelper.fs:line 483
Grunt is included in the path variable. (it works if called from the command line)
My questions are:
How can I pass multiple parameters to the Shell.Exec method?
How to run grunt, without including the complete path to it?
Both problems are now solved.
John pointed out in a comment to use tuple style instead of curried form which results in the following code:
Shell.Exec( "grunt","build","\FrontEnd")
FAKE provides a method to find a file on the path. http://fsharp.github.io/FAKE/apidocs/fake-processhelper.html
The target definition therefore looks like this:
Target "RunGrunt" (fun _ ->
let grunt = tryFindFileOnPath if isUnix then "grunt" else "grunt.cmd"
let errorCode = match grunt with
| Some g -> Shell.Exec(g, "build", "FrontEnd")
| None -> -1
()
)
neftedollar made a good point in the comments about cross platform compatiblity: Using the EnvironmentHelper to determine the platform and search for the correct executable of grunt.
I am using the R Type Provider like so in the REPL
#r "../packages/FSharp.Data.2.2.0/lib/net40/FSharp.Data.dll"
open FSharp.Data
[<Literal>]
let uri = "https://reddoggabtest-secondary.table.core.windows.net/TestTelemetryData0?tn=TestTelemetryData0&sv=2014-02-14&si=GabLab&sig=GGc%2BHEa9wJYDoOGNE3BhaAeduVOA4MH8Pgss5kWEIW4%3D"
type CarTelemetry = XmlProvider<uri>
let carTelemetry = CarTelemetry.Load(uri)
#r "C:/Program Files (x86)/Reference Assemblies/Microsoft/Framework/.NETFramework/v4.5.1/System.Xml.Linq.dll"
open System.Xml.Linq
carTelemetry.Entries |> Seq.iter(fun e -> printfn "%A" e.Title)
#I "../packages/RProvider.1.1.8/lib"
#r "../packages/R.NET.1.5.5/lib/net40/RDotNet.dll"
#r "../packages/R.NET.1.5.5/lib/net40/RDotNet.NativeLibrary.dll"
#r "../packages/R.NET.Community.FSharp.0.1.9/lib/net40/RDotNet.FSharp.dll"
#r "../packages/RProvider.1.1.8/lib/net40/RProvider.dll"
#r "../packages/RProvider.1.1.8/lib/net40/RProvider.Runtime.dll"
open System
open System.Net
open RDotNet
open RProvider
open RProvider.graphics
open RProvider.stats
carTelemetry.Entries |> Seq.map(fun e -> e.Content.Properties.Acceleration.Value)
|> R.log
|> R.diff
When I execute it, I am getting this exception
System.MissingMethodException: Method not found: 'RDotNet.REngine RDotNet.REngine.GetInstance(System.String, Boolean, RDotNet.StartupParameter, RDotNet.Devices.ICharacterDevice)'.
at RProvider.Internal.RInit.engine#114.Invoke()
at System.Lazy`1.CreateValue()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Lazy`1.get_Value()
at RProvider.RInteropInternal.toR(Object value) in c:\Tomas\Public\FSharp.RProvider\src\RProvider\RInterop.fs:line 287
at RProvider.RInterop.passArg#447(List`1 tempSymbols, Object arg) in c:\Tomas\Public\FSharp.RProvider\src\RProvider\RInterop.fs:line 461
at RProvider.RInterop.argList#468-1.GenerateNext(IEnumerable`1& next) in c:\Tomas\Public\FSharp.RProvider\src\RProvider\RInterop.fs:line 475
at Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1.MoveNextImpl()
at Microsoft.FSharp.Core.CompilerServices.GeneratedSequenceBase`1.System-Collections-IEnumerator-MoveNext()
at Microsoft.FSharp.Collections.SeqModule.ToArray[T](IEnumerable`1 source)
at RProvider.RInterop.callFunc(String packageName, String funcName, IEnumerable`1 argsByName, Object[] varArgs) in c:\Tomas\Public\FSharp.RProvider\src\RProvider\RInterop.fs:line 466
at <StartupCode$FSI_0012>.$FSI_0012.main#()
Stopped due to error
Any ideas? Thanks.
This looks like some version mismatch - what version(s) of R.NET do you have installed in the packages folder?
The correct ones (as required by the latest R provider NuGet package) are:
R.NET.Community (= 1.5.16)
R.NET.Community.FSharp (= 0.1.9)
Note that there is (confusingly) also older R.NET package (without the "Community" bit) and having that in packages can probably confuse the R provider.
BTW: You can also try using the FsLab templates instead, which makes the process of installing & loading everything a lot simpler - reduces all to just a single #load :-)