【发布时间】:2012-11-02 13:59:59
【问题描述】:
我正在尝试将我的外部 .dll(如 DevExpress 和其他)移动到另一个名为“lib”的文件夹。
我在 app.config 文件中添加了以下几行:
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="lib" />
</assemblyBinding>
我将我的 .dll 文件与我的安装项目一起输出到 lib 文件夹。应用程序安装成功,但是当我启动应用程序时,我的启动屏幕(由 VS2010 配置)显示并消失,这就是发生的一切。目录结构是这样的:
// FAILS
..\MyApp\Application.exe
..\MyApp\Application.exe.config // With assemblyBinding added
..\MyApp\lib\*.dll // All dll files are here
如果我将 application.exe.config 文件更改为从基本目录加载并将 .dll 复制回基本目录,它运行正常。
// RUNS FINE
..\MyApp\Application.exe
..\MyApp\Application.exe.config // With assemblyBinding removed
..\MyApp\*.dll // All dll files are here
可能是什么问题?
谢谢。
【问题讨论】:
-
首先使用调试器。如果您的代码正在吞噬异常,则使用 Debug + Exceptions, Throw 复选框强制它在引发异常时停止。 Fuslogvw.exe 是解决程序集解析问题的好工具。
-
我无法重现该问题。您描述的两种情况都对我有用。需要更多关于正在发生什么错误的信息。
-
谢谢,调试后发现是app.config文件出错。现在可以使用了!
标签: .net visual-studio-2010 dll deployment installation