Question
· Jan 24, 2018

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?

Discussion (9)2
Log in or sign up to continue

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.

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.