我剛剛將一個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得到相同的錯誤,但我找不出什麼問題。有任何想法嗎?