title: Serialized Assembly Won't Upload to Database
body: <p>I have a CLR project that calls a simple HTTP web service. Its x64-targeted and I got it to serialize properly only after going through the steps outlined at the following link which talks about the changes required to have VS2010 point to the correct target architecture (x64) - the changes just required unloading and changing the .csproj file with a few extra lines to reference the correct version of sgen.exe: <a href="http://geekswithblogs.net/akraus1/archive/2011/12/10/148002.aspx" rel="nofollow">http://geekswithblogs.net/akraus1/archive/2011/12/10/148002.aspx</a></p>
  
  <p>Now, I am able to build this project and its .XmlSerializers.dll by setting "Generate serialized assembly" to on. I wanna do this because my CLR project is going to get deployed on the database, and I don't want it to runtime serialize any objects since those DLLs are not referenced in my database and I don't want to give my CLR project permissions higher than EXTERNAL_ACCESS for security reasons because this will be used in a production environment where security is important, and also because my database is NOT trustworthy.</p>
  
  <p>Long story short, I am following the guide at the following link to upload my serialized assembly into the database but I get an error: <a href="http://footheory.com/blogs/bennie/archive/2006/12/07/invoking-a-web-service-from-a-sqlclr-stored-procedure.aspx" rel="nofollow">http://footheory.com/blogs/bennie/archive/2006/12/07/invoking-a-web-service-from-a-sqlclr-stored-procedure.aspx</a></p>
  
  <p>The error is: CREATE ASSEMBLY for assembly '.XmlSerializers' failed because the assembly is built for an unsupported version of the Common Language Runtime.</p>
  
  <p>Does anyone know how to correct this by forcing sgen.exe to serialize a CLR-supported version of the assembly? Viva the Stack.</p>