【问题标题】:Create assembly in SQL Server在 SQL Server 中创建程序集
【发布时间】:2012-09-11 19:06:35
【问题描述】:

我不断收到以下错误:

Msg 10314, Level 16, State 11, Line 1
An error occurred in the Microsoft .NET Framework while trying to load assembly id 66079. The server may be running out of resources, or the assembly may not be trusted with PERMISSION_SET = EXTERNAL_ACCESS or UNSAFE. Run the query again, or check documentation to see how to solve the assembly trust issues. For more information about this error: 
System.IO.FileLoadException: Could not load file or assembly 'ncestablegenerator, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The given assembly name or codebase was invalid. (Exception from HRESULT: 0x80131047)
System.IO.FileLoadException: 
   at System.Reflection.Assembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
   at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
   at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)
   at System.Reflection.Assembly.Load(String assemblyString)

这是我的程序集的创建:

CREATE ASSEMBLY [NCESTableGenerator]
AUTHORIZATION [dbo]
from 'C:\SqlDlls\NCESTableGenerator.dll'
WITH PERMISSION_SET = UNSAFE
GO

有什么想法吗?服务器上有足够的空间。

【问题讨论】:

  • 会不会是 SQL Server 服务帐户没有权限查看/访问 C:\SqlDlls?您是否尝试将 DLL 放在实例的 binn 文件夹中?
  • 没关系,我将一些构建属性设置为 x86 而不是任何 cpu。

标签: sql sql-server sql-server-2005 .net-assembly


【解决方案1】:

在运行该语句之前,您需要将数据库可信任设置为 ON。

【讨论】:

    猜你喜欢
    • 2018-03-15
    • 2018-05-19
    • 1970-01-01
    • 2014-01-24
    • 2011-11-20
    • 1970-01-01
    • 1970-01-01
    • 2013-06-15
    • 2020-05-02
    相关资源
    最近更新 更多