An error occurred in the Microsoft .NET Framework while trying to load assembly id 65536.

Hi Team,

I am facing below exception when I try to run a stored procedure,

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 'ssma4oraclesqlservercollections.net, Version=6.0.0.26538, Culture=neutral, PublicKeyToken=31bf3856ad364e35' 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)

Please could you help me on how to resolve this problem.

Thanks & Regards,

Rajendra Lella

August 21st, 2015 12:48pm

Hi Rajendra,

Please check this link.

https://support.microsoft.com/en-us/kb/918040

Free Windows Admin Tool Kit Click here and download it now
August 21st, 2015 11:09pm

Make sure that you have set the assembly up with External_access rights, as this is required to do File activities in SQLCLR.  In SSMS, right click on the Assembly under programability and look at its properties page.  You can see what CAS level it has there.  It is likely in Safe mode currently which will need to be changed to External_access with Alter Assembly or from the properties page.  Safe is the default mode for assemblies.

https://social.msdn.microsoft.com/forums/sqlserver/en-US/fff32f10-26bf-4c2e-929a-eff6dab28ab1/problem-with-clr-assembliesbeginner

August 22nd, 2015 1:12am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics