2008-09-16 17 views
33

Al recibir el siguiente error al intentar ejecutar un proceso CLR almacenado. Cualquier ayuda es muy apreciada.FileLoadException/Msg 10314 Error al ejecutar CLR Stored Procedure

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) 

Respuesta

0

¿Su ensamblaje presenta E/S de archivo? Si es así, debes otorgar permiso al ensamblado para hacer esto. En SSMS:

  1. Expandir "Bases de datos"
  2. Expandir el nodo para su base de datos
  3. Ampliar "Programación"
  4. Expand "conjuntos"
  5. Haga clic con el montaje, seleccione Propiedades
  6. En la página "General", cambie "Conjunto de permisos" a "Acceso externo"
67

Ejecute el Los comandos SQL a continuación y el problema parece estar resuelto.

USE database_name 
GO 

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

se entiende utilizar nombre_basedatos –

+2

El sp_changedbowner lo arregló! Más detalles en http://support.microsoft.com/kb/918040 –

+2

@ JuniorMayhé ¡Lo arreglé! –

8

Cree su proyecto con CUALQUIER configuración de CPU. Tuve este problema cuando compilé mi propio proyecto con configuración x86 y traté de ejecutarlo en el servidor SQL x64.

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