SGEN:试图加载格式不正确的程序集
- 作者: 大家都日李婉姬
- 来源: 51数据库
- 2023-02-13
问题描述
我有一个可以在我的本地机器上正常构建的项目,但是,当我让 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 并再次尝试构建.
- C#通过fleck实现wss协议的WebSocket多人Web实时聊天(附源码)
- 团队城市未满足要求:MSBuildTools12.0_x86_Path 存在
- 使用 MSBuild.exe 在发布模式下构建 C# 解决方案
- 当我发布 Web 应用程序时,AfterPublish 脚本不运行
- 构建时 T4 转换的产品仅在下一个构建中使用
- ASP.NET Core Application (.NET Framework) for Windows x64 only error in project.assets.json
- 新的 .csproj 格式 - 如何将整个目录指定为“链接文件"到子目录?
- 如何将条件编译符号(DefineConstants)传递给 msbuild
- MSBuild 支持 Visual Studio 2017 RTM 中的 T4 模板
- NuGet 包还原找不到包,没有源