exe的dll参考路径更改 [英] dll reference path alteration for Exe

查看:622
本文介绍了exe的dll参考路径更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,专家,

我已经开发了一个数据库驱动的软件,该软件需要在项目中使用的几个dll.当我创建Deployment项目并将其部署到我的客户端时. dll路径存在问题.

但是,我已经通过创建目录结构并将dll放入其中的方式修复了该问题.一些dll需要放在我的应用程序文件夹中.但是我在部署项目中做了并更改了相同的内容.

但是,如果我不想将这些dll放在我的应用程序目录中并且想保留在Windows \ system中,该​​怎么办?我的exe如何引用新路径.那是我的问题.

我希望你理解我的问题.

我正在将VS 2005 IDE与vb.net Lang和MS-Access作为数据库一起使用.

提前谢谢.

Jay Khatri

Hi Experts,

I have developed a database driven software which requires few dll''s that I have used in my project. When I created the Deployment project and deployed to my client with that. There was a problem with dll path.

However I have fixed the same by creating a directory structure and placing dlls into that. Some dlls required to be placed in my application folder. However I had done and changed the same in my deployment project.

But what if I don''t want to place that dlls in my application directory and like to keep in windows\system and how would my exe be reference to a new path. That is my question.

I hope you understood my problem.

I am using VS 2005 IDE with vb.net Lang and MS-Access as DB.

Thanks in advance.

Jay Khatri

推荐答案

我建​​议阅读汇编.此页面: .NET中的程序集:它们是什么以及如何对其进行管理 [ ^ ]给出了很好的描述.如果它们是com程序集,则只需注册它们即可.如果它是点网控件且具有强符号,则可以将其加载到GAC中.

或者,您也可以使用AppDomain.AssemblyResolve.关于此功能有很多信息,但我可能从这里开始:如何在运行时加载程序集中的程序集,该程序集位于文件夹,而不是应用程序的bin文件夹 [ ^ ].

我希望这是一个开始...
I would suggest reading up on Assemblies. This page: Assemblies in .NET: What they are and how to manage them[^] give a good description. If they are com assemblies, then you can simply register them. If it''s a dot net control and it''s strong signed, you could load it into the GAC.

Or, you could alternatively use AppDomain.AssemblyResolve. There is a lot of info out there about this function, but I might start here: How to load an assembly at runtime that is located in a folder that is not the bin folder of the application[^].

It''s a start I hope...


这篇关于exe的dll参考路径更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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