問題描述
我有一個可以在我的本地機器上正常構建的項目,但是,當我讓 TFS 構建它時,我收到以下錯誤 -
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:
在閱讀了此處有關此主題的許多其他帖子后,大多數人只是說我需要將構建類型更改為 x86 或 Any CPU,而不是 x64,但在嘗試了無數組合之后,這不是解決方案.我的程序也是一個windows服務,所以設置App Pool允許32位應用(其他人建議)也不是解決辦法.
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.
推薦答案
這個頁面終于解決了我的問題 - 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/
以防萬一該頁面將來消失,以下是所涉及的步驟 -
Just in case that page ever disappears in the future, here are the steps involved -
- 在團隊資源管理器中,右鍵單擊您的構建定義并選擇打開進程文件位置
- 雙擊選中的 XAML 文件
- 在設計器中,選擇名為 Sequence 的容器(這是圍繞其他所有內容的頂級容器).
- 在 Arguments 列表(通常位于底部)中,將 MSBuildPlatform 從 Microsoft.TeamFoundation.Build.Workflow.Activities.ToolPlatform.Auto 更改為 Microsoft.TeamFoundation.Build.Workflow.Activities.ToolPlatform.X86.
- 保存并關閉文件.
- 將文件重新檢入 TFS 并再次嘗試構建.
這篇關于SGEN:試圖加載格式不正確的程序集的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!