I am trying to create an F # project with dotnet cores with FSharp.Data (standard type library) depending on linux.
I created a project using the dotnet new -l F# and added FSharp.Data as a dependency.
{ "version": "1.0.0-*", "buildOptions": { "emitEntryPoint": true, "compilerName": "fsc", "compile": { "includeFiles": [ "Program.fs" ] } }, "dependencies": { "Microsoft.FSharp.Core.netcore": "1.0.0-alpha-160316", "FSharp.Data": {"version": "2.3.1"}, "Microsoft.NETCore.App": { "type": "platform", "version": "1.0.0-rc2-3002702" } }, "tools": { "dotnet-compile-fsc": { "version": "1.0.0-*", "imports": [ "dnxcore50", "portable-net45+win81", "netstandard1.3" ] } }, "frameworks": { "netstandard1.5": { "imports": [ "portable-net45+win8", "dnxcore50" ] } } }
However, when I try to build a project (by doing dotnet restore , followed by dotnet build ), I get an error message that, it seems to me, can be minimized to Could not load file or assembly 'FSharp.Data.DesignTime....
Project fsharp2 (.NETStandard,Version=v1.5) will be compiled because inputs were modified Compiling fsharp2 for .NETStandard,Version=v1.5 /home/michel/dotnet/dotnet compile-fsc @/home/michel/Documents/DOTNET/fsharp2/obj/Debug/netstandard1.5/dotnet-compile.rsp returned Exit Code 1 /home/michel/Documents/DOTNET/fsharp2/error FS3031: The type provider '/home/michel/.nuget/packages/FSharp.Data/2.3.1/lib/portable-net45+netcore45/FSharp.Data.dll' reported an error: Assembly attribute 'TypeProviderAssemblyAttribute' refers to a designer assembly 'FSharp.Data.DesignTime' which cannot be loaded or doesn't exist. Could not load file or assembly 'FSharp.Data.DesignTime, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified. /home/michel/Documents/DOTNET/fsharp2/warning FS3005: Referenced assembly '/home/michel/.nuget/packages/FSharp.Data/2.3.1/lib/portable-net45+netcore45/FSharp.Data.dll' has assembly level attribute 'Microsoft.FSharp.Core.CompilerServices.TypeProviderAssemblyAttribute' but no public type provider classes were found Compilation failed. 1 Warning(s) 1 Error(s) Time elapsed 00:00:05.0221430
I checked that the FSharp.Data.DesignTime.dll file FSharp.Data.DesignTime.dll in the .nuget/packages/FSharp.Data/2.3.1/lib/portable-net45+netcore45/ . dotnet-core also works great for a simple world-wide welcome program without adding additional dependencies.
How can I successfully add the FSharp.Data file as dependencies in my project with the dotnet core?
linux f # .net-core
Michelrandahl
source share