错误调用存储过程,而执行.NET程序集

错误调用存储过程,而执行.NET程序集

问题描述:

我越来越想执行一个存储过程,而调用SQL内部署一个.NET组件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 

我不能了解为什么我会收到上述错误。

SQL服务器用户是否有权执行该文件?

+0

大会是在数据库中,做用户调用存储过程的权限要求也对大会? – 2009-11-19 15:00:42

+0

TBH我没有遇到过一个叫组件的问题,我只是想到了第一件事。 当你说“在数据库中”时,你的意思是它带有SQL Server 2005吗?如果是这样的话,我认为在这种情况下权限是不相关的。 – 2009-11-19 15:33:18

最终通过漫长的MSDN文章找到解决方案。我们使用的登录名没有“外部访问汇编”。这件事是通过运行以下修正:

利用总体 GRANT外部访问大会