Using the Caché Entity Framework Provider

I am trying to use Entity Framework with Visual Studio 2017. After following the Intersystems documentation ("Using the Caché Entity Framework Provider") I still cannot see the data source in Server Explorer.  Any ideas why?

  • + 1
  • 1
  • 552
  • 7
  • 2

Answers

Hello Edmund,

Which Caché version are you using?  I believe that some earlier versions were incomplete.  In particular, when you unzip/extract CacheEF.zip from folder <installdir>\dev\dotnet\bin\v4.0.30319
do you get 16 items as I do for Caché 2017.1.1.111?

Are Caché and Visual Studio on the same PC?

The instructions call for running setup with a one-time arg -installflags SetupVS.  ***Have other users of EF been able to run these?

What version of Visual Studio?  I have 2015 (14.0), and I found VsDevCmd.bat in C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools.  But instead opened an admin cmd prompt to the indicated directory, and did:  C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE>.\devenv.com /setup
This seemed to take a minute or so.  I don't know if this is what finished the setup, but Visual Studio does now offer the Caché Server option.


On my Win10 64-bit...
Local Caché installations are registered here:
HKEY_CURRENT_USER\SOFTWARE\InterSystems\Cache\Configurations
HKEY_USERS\S-1-5-21-112145844-1872675854-1690816760-2965\SOFTWARE\InterSystems\Cache\Configurations

and servers here:
HKEY_CURRENT_USER\SOFTWARE\InterSystems\Cache\Servers
HKEY_USERS\S-1-5-21-112145844-1872675854-1690816760-2965\SOFTWARE\InterSystems\Cache\Servers


ODBC Drivers here:
HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBCINST.INI
ODBC DSNs here:
HKEY_LOCAL_MACHINE\SOFTWARE\ODBC\ODBC.INI
HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\ODBC\ODBC.INI


VS2013 data providers here:
HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\VisualStudio\12.0\DataProviders
HKEY_CURRENT_USER\SOFTWARE\Microsoft\VisualStudio\12.0_Config\DataProviders
HKEY_USERS\S-1-5-21-112145844-1872675854-1690816760-2965\SOFTWARE\Microsoft\VisualStudio\12.0_Config\DataProviders

VS2015 data providers here:
HKEY_CURRENT_USER\SOFTWARE\Microsoft\VisualStudio\14.0_Config\DataProviders
HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\VisualStudio\14.0\DataProviders
HKEY_USERS\S-1-5-21-112145844-1872675854-1690816760-2965\SOFTWARE\Microsoft\VisualStudio\14.0_Config\DataProviders


Do you have similar registry entries?

And, since these are registry changes, you likely need to restart Visual Studio, and perhaps Caché or Windows.
 

Thanks for the information. I still have not got it to work but I believe the issue is because I am using Visual Studio 2017. If I understand correctly, this version does not use the registry. It may be that the Intersystems setup is not compatible with that version. I would have to try the setup with Visual Studio 2015, but my use is for a secondary tool in which I would prefer to try out Entity Framework with Cache. So I may not test it too soon.

Full EF VSTools support for VS2017 will be released with IRIS 2019.1 .  

Two questions, maybe three...

  1. When is IRIS 2019.1 coming out?   I can't find anything online about it.
  2. How can we solve this EF issue today?  We know it's possible, because there's files and instructions, etc.  But the instructions don't work.  Is it then not possible today?  (A "yes" here is acceptable and will save me a ton of wasted time!)

Microsoft changed install and registry location for vs2017 and original ISC EF installer will not be able to install VSTools to vs2017.   You can use Code First, but if you need VSTools try VS2015 or wait for IRIS 2019.1.  I do not know when it will be released, should be soon.

Comments

Hello, we also have the problem that the Data source is not present in the Data Source Wizard in VS2017 !

I am running Visual Studio 2017 as well.  I can't find .Net Framework Data Provider for Cache in the list of Data Source Providers.

Has there been a solution to this issue?  Thanks.

Not sure if you have reviewed this - but I have had to add the provider factory to the machine.config file manually before being able to see the provider in Visual Studio.  It seems this is missed in some of the files.

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Config\machine.config

C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config\machine.config

    <system.data>
        <DbProviderFactories>
          <add name="InterSystems Data Provider" invariant="InterSystems.Data.CacheClient" description="InterSystem .Net Data Provider" type="InterSystems.Data.CacheClient.CacheFactory, Intersystems.Data.CacheClient, Version=2.0.0.2, Culture=neutral, PublicKeyToken=ad350a26c4a4447c" />
    </DbProviderFactories>
    </system.data>
 

I normally find this in the .NET 2 machine config - and copy it into the other versions as needed.

Hi, folks - 

I have these machine.config settings as you describe, but still doesn't show up in Visual Studio 2017.

I am working with Cache for Windows (x86-64) 2017.2.1

But I might not have the latest CacheEF.zip.  Where would I find that?