简体   繁体   中英

SQL server 2012 wont load CLR 4.0 assembles

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?

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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM