<p>Receiving the following error when attempting to run a CLR stored proc. Any help is much appreciated.</p>

<pre><code>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&amp; stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
   at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, Assembly locationHint, StackCrawlMark&amp; stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection)
   at System.Reflection.Assembly.InternalLoad(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark&amp; stackMark, Boolean forIntrospection)
   at System.Reflection.Assembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark&amp; stackMark, Boolean forIntrospection)
   at System.Reflection.Assembly.Load(String assemblyString)
</code></pre>

[{'answer_id': 72445, 'author': 'Craig Stuntz', 'author_id': 7714, 'author_profile': 'https://Stackoverflow.com/users/7714', 'pm_score': 0, 'selected': False, 'text': '<p>Does your assembly do file I/O?  If so, you must grant the assembly permission to do this.  In SSMS:</p>\n\n<ol>\n<li>Expand "Databases" </li>\n<li>Expand the node for your database </li>\n<li>Expand "Programmability" </li>\n<li>Expand "Assemblies" </li>\n<li>Right-click your assembly, choose Properties </li>\n<li>On the "General" page, change "Permission set" to "External access"</li>\n</ol>\n'}, {'answer_id': 72463, 'author': 'homeskillet', 'author_id': 3400, 'author_profile': 'https://Stackoverflow.com/users/3400', 'pm_score': 6, 'selected': False, 'text': "<p>Ran the SQL commands below and the issue appears to be resolved.</p>\n\n<pre><code>USE database_name\nGO\n\nEXEC sp_changedbowner 'sa'\nALTER DATABASE database_name SET TRUSTWORTHY ON \n</code></pre>\n"}, {'answer_id': 7254737, 'author': 'nuwanda', 'author_id': 921239, 'author_profile': 'https://Stackoverflow.com/users/921239', 'pm_score': 3, 'selected': False, 'text': '<p>Build your project with ANY CPU configuration. I had this problem when compiled my own project with x86 configuration and tried to run it on x64 SQL server.</p>\n'}, {'answer_id': 10396277, 'author': '101V', 'author_id': 452045, 'author_profile': 'https://Stackoverflow.com/users/452045', 'pm_score': 2, 'selected': False, 'text': '<p>Applied all of the above suggestion and it failed.\nThen I recompiled my source code with "Any CPU" option, and it worked!</p>\n\n<p>This link helped:\n<a href="http://www.codeproject.com/Tips/147250/SQL-Server-failed-to-load-assembly-with-PERMISSION" rel="nofollow">SQL Server failed to load assembly with PERMISSION</a></p>\n'}, {'answer_id': 25848214, 'author': 'Musakkhir Sayyed', 'author_id': 3894854, 'author_profile': 'https://Stackoverflow.com/users/3894854', 'pm_score': -1, 'selected': False, 'text': '<pre><code>ALTER AUTHORIZATION ON DATABASE::mydb TO sa;\nALTER DATABASE [myDB] SET TRUSTWORTHY ON\nGO\n</code></pre>\n'}]
['https://Stackoverflow.com/questions/72281', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3400/']