将 dll 编译为早期版本

发布于 2024-10-08 17:50:51 字数 148 浏览 0 评论 0原文

当我尝试运行在 Visual Studio 2010 中编译的 dll 时,收到以下消息:此程序集是由比当前加载的运行时更新的运行时构建的,无法加载。我猜是这样的意味着我的 Visual Studio 版本太新了。有没有办法可以将 dll 构建为早期版本?

When I try to run the dll I compiled in Visual Studio 2010, I get the following message: This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded. I'm guessing this means that I am a too recent version of Visual Studio. Is there a way I can build the dll as an earlier version?

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

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

发布评论

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

评论(1

后来的我们 2024-10-15 17:50:51

最终解决方案中的所有程序集(无论是 dll 还是 exe)、不同解决方案或同一解决方案中的所有程序集都必须以相同版本的 CLR 为目标。您可以通过在 2010 解决方案中配置定位来确保它们能够实现。

最有可能的是您的 dll 项目的目标是 4.0。将其恢复到 3.5 或更早版本,看看是否可以解决问题。

All assemblies in your final solution, be they dlls or exes, in different solutions or in the same one, must target the same version of the CLR. You can ensure they do by configuring targeting in your 2010 solution.

Most likely you're targeting 4.0 in your dll's project. Crank it back to 3.5 or earlier and see if that fixes the problem.

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