为引用的程序集抛出 FileNotFoundException

发布于 2024-09-09 11:04:34 字数 240 浏览 5 评论 0原文

当我第一次尝试使用我引用的程序集中定义的类时,我遇到了一个非常奇怪的 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技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

行雁书 2024-09-16 11:04:34

如果启用程序集绑定日志记录,您会发现 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文