0

I have followed all the steps in below link.

http://support.microsoft.com/kb/913668 - Method 2

But still I'm facing the same error

'Cannot load dynamically generated serialization assembly. In some hosting environments assembly load functionality is restricted, consider using pre-generated serializer. after creating xmlserializer assembly'.

Pleae help me on this

Larme
  • 24,190
  • 6
  • 51
  • 81
user2537735
  • 117
  • 1
  • 2
  • 11

1 Answers1

0

Referenced here: http://support.microsoft.com/kb/913668

MS SQL sandboxes .NET and doesn't allow you to do dynamic CLR generation. You can get around this by generating the assembly at compile-time using this as a post-build step:

"C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\sgen.exe" /force "$(TargetPath)"

The referenced article has a couple other options, but if your schema is pre-determined, sgen is the way to go.

XeroxDucati
  • 5,130
  • 2
  • 37
  • 66
  • Thanks for your reply. I have gone through same article & followed Method2. generated.XmlSerializer.dll through VS command prompt & created assembly for that also in SQL. Still I'm facing the same error. Please help me. – user2537735 Apr 25 '14 at 04:06
  • Did you add this assembly to SQL? – XeroxDucati Apr 25 '14 at 15:17
  • Thanks for your responses. I had added that also. But I was facing the same issue. After upgrading my sql to sql 2012, it started working properly without any other changes. – user2537735 Apr 26 '14 at 09:50