Reputation: 45325
We have a project build with F# 3.1 using Microsoft.FSharp.Data.TypeProviders. Now we are trying to build this project with VS2015 and we have the problems with this part of F#. For example, when I am trying to install it using Nuget it requires F# 3.1. I use this guide and it looks outdated.
So I will be thankful for answers on my questions:
What part of F# language Microsoft.FSharp.Data.TypeProviders belongs to? It is F# core library or it is one of external libraries? Who is responsible for this library? Where can I find the bug tracker for this part of F# ecosystem?
Is there anybody who trying to use this tutorial to build F# application in VS2015? Do you have a problems like me? Or all is working fine?
What is the current state of Microsoft.FSharp.TypeProviders? Is it outdated and all what I need is to wait some time when the library will be adopted to F# 4.0 and VS2015. Or do I need to switch to other DB-access library?
Here is full description to reproduce error:
NuGet - Install Data.TypeProviders. packages.config
:
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="FSharp.Core.3" version="0.0.2" targetFramework="net46" />
<package id="FSharp.Data.TypeProviders" version="0.0.1" targetFramework="net46" />
</packages>
To program.fs
add the lines:
module Test
open Microsoft.FSharp.Data.TypeProviders
type internal DB = SqlDataConnection<"Data Source=MyServer;Initial Catalog=MyDB;Integrated Security=SSPI;">
Here is an error message:
The .NET SDK 4.0 or 4.5 tools can not be found
Upvotes: 4
Views: 1531
Reputation: 191
I had this issue. VS 2015 project upgraded to VS 2017 / .NET 4.7.2 / F# 4.1 (F# Core 4.4.3.0)
Suddenly Microsoft.FSharp.Data only contained namespace "UnitSystems".
"WsdlService" would not compile.
Installed the following Nuget packages:
nuget "FSharp.Data.TypeProviders" and "FSharp.Compiler.Tools" (?)
and everything compiles with latest VS 2017 / .NET 4.7.2 ...
(Note: I also removed references to System.ValueTuple)
Upvotes: 0
Reputation: 8551
I just created a new project in VS 2015 targeting F# 4.0 (4.4.0.0) on .NET 4.6, added a reference to FSharp.Data.TypeProviders
using NuGet, which lead to the following packages.config
:
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="FSharp.Core.3" version="0.0.2" targetFramework="net46" />
<package id="FSharp.Data.TypeProviders" version="0.0.1" targetFramework="net46" />
</packages>
I then added a new file and entered
module Test
open Microsoft.FSharp.Data.TypeProviders
type internal DB = SqlDataConnection<"Data Source=.;Initial Catalog=OBSCURED_CATALOG;Integrated Security=SSPI;">
let private e1 = DB.GetDataContext().OBSCURED_ENTITY
Then, VS told me to reference System.Data.Linq
... everything works just as it should and the tutorial looks up-to-date as well.
Did you already try to set up a new project instead of migrating the old one?
TL;DR (see chat)
Problem is that some registry keys were missing. If your registry doesn't contain
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v8.1A]
"InstallationFolder"="C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v8.1A\\"
"ProductVersion"="8.1.51641"
"ProductName"="Microsoft .NET Framework 4.5.1 SDK"
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v8.1A\WinSDK-NetFx40Tools]
"ProductVersion"="8.1.51641"
"ComponentName"="Microsoft .NET Framework 4.5.1 SDK"
"InstallationFolder"="C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v8.1A\\bin\\NETFX 4.5.1 Tools\\"
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v8.1A\WinSDK-NetFx40Tools-x64]
"ProductVersion"="8.1.51641"
"ComponentName"="Microsoft .NET Framework 4.5.1 SDK"
"InstallationFolder"="C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v8.1A\\bin\\NETFX 4.5.1 Tools\\x64\\"
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v8.1A\WinSDK-NetFx40Tools-x86]
"ProductVersion"="8.1.51641"
"ComponentName"="Microsoft .NET Framework 4.5.1 SDK"
"InstallationFolder"="C:\\Program Files (x86)\\Microsoft SDKs\\Windows\\v8.1A\\bin\\NETFX 4.5.1 Tools\\"
it might be time to (re)install Windows SDK for Windows 8.
Upvotes: 1
Reputation: 16812
Some more historical background:
1.What part of F# language Microsoft.FSharp.Data.TypeProviders belongs to? It is F# core library or it is one of external libraries? Who is responsible for this library? Where can I find the bug tracker for this part of F# ecosystem?
It's not part of the core runtime, i.e. you can be a happy and productive F# dev without ever interacting with it. It was created by Microsoft and shipped with F# 3.0/VS 2012 as a set of in-the-box type providers for common Msft data stacks. Type providers as a language feature were added in the same release, so this library was a bit of a showcase of what could be done. FS.D.TP is not actively maintained at the moment. Original version 4.3.0.0 is still shipped in the box with VS 2013 and VS 2015, but no changes have been made since the VS 2012 release. Source is available here and you are welcome to file bugs in that repo, too.
In principle the library be taken over as a community project and maintained/updated from there as a nuget package. Nothing is really preventing this. However having the library in the box with Msft signature and support is very important to a lot of enterprise customers still. So it persists in this sort of limbo state where it's in the box but not updated.
3.What is the current state of Microsoft.FSharp.TypeProviders? Is it outdated and all what I need is to wait some time when the library will be adopted to F# 4.0 and VS2015. Or do I need to switch to other DB-access library?
Some of this is answered above. The library should still be perfectly functional with F# 3.1 or F# 4.0, provided you have all of the required dependencies. In particular, you need the .NET 4.0 or 4.5 SDK installed (you can get Win8/.NET 4.5 SDK here) because the TPs rely on various executable codegen tools (sqlmetal.exe, svutil.exe) that come along therewith.
Upvotes: 10