我有 ws2008 x64 和 vs2008。
当我将 vs 设置为 x64(因为我有 64 位 dll)并运行编译时,sgen 说
试图加载格式不正确的程序集
VS takse sgen 来自 C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\
我认为它应该从 C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\x64\
当我使用 64 位版本的 sgen 并将其放入 C:\Program Files\Microsoft SDKs\Windows\v6.0A\bin\(替换 32 位版本)时。我能够编译。
vs下sgen应该怎么指向正确的版本
我能否以某种方式为一个项目配置 solutinon 平台以指向正确的 sgen(对于 x86 到 32 位和 x64 到 64 位 sgen 版本)?
最佳答案
这对您有帮助吗?看看他所在的部分 uses sgen as a post build :
As a consequence you need to add the SGen command as a custom post-build event on the Build Events tab of your VS project properties:
"C:\Program Files\Microsoft Visual Studio 8\SDK\v2.0\Bin\sgen.exe" /force /assembly:"$(TargetPath)" /compiler:/keycontainer:VS_KEY_5EFB7881D71082EDCF85DBBFCD748B9A /compiler:/delaysign-
关于c# - sgen.exe x64 .net c# 失败,出现 "assembly with an incorrect format",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1980278/