无法加载文件或程序集...或者它的一个依赖。试图用不正确的格式加载程序(.resx文件) [英] Could not load file or assembly ... or one of its dependencies. An attempt was made to load a program with an incorrect format (.resx file)

查看:374
本文介绍了无法加载文件或程序集...或者它的一个依赖。试图用不正确的格式加载程序(.resx文件)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在编译或试图在Windows上运行我的应用程序7 64位时,得到以下错误消息。我已经冲刷互联网,很多人都有同样的错误信息。然而,没有任何解决方案解决我的问题或情况。我使用 Visual Studio 2010中

I am getting the following error message when compiling or attempting to run my application on Windows 7 64 bit. I've scoured the Internet and many people have the same error message. However, none of the solutions address my problem or situation. I am using Visual Studio 2010.

错误38未能加载文件或程序集文件:/// D:/工程/视窗Projects/Weld/Components/FileAttachments/FileAttachments/FileAttachments/bin/x86/Debug/FileAttaching.dll'它的依赖或之一。试图用不正确的格式加载程序。线1212位置。D:\项目\的Windows项目\焊接\焊接\ Weld.UI \ frmMain.resx 1212年5 Weld.UI

Error 38 Could not load file or assembly 'file:///D:/Projects/Windows Projects/Weld/Components/FileAttachments/FileAttachments/FileAttachments/bin/x86/Debug/FileAttaching.dll' or one of its dependencies. An attempt was made to load a program with an incorrect format. Line 1212, position 5. D:\Projects\Windows Projects\Weld\Weld\Weld.UI\frmMain.resx 1212 5 Weld.UI

好了,我有两个项目,一个UI项目和FileAttachment的项目。 UI项目有一个参考FileAttachment的项目。当我编译任何CPU模式的UI项目,一切工作正常,和它运行。我认为任何CPU将在64位模式下运行,当我编译,因为这是我使用的平台。

Description

OK, so I have two projects, a UI project and a FileAttachment project. The UI project has a reference to the FileAttachment project. When I compile the UI project in "Any CPU" mode, everything works fine, and it runs. I assume 'Any CPU' will run in 64-bit mode when I compile as that is the platform I am using.

我想运行/编译为86,所以我尽量做到这一点。我更改所有项目x86和验证这些配置都编译到了X86的配置。我编译和上面所述得到的错误。

I want to run/compile as x86, so I try to do that. I change the configuration for all projects to x86 and verify that these configurations are compiling to x86. I compile and get the error as stated above.

我觉得很奇怪的是,它编译和64位工作正常,但不是32位。然而,编译和部署以用户为'任何CPU'的时候,如果这些用户有86仍然为他们的作品没有任何问题。我只是不能编译或运行为x86的我的电脑上。同样,我可以编译成的任何CPU 的,并部署到32位PC没有任何问题。

I find it odd that it compiles and works fine in 64-bit but not 32-bit. However, when compiled and deployed to users as 'Any CPU', if these users have x86 it still works for them without any problems. I just can't compile or run as x86 on my PC. Again, I can compile as Any CPU and deploy to a 32-bit PC without any problems.

无论是项目所引用的任何64位,只DLL文件。这两个项目都验证可以针对32位的DLL文件和.NET Framework组件。

Neither projects are referencing any 64-bit-only DLL files. Both projects are verified to be targeting 32-bit DLL files and .NET Framework assemblies.

我需要编译,并在32位模式下运行这个本地。我需要JIT编辑/继续,除其他事项。

I need to compile and run this locally under 32-bit mode. I need JIT edit/continue, among other things.

下面是code。在导致该问题的resx文件的行:

Here is the line of code in the resx file that is causing the problem:

 <data name="ImageList1.ImageStream" mimetype="application/x-microsoft.net.object.binary.base64">
....{mime data}....
 </data>

该RESX文件被证实为.NET 2.0生成,并且只引用.NET 2.0组件,而不是.NET 4.0的版本。

The resx file is verified to be generated for .NET 2.0 and is only referencing .NET 2.0 assemblies and not .NET 4.0 versions.

我怎样才能解决这个问题呢?我在网上搜索,发现数百人具有相同的错误消息,但不同的问题。

How can I fix this problem? I've searched the Internet and have found hundreds of people with the same error message, but a different problem.

推荐答案

这似乎与图片列出了VS 2010的错误。请参阅<一href="https://connect.microsoft.com/VisualStudio/feedback/details/532584/error-when-compiling-resx-file-seems-related-to-beta2-bug-5252020?wa=wsignin1.0">https://connect.microsoft.com/VisualStudio/feedback/details/532584/error-when-compiling-resx-file-seems-related-to-beta2-bug-5252020?wa=wsignin1.0

This appears to be a VS 2010 bug with image lists. See https://connect.microsoft.com/VisualStudio/feedback/details/532584/error-when-compiling-resx-file-seems-related-to-beta2-bug-5252020?wa=wsignin1.0

我能够利用所列的解决方法得到它为我工作。

I was able to utilize the workaround listed to get it to work for me.

发布者路易斯·麦克在5/12/2010上午8:50 我发现了同样的问题,只对64位机器上编译时,一个特定的项目。这似乎工作的解决方法是手动更改图像中的一个字符流每次用户控件或表单编辑在设计

Posted by Luis Mack on 5/12/2010 at 8:50 AM I've found the same problem, only for a specific project when compiling on a 64-bit machine. A fix that SEEMS to work is to manually alter one character in the image stream EVERY TIME the usercontrol or form is edited in the designer

AAEAAAD ///// AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w

          AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w

更改为 AAEAAAD ///// AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0yLjAuMC4w

Change to      AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj0yLjAuMC4w

这是 00LjAuMC4w 返回 0yLjAuMC4w 在该行的的结束(00回0Y)

吉姆

这篇关于无法加载文件或程序集...或者它的一个依赖。试图用不正确的格式加载程序(.resx文件)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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