Tôi vừa mới nâng cấp một dự án VS2008/.NET 3.5 SP1 lên VS2010 và .NET 4. Tôi có một sự kiện sau xây dựng gọi SGEN để tạo ra hội đồng XmlSerializers.SGEN không hoạt động sau khi nâng cấp từ VS2008 lên VS2010
Bất cứ khi nào tôi cố gắng chạy, tôi nhận được lỗi sau.
"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 /?".
Tôi gặp lỗi tương tự khi chạy SGEN từ dòng lệnh, nhưng tôi không thể tìm ra vấn đề là gì. Bất kỳ ý tưởng?