为引用的程序集抛出 FileNotFoundException
当我第一次尝试使用我引用的程序集中定义的类时,我遇到了一个非常奇怪的 FileNotFoundException
抛出。程序集没有更改,项目文件中的位置与磁盘上的物理路径正确对应。
当我将安装程序添加到 Windows 服务和安装项目时,由两个库项目、一个 Windows 服务项目和一个控制台应用程序组成的解决方案突然开始失败。但是,我将控制台应用程序作为单个启动对象,控制台应用程序和服务/安装程序项目之间没有任何引用。
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.
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
![扫码二维码加入Web技术交流群](/public/img/jiaqun_03.jpg)
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果启用程序集绑定日志记录,您会发现 FileNotFoundException 将在其中包含丢失文件的完整融合探测日志。通常这会让问题立即变得非常明显。
请参阅 http://msdn.microsoft.com/en-us /library/e74a18c4(VS.80).aspx
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.
See http://msdn.microsoft.com/en-us/library/e74a18c4(VS.80).aspx