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

发布于 2024-12-28 01:51:21 字数 382 浏览 6 评论 0原文

我有一个类库项目。我通过命令“gacutil /i [dll 的路径]”将项目生成的 dll 安装到 GAC 中。该 dll 由 Windows 应用程序使用。当Windows应用程序运行时,它成功地访问了dll的函数和属性。 现在我对dll做了一些修改。我已从 GAC 卸载了原始 dll,并将安装包含所需更改的较新 dll。现在,当 Windows 应用程序使用此 dll 时,来自 dll 的新更改不会反映在应用程序中。当我将新的 dll 安装到 GAC 中时,新的更改应该会反映到应用程序中。 两个 dll 的名称、版本和公钥标记相同。我认为这并不重要,因为我已经卸载了以前的 dll 并将新的 dll 安装到了 GAC 中。

我做错了什么吗?请提出一个解决方案。

谢谢和问候, 马尤尔·马哈詹

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]". This dll is used by a windows application. When windows application runs, it successfully accesses the functions and properties of the dll.
Now I have made some changes to the dll. I have uninstalled the original dll from the GAC and will install the newer dll with the required changes. Now when the windows application uses this dll, the new changes from the dll are not getting reflected in the application. The new changes should reflect into the application as I installed the new dll into the GAC.
The Name, version and Public key token is the same for both dlls. I think it won't matter as the i have uninstalled the previous dll and installed the new dll into the GAC.

Am I doing something wrong?? Please suggest a solution.

Thanks and Regards,
Mayur Mahajan

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

分分钟 2025-01-04 01:51:21

出于调试目的,我建议您对 dll 进行版本控制,然后将该版本打印到您的应用程序以确保其已更新。包含 System.Reflection 命名空间,代码将如下所示运行:

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

I would suggest for debugging purposes that you version your dll, then print the version to your application to be sure its being updated. Include the System.Reflection namespace and the code would run look like the following:

Assembly assembly = Assembly.LoadFrom("unknown.dll");
label.Text = assembly.GetName().Version.ToString();
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文