在 SQL 中创建程序集
Create assembly in SQL
我尝试创建程序集:
CREATE ASSEMBLY SendSmsWSI from 'C:\Development\TestStas\SendSmsWSIntegration\SendSmsWSIntegration\SendSmsWSIntegration\bin\Debug\SendSmsWSIntegration.dll' WITH PERMISSION_SET = UNSAFE
并收到此错误:
Msg 10301, Level 16, State 1, Line 1
Assembly 'SendSmsWSIntegration' 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.
然后我尝试了:
CREATE ASSEMBLY
[System.ServiceModel]
from'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\System.ServiceModel.dll'with
permission_set = UNSAFE
但是在这里,我有这样的错误:
Msg 6544, Level 16, State 1, Line 12
CREATE ASSEMBLY for assembly 'System.ServiceModel' failed because assembly 'microsoft.visualbasic.activities.compiler' is malformed or not a pure .NET assembly.
Unverifiable PE Header/native stub.
为了创建我提到的第一个程序集,我做了什么?
先谢谢了。
您不能在 SQLCLR 中使用 WCF。我刚刚在我本地的 2016 CTP3 上测试过,它仍然给出同样的错误。这有一个问题,在此处标记为 "Won't Fix" https://connect.microsoft.com/SQLServer/Feedback/Details/809697 - 他们只是将 link 提供给官方支持的程序集列表:
- 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
我尝试创建程序集:
CREATE ASSEMBLY SendSmsWSI from 'C:\Development\TestStas\SendSmsWSIntegration\SendSmsWSIntegration\SendSmsWSIntegration\bin\Debug\SendSmsWSIntegration.dll' WITH PERMISSION_SET = UNSAFE
并收到此错误:
Msg 10301, Level 16, State 1, Line 1 Assembly 'SendSmsWSIntegration' 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.
然后我尝试了:
CREATE ASSEMBLY [System.ServiceModel] from'C:\Windows\Microsoft.NET\Framework64\v4.0.30319\System.ServiceModel.dll'with permission_set = UNSAFE
但是在这里,我有这样的错误:
Msg 6544, Level 16, State 1, Line 12 CREATE ASSEMBLY for assembly 'System.ServiceModel' failed because assembly 'microsoft.visualbasic.activities.compiler' is malformed or not a pure .NET assembly. Unverifiable PE Header/native stub.
为了创建我提到的第一个程序集,我做了什么?
先谢谢了。
您不能在 SQLCLR 中使用 WCF。我刚刚在我本地的 2016 CTP3 上测试过,它仍然给出同样的错误。这有一个问题,在此处标记为 "Won't Fix" https://connect.microsoft.com/SQLServer/Feedback/Details/809697 - 他们只是将 link 提供给官方支持的程序集列表:
- 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