简体   繁体   English

对dll所做的更改未反映在我使用此dll的应用程序中

[英]Changes made to the dll are not reflecting in the Application where I am using this dll

I have a Class library project. 我有一个班级图书馆项目。 I am installing this dll produced by the project into the GAC by the command "gacutil /i [Path of the dll]". 我正在通过命令“ gacutil / i [dll的路径]”将项目生成的dll安装到GAC中。 This dll is used by a windows application. Windows应用程序使用此dll。 When windows application runs, it successfully accesses the functions and properties of the dll. Windows应用程序运行时,它将成功访问dll的功能和属性。 Now I have made some changes to the dll. 现在,我对dll进行了一些更改。 I have uninstalled the original dll from the GAC and will install the newer dll with the required changes. 我已经从GAC卸载了原始dll,并将通过所需的更改安装更新的dll。 Now when the windows application uses this dll, the new changes from the dll are not getting reflected in the application. 现在,当Windows应用程序使用此dll时,来自dll的新更改将不会反映在应用程序中。 The new changes should reflect into the application as I installed the new dll into the GAC. 当我将新的dll安装到GAC中时,新的更改应反映到应用程序中。 The Name, version and Public key token is the same for both dlls. 两个dll的名称,版本和公共密钥令牌都相同。 I think it won't matter as the i have uninstalled the previous dll and installed the new dll into the GAC. 我认为这无关紧要,因为我已经卸载了以前的dll,并将新的dll安装到了GAC中。

Am I doing something wrong?? 难道我做错了什么?? Please suggest a solution. 请提出解决方案。

Thanks and Regards, Mayur Mahajan 谢谢和问候,Mayur Mahajan

I would suggest for debugging purposes that you version your dll, then print the version to your application to be sure its being updated. 我建议出于调试目的,对dll进行版本控制,然后将其打印到应用程序中以确保其已被更新。 Include the System.Reflection namespace and the code would run look like the following: 包含System.Reflection命名空间,代码将如下运行:

Assembly assembly = Assembly.LoadFrom("unknown.dll");
label.Text = assembly.GetName().Version.ToString();

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM