为引用的程序集抛出FileNotFoundException [英] FileNotFoundException thrown for a referenced assembly

查看:122
本文介绍了为引用的程序集抛出FileNotFoundException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我第一次尝试使用在我引用的程序集中定义的类时,引起了非常奇怪的 FileNotFoundException 。程序集没有改变,项目文件中的位置正确对应于磁盘上的物理路径。

I'm getting a really weird FileNotFoundException thrown the first time I try to use a class defined in an assembly I have referenced. The assembly hasn't changed, and the location in the project file corresponds correctly to the physical path on disk.

这个突然出现在由两个库组成的解决方案中失败项目,Windows服务项目和控制台应用程序,当我将安装程序添加到Windows服务和安装项目。但是,我将控制台应用程序作为单个启动对象,在控制台应用程序和服务/安装程序项目之间不存在任何引用。

This suddenly started failing in a solution that consists of two library projects, a windows service project and a console application, when I added installers to the windows service and a setup project. However, I have the console app as a single startup object, there are no references in either way between the console application and the service/installer projects.

推荐答案

如果启用程序集绑定日志记录,您将发现FileNotFoundException将在其中包含缺少文件的完整融合探测日志。通常情况下,这个问题很明显。

If you enable Assembly Binding Logging, you will find that the FileNotFoundException will contain within it the complete fusion probing log for the missing file. Normally this makes the problem pretty obvious straight away.

请参阅 http://msdn.microsoft.com/en-us/library/e74a18c4(VS.80).aspx

这篇关于为引用的程序集抛出FileNotFoundException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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