我对运行T-SQL的.NET Standard项目有要求。我发现有关此的信息很少。我已将TRUSTWORTHY设置设为ON。
我尝试从C:\Program Files\dotnet\sdk\2.2.103\Microsoft\Microsoft.NET.Build.Extensions\net461\lib\
文件夹导入netstandard.dll。失败并显示以下错误。但是即使从同一文件夹导入System.Data.Common之后,我仍然收到以下错误。
从C:\Program Files\dotnet\sdk\NuGetFallbackFolder\netstandard.library\2.0.3\build\netstandard2.0\ref
文件夹导入netstandard.dll时,我没有收到任何错误。但是,在调用该函数时,我收到以下错误。
Msg 10313, Level 16, State 51, Line 17
An error occurred while using the .NET Framework during IL compilation. The server may be running out of resources. Try running the query again. If the problem persist, contact a support professional.
System.IO.FileLoadException: Could not load file or assembly 'netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. Assembly in host store has a different signature than assembly in GAC. (Exception from HRESULT: 0x80131050) See Microsoft Knowledge Base article 949080 for more information.
System.IO.FileLoadException:
at System.Reflection.RuntimeAssembly.GetType(RuntimeAssembly assembly, String name, Boolean throwOnError, Boolean ignoreCase, ObjectHandleOnStack type)
at System.Reflection.RuntimeAssembly.GetType(String name, Boolean throwOnError, Boolean ignoreCase)
.NET Framework程序集可以正常工作。 SQL Server是否支持运行.NET Standard程序集?如果不支持,解决方法是什么?除了通过.NET Framework调用Web服务并让Web服务调用.NET Standard代码之外,还有什么解决方案比这更简单吗?
答案 0 :(得分:1)
SQL Server使用https://docs.microsoft.com/en-us/sql/relational-databases/clr-integration/database-objects/supported-net-framework-libraries?view=sql-server-2017中列出的某些库来支持.NET Framework 4程序集。
有关SQL Server中CLR的最新“最新消息”页面仅提及SQL Server 2012中添加的功能:https://docs.microsoft.com/en-us/sql/relational-databases/clr-integration/clr-integration-what-s-new?view=sql-server-2017
.NET Core和.NET Standard是较新的东西(分别于2014年和2016年推出)。