I have had an UNSAFE assembly running on an internal only database and web application but the IT dept. might have changed something as we noticed it just stopped working and trying to figure out why.
The error:
Msg 10314, Level 16, State 11, Line 12
An error occurred in the Microsoft .NET Framework while trying to load assembly id xxxxx. 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 'mytestassembly, Version=0.0.0.0, Culture=neutral, PublicKeyToken=xXXXXXXXXXXXXx' or one of its dependencies. An error relating to security occurred. (Exception from HRESULT: 0xXXXXXXXA)
System.IO.FileLoadException:
at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
A couple of tidbits/questions:
- Something happened in the last week and it just started getting these errors above
- The assembly is UNSAFE because JSON.Net was added to it years ago
- As far as I can tell via IT talks, trustworthy is ON (I know the security but this is only internal)
- Do the
.pfxkeys expire? - Is there any query I can run to check all the permissions to see if anything is correct? (I myself might not have full access but someone can check them)
- I don't believe it uses a certificate but in the past we use
.pfxwith a certain login to access the assembly. - I believe this was created in SQL Server 2012 but runs on SQL Server 2016 now
Any help would be greatly appreciated.