June 3, 2009 at 6:56 am
Hi,
your problem is related to the fact that the call new XmlSerializer(typeof("yourtype")) by default tries to create a .NET assembly on the fly, saves it to some temporary location and loads it into it's process space.
This is fine with most .net apps, but SQL server is much more restricted due to its enterprise readiness and does not allow this kind of changing program code "on the fly".
So your only choice is to create a Xml Serialization assembly on compile time and load it into SQL Server as well.
By default, the XmlSerializer class looks for an assembly with the name of the assembly that holds the "mytype" class with the appendix "XmlSerializers", so if your assembly is called Company.Product.MyAssembly you would supply an assembly called Company.Product.MyAssembly.xmlSerializers.
I guess such an assembly is already been generated by your build process.
Unfortuantely, I cannot give you detailed advice because I have no sample at hand.
WM_JUSTMY2CENTS
Guenter
Viewing post 1 (of 2 total)
You must be logged in to reply to this topic. Login to reply