我刚刚将一个VS2008/.NET 3.5 SP1项目升级到了VS2010和.NET 4.我有一个生成后事件,它调用SGEN生成XmlSerializers程序集。从VS2008升级到VS2010后,SGEN无法工作
每当我尝试运行它时,我会收到以下错误消息。
"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 /?".
我从命令行运行SGEN得到相同的错误,但我找不出什么问题。有任何想法吗?