SQL Server CLR Stored Procedure Error


Author
Message
Trent Taylor
Trent Taylor
StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)StrataFrame Developer (8.5K reputation)
Group: StrataFrame Developers
Posts: 6.6K, Visits: 6.9K
Recently I ran into a situation where we were deploying a CLR stored procedure.  It would always work in all development machines, however, when we would attempt to distribute the CLR sproc to a client it would throw the following exception:

An error occurred in the Microsoft .NET Framework while trying to load assembly id 65537. 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:

This can come from any number of things.  However, in this case I could place the debug build out there and it would work.  Put the release out there again and it would fail.  After looking at everything BUT the compiler options, I finally looked to see what the differences were between the build versions.  In short, the Optimize Code flag was set on the release build but not on the debug.  Once this flag was removed on teh release, it started working. 

Once this flag was removed, life was good again! Smile

GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search