在C#项目的部署中找不到汇编 [英] Assembly Not Found on deployment of C# project

查看:189
本文介绍了在C#项目的部署中找不到汇编的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我在视觉工作室做了一个C#项目,有3个类库项目。调试时一切正常,当我尝试部署。数据库和程序安装很好,但是当我尝试打开应用程序时,我会收到一个Assembly或File Not Found Exception。他找不到的DLL是我的项目中的一个类库。

So I made a C# project in visual studio with 3 class library projects. Everything works fine when debugging but When I try to deploy. Database and Program installs just fine but when I try to open the Application, I get an Assembly or File not Found Exception. The DLL he can't find is a class library in my project.

在文件系统编辑器上,VS自动检测到依赖关系,并将3个dll文件包含在应用程序中目录。我尝试排除这些dll,只是添加类库项目的主要输出(Same dll),但仍然是同样的错误。

On the File System Editor, VS automatically detected the dependencies and included the 3 dll files in to application directory. I tried excluding these dll's and just adding the class library projects's primary output's (Same dll) but still the same error.

我使用自定义安装程序类创建我的数据库安装。但是我不认为这是相关的。

I used a Custom Installer class for creating my database on installation. But I don't think that is relevant.

推荐答案

如果您已经验证了3个程序集确实部署到目标文件夹,
它可能是另一个依赖关系,你没有包含在您的安装项目中。

If you have verified that your 3 assemblies are indeed deployed to your destination folder, it could very well be an another dependency that you have not included in your setup project.


  • 请仔细检查一下确实有合适的议会数量。您还可以右键单击安装项目并刷新依赖关系。

  • 您是否检查过安装项目中的依赖关系是否被排除(错误地)?

  • 此外,它也可能是.NET配置文件问题。您是否依赖于仅在完整.NET配置文件中可用的程序集,并且目标位置仅安装了客户端配置文件?

最坏的情况是运行 SysInternals进程监视器,并通过这种方式找出哪个程序集缺失。

In worst case, run the SysInternals process monitor and that way figure out which assembly is missing.

这篇关于在C#项目的部署中找不到汇编的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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