I know this question has been asked before, but none of the answers I've tried seem to work for me.
I'm trying to execute a CLR Stored Procedure in Sql Server 2005. The CLR generates a file, sends it to a webservice, reads the XML response (using .net's XML serialization classes) and logs the result.
When I try to execute it, I get this error:
System.InvalidOperationException: Cannot load dynamically generated serialization assembly. In some hosting environments assembly load functionality is restricted, consider using pre-generated serializer.
Supposedly, this can be fixed by using the XML Serializer Generator tool (Sgen.exe) to create the XML serialization assembly for the original assembly manually and then loading the assemblies into the SQL Server database. (See here, here and here)
I've generated the XML Serialization assembly, loaded into the database, and decorated the serialization classes using the XmlSerializerAssembly attribute. Still get the same error.
I've tried using different versions of the sgen.exe tool and toyed with different permission sets for the assemblies, to no avail.
What am I missing? Is there some configuration in the server that can prevent this from working?