有助于调试的提示“无法加载文件或程序集X或其一个依赖项” [英] Tips to help debug "Could not load file or assembly X or one of its dependencies"

查看:324
本文介绍了有助于调试的提示“无法加载文件或程序集X或其一个依赖项”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找提示/建议/见解,以帮助调试应用程序加载问题; 无法加载文件或程序集 ...

I'm looking for tips/suggestions/insights to help debug an on application load issue; Could not load file or assembly...

遇到此问题的解决方案/项目是从工作副本Visual Studio 2008到Visual Studio 2010版本候选。转换过程似乎是成功的,所有的解决方案项目都设置为框架4 。

The solution/project where I'm experiencing this issue is a conversion from a working copy in Visual Studio 2008 to the Visual Studio 2010 Release Candidate. The conversion process appeared to be successful, and all the solution projects are set to Framework 4.

异常是在第三方组件一个图形处理库),但任何答案可能会帮助其他任何麻烦的DLL。

The exception is on a 3rd party component (a graphics processing library), but any answers could possibly help others with any troublesome DLL.


无法加载文件或程序集Aurigma.GraphicsMill .DLL或其依赖关系之一。不是有效的Win32应用程序。 (HRESULT的异常:0x800700C1)

Could not load file or assembly 'Aurigma.GraphicsMill.DLL' or one of its dependencies. is not a valid Win32 application. (Exception from HRESULT: 0x800700C1)

这个异常令人困惑的是额外的文字:不是一个有效的Win32应用程序的。

What's confusing about this exception is the additional text: is not a valid Win32 application.

完整的异常堆栈跟踪在 PasteBin 上,但是在这个问题上似乎没有太多的光明...

The full exception stack trace is up on PasteBin, but doesn't seem to shed much more light on the issue...

我迄今为止没有成功尝试过:

What I have tried so far with no success:


  1. 简单的清理,重建,重新启动Visual Studio 2010 RC的组合。

  2. 删除并重新添加相关的DLL。 >
  3. 在有问题的DLL上切换copy local为true和false。

  4. 确认在成功构建后,相关DLL出现在bin中\debug文件夹。

  5. 检查有问题的DLL的任何不必要的引用(没有找到)。

  6. DLL的相关许可证文件问题在同一个目录中。

  1. Simple clean, rebuild, restart combinations of Visual Studio 2010 RC.
  2. Removing and re-adding the DLL in question.
  3. Toggling "copy local" to true and false on the DLL in question.
  4. Confirming that after a "successful build" the DLL in question appears in the bin\debug folder.
  5. Checking for any unnecessary references to the DLL in question (none found).
  6. The associated licence file for the DLL in question is in the same directory with it.

我也没有运气,在应用程序加载时遇到任何调试器断点。 / p>

I've also had no luck with it hitting any debugger breakpoints on application load.

推荐答案

我发现这个问题的原因是因为您已经切换到.net v4,您现在正在IIS7中专门针对asp.net v4使用新的应用程序池(该池本身称为ASP.NET v4.0)

I have found the cause of this issue to be that because you have switched to .net v4, you are now using a new application pool in IIS7 specificially for asp.net v4 (the pool itself is called 'ASP.NET v4.0')

在应用程序池的高级设置部分,将启用32位应用程序设置为true,您的问题DLL将按预期加载。

In the advanced settings section of the application pool, set 'Enable 32-bit Applications' to true and your problem DLL will now load as expected.

显然,如果您的Web应用程序有其自己的应用程序池,您应该这样做。

Obviously you should do the same if your web application has its own application pool.

如果您使用的是Windows Server 2008(而不是R2),请参阅这篇文章如何为应用程序池标识分配正确的权限

If you are using Windows Server 2008 (not R2) see this post on how to assign correct permissions for your application pool identity

这篇关于有助于调试的提示“无法加载文件或程序集X或其一个依赖项”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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