加载程序集失败,因为格式不正确 [英] Loading an Assembly fails because of incorrect format

查看:171
本文介绍了加载程序集失败,因为格式不正确的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发一个pretty的大窗户形式的.NET(C#)应用程序与几个大会的。原来每个组件是构建目标Platfom任何CPU。 由于在x64机器使用Crystal Reports的问题,我们必须建立在x86目标平台的整个项目。我startet重建我们的一些项目为x86和它的工作就好了。 但有一点我有问题,当我尝试使用它作为另一个程序集的引用,其​​他人会不会加载它给以下错误:

I develop on a pretty big windows forms .net (C#) application with several assemblys. Originally each assembly was build for the Target Platfom "Any CPU". Due to a problem with Crystal Reports on x64 machines we had to build the whole project for x86 target platform. I startet rebuilding some of our Projects for x86 and it worked just fine. But with one I have the problem that when I try to use it as a reference in another Assembly, the other one won't load it giving following Error:

无法加载文件或程序#MyAssembly程序#或它的一个依赖。试图用不正确的格式加载程序。

Could not load file or assembly #MyAssembly# or one of its dependencies. An attempt was made to load a program with an incorrect format.

当水晶与多个组件玩弄在样本项目中,我发现,当这些项目打造为不同的目标平台出现此错误。但是,这不是这里的情况。我打造每一个项目的X86,只是想不通问题出在哪里就在这里。

When playing Around with Crystal in a sample project with more than one assembly I found out that this error occurs when the Projects are build for different target platforms. But this isn't the case here. I build every Project for X86 and just can't figure out where the problem is here.

推荐答案

您可以尝试,与目标平台86或64,建立自己的MainProject(可执行文件)的设置为任何CPU的所有其他项目

You can try, to build your MainProject (Executable) with target platform "x86" or "x64", an all other projects you set to "Any CPU".

这篇关于加载程序集失败,因为格式不正确的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆