NET的Windows7中的程序集加载问题 [英] Assembly Load problem in windows7 for .Net
问题描述
我的应用程序在运行时加载.dll
My application loads a .dll at runtime
Assembly.Loadfile
当通过右键单击并单击应用程序运行该应用程序时,它将在Windows文件夹[System32文件夹]
中搜索.dll.
有时,如果应用程序是通过msi安装程序交付的,则可以正常工作,但对于直接复制/粘贴部署,它始终会给出找不到.dll的错误.
任何帮助,将不胜感激.
问候,
Ramlagan M
于2011年8月30日更新
这是托管的dll.
每当我运行应用程序时,它都会创建
任务栏中应用程序的图标.
现在,如果我右键单击此任务栏图标
它显示了3个菜单
1.关闭窗口
2.将此程序固定到任务栏
3.我的申请[说abc]
现在,如果我单击abc,它将创建该应用程序的新实例,但这一次
exe在不可用的system32文件夹[Assembly.Loadfile]中搜索dll.
When the application runs by right click + click on application , it searches for the .dll in the windows folder [ System32 folder ]
Sometimes if the application is delivered through an msi setup it works fine but for direct copy/paste deployement it always gives error that .dll could not be found.
Any help with this would be greatly appreciated.
Regards,
Ramlagan M
Updated on 30-August-2011
It is Managed dll.
Whenever I run the application it creates
icon of the application in taskbar.
Now if i right click on this taskbar icon
it shows me 3 menus
1. Close Window
2. Pin this program to taskbar
3. My Application [ say abc ]
Now if i click on abc it creates new instance of the application but this time
exe search for dll in system32 folder [ Assembly.Loadfile ] where it is not available.
推荐答案
您必须使用需要在系统上注册的非托管dll. .
如果复制/粘贴,请尝试使用RegSvr32
注册dll.
You must be using an unmanaged dll that needs to be registered on the system.
If you copy / paste, try registering the dll usingRegSvr32
.
在使用MSI安装应用程序时,它将注册您的.dll.当您复制/粘贴目录结构并尝试直接运行应用程序时,未注册的dll会给您错误.
是的.如Abhinav所说,请使用regsvr32"dll文件路径"注册您的dll.
When u install your application with MSI, it will register your .dll. and when u copy/paste your directory structure and try to run application directly, your unregistered dll gives you error.
yes. as Abhinav said, register your dll with regsvr32 "dll file path".
以防万一
How_to_use_the_regsvr32_utility_to_register_a_dll [
Just in case
How_to_use_the_regsvr32_utility_to_register_a_dll[^]
这篇关于NET的Windows7中的程序集加载问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!