大网数据广告活动
数据库与应用安全

Policy for untested .NET Framework assemblies

· 52CE 我爱测

This article describes the support policy for untested Microsoft .NET Framework assemblies in the .NET Framework common language runtime (CLR)-hosted environment in SQL Server.

This article describes the support policy for untested Microsoft .NET Framework assemblies in the .NET Framework common language runtime (CLR)-hosted environment in SQL Server.

Original product version:   SQL Server
Original KB number:   922672

Assembly testing and support

When you register an assembly that references an untested .NET Framework assembly in SQL Server, you may receive the following warning message:

.Net frameworks assembly AssemblyName you are registering is not fully tested in SQL Server hosted environment.

The message means that the .NET Framework assembly hasn't been tested in the SQL Server CLR-hosted environment. Therefore, the assembly isn't supported in the SQL Server CLR-hosted environment.

An untested .NET Framework assembly may exit its host process when a critical condition such as low-memory condition occurs. You can use the assembly in the SQL Server CLR-hosted environment at your own risk. However, SQL Server Customer Support Services (CSS) won't help you to use and troubleshoot issues that are associated with an unsupported .NET Framework assembly. If CSS determines that a particular unsupported assembly causes SQL Server issues, you may be asked to stop using the assembly. Additionally, you may be asked to stop using the assembly temporarily when CSS troubleshoots a particular SQL Server issue if it's necessary.

Assembly registration

There are two kinds of .NET assemblies: pure and mixed. Pure .NET assemblies contain only MSIL instructions. Mixed assemblies contain both unmanaged machine instructions and MSIL instructions. Mixed assemblies in general are compiled in a C++ compiler by using the "clr" switch, and also contain machine instructions built from native C++ code.

When you use a .NET Framework assembly that isn't in the supported list, you are required to use the CREATE ASSEMBLY statement to register the assembly and the referenced assemblies within SQL Server database. The SQL Server CREATE ASSEMBLY statement lets only pure .NET Framework assemblies be registered. If the assembly or any referenced assembly isn't a pure .NET Framework assembly (and, therefore, is a mixed assembly), you receive the following error message:

Msg 6544, Level 16, State 1, Line 2
CREATE ASSEMBLY for assembly '<assembly name>' failed because assembly '<assembly name>' is malformed or not a pure .NET assembly.
Unverifiable PE Header/native stub.

In this case, you can't use the .NET Framework assembly together with SQL CLR unless the assembly is in the supported list that's documented in this article. Additionally, a .NET Framework assembly can change from a pure assembly to a mixed assembly between versions. If you use an assembly that's not in the supported list, you might have a situation in which the assembly works in one version of the .NET Framework but not in another. This restriction doesn't apply to the assemblies in the supported list because these assemblies are not required to be registered by using the CREATE ASSEMBLY statement.

Additionally, you must maintain these assemblies after you upgrade the .NET Framework. The following error message is shown when you execute a CLR routine or use an assembly in SQL Server:

Assembly in host store has a different signature than assembly in GAC. (Exception from HRESULT: 0x80131050)

Assemblies that are supported in a SQL Server CLR-hosted environment

The following .NET Framework assemblies are supported in a SQL Server CLR-hosted environment:

  • Microsoft.VisualBasic.dll

  • Mscorlib.dll

  • System.Data.dll

  • System.dll

  • System.Xml.dll

  • Microsoft.VisualC.dll

  • CustomMarshalers.dll

  • System.Security.dll

  • System.Web.Services.dll

  • System.Data.SqlXml.dll

  • System.Transactions.dll

  • System.Data.OracleClient.dll

  • System.Configuration.dll

Source: Microsoft Learn / IT Pro troubleshooting by Microsoft and contributors. Documentation licensed CC BY 4.0. Code samples are covered by the MIT License. Converted from Markdown, with links normalized and embedded media omitted.

资料来源与适用范围

资料来源
Microsoft Learn / IT Pro troubleshooting
适用范围
See source applicability · Source date 09/25/2020
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 4.0 (documentation), MIT (code samples)

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。