Need clarification regarding Microsoft.FSharp.Data.TypeProviders

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 problems with this part of F #. For example, when I try to install it using Nuget, it requires F # 3.1. I am using this guide and it looks outdated.

Therefore, I will be grateful for the answers to my questions:

  • What part of the F # language belongs to Microsoft.FSharp.Data.TypeProviders? Is it the main library F # or is it one of the external libraries? Who is responsible for this library? Where can I find an error tracker for this part of the F # ecosystem?

  • Is there anyone who is trying to use this tutorial to create an F # application in VS2015? Are you having problems like me? Or is everything working fine?

  • What is the current status of Microsoft.FSharp.TypeProviders? It is deprecated, and all I need to do is wait a while for the library to be accepted in F # 4.0 and VS2015. Or do I need to switch to another database access library?

Here is the full description for reproducing the error:

  • New project - F # - Console application (net 4.6)
  • 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 add program.fs lines:

     module Test open Microsoft.FSharp.Data.TypeProviders type internal DB = SqlDataConnection<"Data Source=MyServer;Initial Catalog=MyDB;Integrated Security=SSPI;"> 

Here is the error message:

Unable to find .NET SDK 4.0 or 4.5 tools

enter image description here

+4
source share
2 answers

A few historical background:

1. What part of the F # language belongs to Microsoft.FSharp.Data.TypeProviders? Is it the main library F # or is it one of the external libraries? Who is responsible for this library? Where can I find an error tracker for this part of the F # ecosystem?

This is not part of the main runtime, i.e. You can be happy and productive in F # dev without interacting with it. It was created by Microsoft and comes with F # 3.0 / VS 2012 as a set of in-box providers for common Msft data stacks. In one issue, type providers were added as language functions, so this library was a bit of a demonstration of what could be done. FS.D.TP is currently not actively supported. The original version 4.3.0.0 is still bundled with VS 2013 and VS 2015, but there have been no changes since the release of VS 2012. The source is available here , and you can also record errors in this repo.

In principle, the library is taken as a community project and maintained / updated from there as a nuget package. Nothing prevents this. However, the presence of the library in the field with the signature Msft and support is very important for many corporate clients. Thus, it remains in such a state of uncertainty where it is in the field, but is not updated.

3. What is the current status of Microsoft.FSharp.TypeProviders? It is deprecated, and all I need to do is wait a while for the library to be accepted in F # 4.0 and VS2015. Or do I need to switch to another database access library?

Some of these answers are given above. The library should be fully functional with F # 3.1 or F # 4.0, if you have all the necessary dependencies. In particular, you need the installed .NET 4.0 or 4.5 SDK (you can get the Win8 / .NET 4.5 SDK here ) because TPs rely on various executable software tools (sqlmetal.exe, svutil.exe) that come with it.

+10
source

I just created a new project in VS 2015 targeting F # 4.0 (4.4.0.0) on .NET 4.6, added a link to FSharp.Data.TypeProviders using NuGet, which leads 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> 

Then I 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 as it should, and the tutorial also looks relevant.

Have you tried to create a new project instead of transferring the old one?

TL DR (see chat )

The problem is that some registry keys were missing. If your registry does not 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\\" 

you may need to (re) install the Windows SDK for Windows 8.

+1
source

All Articles