使 Visual Studio 不关心 DLL 版本

发布于 2024-09-12 21:44:08 字数 205 浏览 4 评论 0原文

有没有办法让Visual Studio不关心dll版本?这是一个坏主意吗?

我正在重置我的开发机器,并且刚刚安装了最新版本的 Pex 和 Moles(版本 .92)。我所有的项目都是 .91 版本。

我们正处于发布过程中,现在不想升级。另外,我找不到 .91 版本的安装程序。

当我尝试编译时,我收到一条消息,指出我缺少参考。 (所以才有这个问题)

Is there a way to make visual studio not care about dll versions? Is this a bad idea?

I am resetting up my dev machine and I just installed the latest version of Pex and Moles (version .92). All my projects are on version .91.

We are in the middle of a release and don't want to upgrade right now. Also, I cannot find an installer to version .91.

When I try to compile I get a message that I am missing the reference. (Hence this question)

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

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

发布评论

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

评论(2

狠疯拽 2024-09-19 21:44:08

版本很重要。根据定义,每个发布的版本与下一个版本之间都有差异(或者不需要新版本)。如果您需要一个版本,但有另一个版本,您的程序可能无法正确执行。

这是 .NET 时代之前所谓的“DLL Hell”的一部分...如果您需要使用第三方组件(Crystal Reports Viewer 是我们一直必须处理的组件),您只需使用对用户 PC 上安装的任何版本的引用即可。我们的零售店必须拥有特定版本的 Crystal Reports 才能正确打印其簿记报告,因此,我们必须永远保留旧版本。在 PC 上升级 Crystal 会破坏供应商的簿记应用程序。在我的第一台电脑上,当我安装或升级另一台电脑时,有几个应用程序崩溃了。特别是,Real Player 破坏了我的电话答录机软件。像这样愚蠢的东西......

所以,版本很重要,即使它很烦人。这也是为什么我对第三方工具有偏见,因为我没有代码,也无法自己重新编译。

The version is important.. By definition, there is a difference from each released version to the next (or there would be no need for a new version). Your program may not perform correctly if you are expecting one version and instead have another.

This was a part of what was known as "DLL Hell" in the pre-.NET days... If you needed to use a third party component (Crystal Reports Viewer is one we always had to deal with), you would just use the reference to whatever installed version was on the user's PC. Our retail locations had to have a specific version of Crystal Reports for their bookwork reports to print correctly, and because of that, we had to hold on to an old version forever.. Upgrading Crystal on the PC broke the vendor's bookwork app. On my first ever PC, I had several applications break when I would install or upgrade another. In particular, Real Player broke my telephone answering machine software. Goofy stuff like that...

So, the version IS important, even if it is an annoyance. It's also why I have a bias against third party tools that I have no code for, and can't recompile myself.

渔村楼浪 2024-09-19 21:44:08

如果查看引用的 DLL 的属性,您将看到属性“特定版本”。如果将其设置为 false,则它不会跟踪项目文件中的特定版本。

为此,您必须以某种方式修复使用引用的地方。您可以通过打开每个解决方案并修复引用来完成此操作(此时您也可以将引用更新为正确的版本,并注意 David 的评论)。

如果您有很多解决方案,您可以使用像 sed 这样的工具(请参阅这篇文章,了解像这样的 Windows 版本的工具 是否有类似 sed 的 cmd.exe 实用程序)可以根据需要一次性更新项目文件。

If you look at the properties of a referenced DLL, you will see a property "Specific Version". If you set it false, it doesn't track the specific version in the project file.

For this to work, you have to somehow fix the references where ever they are used. You can do this by opening every solution and fixing the references (at which time you could also just update the references to the correct version, paying heed to David's comments).

If you have a lot of solutions, you might use a tool like sed (see this post for windows versions of tool like this Is there any sed like utility for cmd.exe) to just update the project files as needed all at once.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文