为什么 .net 4.0 项目不能引用 4.5 程序集? [英] Why cant a .net 4.0 project reference a 4.5 assembly?

查看:39
本文介绍了为什么 .net 4.0 项目不能引用 4.5 程序集?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个针对 .NET 4.0 的项目,现在我需要引用一个针对 .NET 4.5 构建的第三方 dll.似乎visual studio不接受?为什么?VS 显示当前上下文中不存在 dll 名称.

I am working on a project targeting .NET 4.0 and now I need to reference a third party dll which was built targeting .NET 4.5. It seems that visual studio does not accept that? Why? VS shows me that dll name does not exist in current context.

推荐答案

因为您引用的是更高版本.Microsoft 可以向后兼容,但不能未来兼容".您需要将整个项目转换为更高版本,以便能够使用该二进制文件.

Because you are referencing to the higher version. Microsoft can be backcompatible, but not "future compatible". You need to convert your entire project to higher vesion, in order to be able to use that binary.

不知道你说的是什么技术,但如果是 asp.net,请考虑在 vNext 中你可以在服务器上部署你自己的云 clr 版本.因此,您可能有 2 个版本的应用,一个针对 4.5,另一个针对 4.0.

Don't know what tecnology you are talking about exactly, but if that asp.net, consider that in vNext you are able to deploy your own version of the cloud clr on the server. So you may have 2 versions of your app, one targetting 4.5, other 4.0.

介绍 vNext.重复,如果这与您有关.

Introducing vNext. Repeat, if this concerns you.

这篇关于为什么 .net 4.0 项目不能引用 4.5 程序集?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆