4

I just upgraded to SQL Server 2012 with SP1 because I could not load CLR assemblies from .net 4.0. Now I have both 2008 and 2012 running on my VM. Im trying to load the assemblies into 2012 but I still get the same unsupported version errors. when i run the following query, select * from sys.dm_clr_properties

I only see the version 2.0.50727. Prior to the upgrade, i installed .net 4.0. How do I get SQL to use .net 4.0 when loading assemblies?

Chris
  • 185
  • 1
  • 1
  • 7

1 Answers1

1

Check this key

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\OnlyUseLatestCLR

is it 0 or 1

If it is 0 - change to 1 and reboot your machine. Should help.

OR

try to simply disable and enable SQL CLR on SQL2012. Or try to disable both (SQL2008 and SQl2012) and then enable only SQl2012

sp_configure 'clr enabled', 0;
GO
RECONFIGURE;
GO

sp_configure 'clr enabled', 1;
GO
RECONFIGURE;
GO

OR

you may try to force SQL Server to load .NET 4.0 runtime by creating sqlservr.exe.config file in the Binn folder with next configuration

<configuration>
   <startup>
      <requiredRuntime version="v4.0"/>
   </startup>
</configuration>
Andrey Morozov
  • 7,839
  • 5
  • 53
  • 75