2008-09-16 3 views
33

CLR 저장 프로 시저를 실행하려고 할 때 다음 오류가 발생합니다. 어떤 도움이라도 대단히 감사합니다.FileLoadException/Msg 10314 CLR 저장 프로 시저 실행 중 오류

Msg 10314, Level 16, State 11, Line 1 
An error occurred in the Microsoft .NET Framework while trying to load assembly id 65752. 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 'orders, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null' 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.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) 

답변

0

어셈블리가 파일 입출력을 수행합니까? 그렇다면 어셈블리 권한을 부여해야합니다. SSMS에서 :

  1. 속성을 선택,
  2. 가 데이터베이스
  3. 확장 "프로그래밍"
  4. 는 "어셈블리"확장에 대한 노드를 확장
  5. 어셈블리를 마우스 오른쪽 단추로 클릭하고 "데이터베이스"확장
  6. '일반'페이지에서 '권한 설정'을 '외부 액세스'로 변경하십시오.
67

SQL 명령을 사용하여 문제가 해결 된 것으로 보입니다.

USE database_name 
GO 

EXEC sp_changedbowner 'sa' 
ALTER DATABASE database_name SET TRUSTWORTHY ON 
+1

당신은 sp_changedbowner의 그것을 고정 데이터베이스 _ –

+2

를 사용하여 의미! http://support.microsoft.com/kb/918040에 대한 자세한 내용 –

+2

@ JuniorMayhé 해결했습니다! –

8

모든 CPU 구성으로 프로젝트를 빌드하십시오. x86 구성으로 내 프로젝트를 컴파일 할 때이 문제가 발생하여 x64 SQL 서버에서 실행하려고했습니다.

0
ALTER AUTHORIZATION ON DATABASE::mydb TO sa; 
ALTER DATABASE [myDB] SET TRUSTWORTHY ON 
GO