SGEN doesn't work after upgrading from VS2008 to VS2010

Posted by emddudley on Stack Overflow See other posts from Stack Overflow or by emddudley
Published on 2010-04-30T17:17:10Z Indexed on 2010/04/30 17:27 UTC
Read the original article Hit count: 988

Filed under:
|
|

I just recently upgraded a VS2008/.NET 3.5 SP1 project to VS2010 and .NET 4. I have a post-build event which calls SGEN to generate the XmlSerializers assembly.

Whenever I try to run it I get the following error.

"C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\sgen.exe" /debug /force /verbose /c:"platform:x86" "C:\path\to\SomeAssembly.dll"
Microsoft (R) Xml Serialization support utility
[Microsoft (R) .NET Framework, Version 2.0.50727.3038]
Copyright (C) Microsoft Corporation. All rights reserved.
Error: An attempt was made to load an assembly with an incorrect format: c:\path\to\someassembly.dll.
  - Could not load file or assembly 'file:///c:\path\to\someassembly.dll'
or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.

If you would like more help, please type "sgen /?".

I get the same error running SGEN from the command line, but I can't figure out what the problem is. Any ideas?

© Stack Overflow or respective owner

Related posts about sgen

Related posts about visual-studio-2010