Celtic Coding Solutions Blog

Celtic Coding Solutions Blog - for everything computer related

Entity Framework determine storage version SQL Server 2016

Using latest Entity Framework 6.1.3 with Visual Studio 2015 and connecting to SQL Server 2016 developer edition, I had the following error:-

Could not determine storage version; a valid storage connection or a version hint is required.

Fix:-

In Visual Studio Solution Explorer.

Right Click over the Entity Framework .edmx

Open with and select XML Text Editor

Search for "ProviderManifestToken=" and either you will have XXXX or in my case I had 2012 in this value.  So I changed it to 2008 and now my code works.

Excel Automation as a Scheduled task on Windows Server 2012 R2

Migrating some Excel Automated code using C# off an old Windows 2003 Server onto Windows Server 2012 R2 and using Scheduled Tasks to run I notice it was failing.  User linked to the Scheduled Task has correct permissions and it is being run with highest privileges.  Excel installed and I can run the code manually fine as that user.  Plenty of threads about the issue but the only thing that worked was:-

FIX

Windows 2008 +

Add 2 directories:-

%windir%\System32\config\systemprofile\Desktop

and

%windir%\sysWOW64\config\systemprofile\Desktop

Windows 2012 r2

Add 2 extra directories:-

%windir%\SysWOW64\config\systemprofile\Documents

and

%windir%\SysWOW64\config\systemprofile\AppData\Local\Microsoft\Windows\INetCache