問(wèn)題描述
我有一個(gè)可以在我的本地機(jī)器上正常構(gòu)建的項(xiàng)目,但是,當(dāng)我讓 TFS 構(gòu)建它時(shí),我收到以下錯(cuò)誤 -
I have a project that can build fine on my local machine, however, when I get TFS to build it, I receive the following error -
SGEN:嘗試加載格式不正確的程序集:
SGEN: An attempt was made to load an assembly with an incorrect format:
在閱讀了此處有關(guān)此主題的許多其他帖子后,大多數(shù)人只是說(shuō)我需要將構(gòu)建類型更改為 x86 或 Any CPU,而不是 x64,但在嘗試了無(wú)數(shù)組合之后,這不是解決方案.我的程序也是一個(gè)windows服務(wù),所以設(shè)置App Pool允許32位應(yīng)用(其他人建議)也不是解決辦法.
After reading through many other posts here on this topic, most people just say I need to change the build type to either x86 or Any CPU, rather than x64, but after trying countless combinations, this was not the solution. My program is also a windows service, so setting the App Pool to allow 32 bit applications (as suggested by others) is also not the solution.
推薦答案
這個(gè)頁(yè)面終于解決了我的問(wèn)題 - http://aplocher.wordpress.com/2012/10/12/sgen-an-attempt-was-made-to-load-an-assembly-with-an-incorrect-format-tfs-2010/
My problem was finally solved by this page - http://aplocher.wordpress.com/2012/10/12/sgen-an-attempt-was-made-to-load-an-assembly-with-an-incorrect-format-tfs-2010/
以防萬(wàn)一該頁(yè)面將來(lái)消失,以下是所涉及的步驟 -
Just in case that page ever disappears in the future, here are the steps involved -
- 在團(tuán)隊(duì)資源管理器中,右鍵單擊您的構(gòu)建定義并選擇打開(kāi)進(jìn)程文件位置
- 雙擊選中的 XAML 文件
- 在設(shè)計(jì)器中,選擇名為 Sequence 的容器(這是圍繞其他所有內(nèi)容的頂級(jí)容器).
- 在 Arguments 列表(通常位于底部)中,將 MSBuildPlatform 從 Microsoft.TeamFoundation.Build.Workflow.Activities.ToolPlatform.Auto 更改為 Microsoft.TeamFoundation.Build.Workflow.Activities.ToolPlatform.X86.
- 保存并關(guān)閉文件.
- 將文件重新檢入 TFS 并再次嘗試構(gòu)建.
這篇關(guān)于SGEN:試圖加載格式不正確的程序集的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!