(不可修复)SQL Server 2014上存在程序集,但声称它没有此程序集 [英] (Unfixable) Assembly exists on SQL Server 2014 but it claims it doesn't have it

查看:67
本文介绍了(不可修复)SQL Server 2014上存在程序集,但声称它没有此程序集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

更新:此问题无法修复: https://connect.microsoft.com/SQLServer/Feedback/Details/809697

Update: this problem is not fixable: https://connect.microsoft.com/SQLServer/Feedback/Details/809697

我正在尝试使用.net 4.5创建一个SQL CLR程序集,并告诉我它丢失了 system.servicemodel (即使它位于.net程序集文件夹中):

I'm attempting to create a SQL CLR assembly with .net 4.5 and it's telling me it's missing system.servicemodel (even though it's in the .net assembly folders):

Assembly 'MySQLCLRProject' references assembly 'system.servicemodel, version=4.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089.', which is not present in the current database. SQL Server attempted to locate and automatically load the referenced assembly from the same location where referring assembly came from, but that operation has failed (reason: 2(The system cannot find the file specified.)). Please load the referenced assembly into the current database and retry your request.

所以我手动将4.5、4.5.1、4.5.2 System.ServiceModel.dll 添加到项目文件夹,然后它告诉我缺少了 system.servicemodel.internals :

So I manually add a 4.5,4.5.1,4.5.2 System.ServiceModel.dll to the project folder, then it tells me it's missing system.servicemodel.internals:

Warning: The Microsoft .NET Framework assembly 'system.servicemodel, version=4.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089.' you are registering is not fully tested in the SQL Server hosted environment and is not supported. In the future, if you upgrade or service this assembly or the .NET Framework, your CLR integration routine may stop working. Please refer SQL Server Books Online for more details.
Msg 10301, Level 16, State 1, Line 13
Assembly 'MySQLCLRProject' references assembly 'system.servicemodel.internals, version=4.0.0.0, culture=neutral, publickeytoken=31bf3856ad364e35.', which is not present in the current database. SQL Server attempted to locate and automatically load the referenced assembly from the same location where referring assembly came from, but that operation has failed (reason: 2(The system cannot find the file specified.)). Please load the referenced assembly into the current database and retry your request.

所以我添加了一个4.6 System.ServiceModel.dll ,它将告诉我它缺少 system.xaml :

So I add a 4.6 System.ServiceModel.dll it will tell me it's missing system.xaml:

Warning: The Microsoft .NET Framework assembly 'system.servicemodel, version=4.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089.' you are registering is not fully tested in the SQL Server hosted environment and is not supported. In the future, if you upgrade or service this assembly or the .NET Framework, your CLR integration routine may stop working. Please refer SQL Server Books Online for more details.
Msg 10301, Level 16, State 1, Line 13
Assembly 'MySQLCLRProject' references assembly 'system.xaml, version=4.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089.', which is not present in the current database. SQL Server attempted to locate and automatically load the referenced assembly from the same location where referring assembly came from, but that operation has failed (reason: 2(The system cannot find the file specified.)). Please load the referenced assembly into the current database and retry your request.

添加system.xaml(4.5-4.6.1)后,它告诉我:

After I add system.xaml (4.5-4.6.1), it tells me this:

Warning: The Microsoft .NET Framework assembly 'system.servicemodel, version=4.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089.' you are registering is not fully tested in the SQL Server hosted environment and is not supported. In the future, if you upgrade or service this assembly or the .NET Framework, your CLR integration routine may stop working. Please refer SQL Server Books Online for more details.
Warning: The Microsoft .NET Framework assembly 'system.xaml, version=4.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089.' you are registering is not fully tested in the SQL Server hosted environment and is not supported. In the future, if you upgrade or service this assembly or the .NET Framework, your CLR integration routine may stop working. Please refer SQL Server Books Online for more details.
Msg 6218, Level 16, State 2, Line 13
CREATE ASSEMBLY for assembly 'MySQLCLRProject' failed because assembly 'System.Xaml' failed verification. Check if the referenced assemblies are up-to-date and trusted (for external_access or unsafe) to execute in the database. CLR Verifier error messages if any will follow this message
[ : System.Xaml.AttachableMemberIdentifier::ToString][mdToken=0x6000009][offset 0x00000000] Code size is zero.
[ : System.Xaml.AttachableMemberIdentifier::Equals][mdToken=0x6000006][offset 0x00000000] Code size is zero.
[ : System.Xaml.AttachableMemberIdentifier::GetHashCode][mdToken=0x6000008][offset 0x00000000] Code size is zero.
[ : System.Xaml.AttachableMemberIdentifier::Equals][mdToken=0x6000007][offset 0x00000000] Code size is zero.
[ : System.Xaml.AttachableMemberIdentifier::.ctor][mdToken=0x6000001][offset 0x00000000] Code size is zero.
[ : System.Xaml.AttachableMemberIdentifier::get_MemberName][mdToken=0x6000002][offset 0x00000000] Code size is zero.
[ : System.Xaml.AttachableMemberIdentifier::get_DeclaringType][mdToken=0x6000003][offset 0x00000000] Code size is zero.
[ : System.Xaml.AttachableMemberIdentifier::op_Inequality][mdToken=0x6000004][offset 0x00000000] Code size is zero.
[ : System.Xaml.AttachableMemberIdentifier::op_Equality][mdToken=0x6000005][offset 0x00000000] Code size is zero.
[ : System.Xaml.AttachablePropertyServices::.cctor][mdToken=0x6000010][offset 0x00000000] Code size is zero.
[ : System.Xaml.AttachablePropertyServices::TryGetProperty[T]][mdToken=0x600000f][offset 0x00000000] Code size is zero.
[ : System.Xaml.AttachablePropertyServices::GetAttachedPropertyCount][mdToken=0x600000a][offset 0x00000000] Code size is zero.
[ : System.Xaml.AttachablePropertyServices::CopyPropertiesTo][mdToken=0x600000b][offset 0x00000000] Code size is zero.
[ : System.Xaml.AttachablePropertyServices::RemoveProperty][mdToken=0x600000c][offset 0x00000000] Code size is zero.
[ : System.Xaml.AttachablePropertyServices::SetProperty][mdToken=0x600000d][offset 0x00000000] Code size is zero.
[ : System.Xaml....

我已经四处搜寻,找不到任何可解决此问题的东西.我什至完全使用.net 4.5重新创建了该项目,但仍然给我带来了问题.

I've searched all over and couldn't find anything to address this problem. I've even recreated the project entirely with .net 4.5 and it still giving me problems.

感谢您的帮助,谢谢!

推荐答案

此处的问题是,您正在尝试使用不受支持的.NET Framework库: ServiceModel .该库确实可以在SQL Server 2005、2008和2008 R2中工作.但是,由于它不在受支持"列表中,因此不能保证它可以在所有.NET Framework升级中正常工作.它曾经是纯MSIL程序集,但后来将其更改为混合模式程序集,因此无法将其加载到SQL Server中.

The issue here is that you are attempting to use an unsupported .NET Framework library: ServiceModel. This library did work in SQL Server 2005, 2008, and 2008 R2. However, since it is not in the "supported" list, it is not guaranteed to work across all .NET Framework upgrades. It used to be a pure-MSIL Assembly but then they changed it to be a mixed-mode Assembly, and those cannot be loaded into SQL Server.

此问题已在此处的堆栈溢出中记录:

This issue has been documented on Stack Overflow here:

SQL CLR-从2008 R2迁移到2012.

更多信息在这里:

这篇关于(不可修复)SQL Server 2014上存在程序集,但声称它没有此程序集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆