调用执行.net程序集的存储过程时出错

时间:2009-11-19 14:51:26

标签: .net sql-server

尝试执行调用SQL 2005数据库中部署的.net程序集的存储过程时出现以下错误:

Msg 50000, Level 16, State 1, Procedure usp_GetPrintFilePathandExecPrintJob, Line 63
Error (10314) has occured while executing the usp_GetPrintFilePathandExecPrintJob method. Reason: An error occurred in the Microsoft .NET Framework while trying to load assembly id 65536. 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 'quantumprintfile, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b50734a63ac65c10' or one of its dependencies. An error relating to security occurred. (Exception from HRESULT: 0x8013150A)
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)

The assembly was added using:
CREATE ASSEMBLY [QuantumPrint]
AUTHORIZATION [dbo]
FROM ...
WITH PERMISSION_SET = EXTERNAL_ACCESS

我无法理解为什么我会收到上述错误。

2 个答案:

答案 0 :(得分:1)

最终通过一篇冗长的MSDN文章找到了解决方案。我们使用的登录没有'外部访问组装'。通过运行以下内容纠正了该问题:

USE Master 授予外部访问装配

答案 1 :(得分:0)

SQL Server用户是否有权执行该文件?