Click here to Skip to main content
13,004,839 members (69,819 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as


1 bookmarked
Posted 17 Jan 2011

SQL Server failed to load assembly with PERMISSION_SET = EXTERNAL_ACCESS or UNSAFE

, 17 Jan 2011
Rate this:
Please Sign up or sign in to vote.
32 bit or 64 bit SQL Server
I got the following error message from one of my client's sites. They run SQL Server 2008 64 bit version.

"An error occurred in the Microsoft .NET Framework while trying to load assembly id 65540. The server may be running out of resources, or the assembly may not be trusted with PERMISSION_SET = EXTERNAL_ACCESS or UNSAFE."

I Googled a lot on the Internet. I tried all the tricks, such as:

Alter Database ... Set Trustworthy On
sp_configure 'ole automation procedures' 1
sp_changedbowner 'sa'

All failed.

At last, I saw one article that talked about 32 bit assembly cannot be loaded on 64 bit SQL Server. I recompiled my source code with "Any CPU" option, and it worked!

Again, Microsoft displays a misleading and confusing message here, it allows you to create the assembly without any error, it doesn't say it cannot load 32 bit assembly, but it told you it doesn't trust EXTERNAL_ACESSS or UNSAFE assembly.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

United States United States
This member doesn't quite have enough reputation to be able to display their biography and homepage.

You may also be interested in...

Comments and Discussions

Questionexactly Pin
mamad136323-Aug-13 22:13
membermamad136323-Aug-13 22:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170627.1 | Last Updated 18 Jan 2011
Article Copyright 2011 by xszhu
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid