我的项目可以引用面向较低版本 .net 框架的程序集吗? [英] Can my project reference an assembly targeting a lower version of .net framework?

查看:25
本文介绍了我的项目可以引用面向较低版本 .net 框架的程序集吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 .net 平台上的时间不长.不到 2 个月.我有这个无法从程序集中加载类型 blah.blah.blah.

I'v not been too long on the .net platform.less than 2months. I'm having this "could not load type blah.blah.blah from assembly blah.

所以我一直在与多种资源进行斗争,包括此处差异帖子中的建议.仍然没有运气.但最接近的建议似乎表明某些参考文献可能针对较低版本的 .net.实际上,有许多针对不同版本的引用,在其中一些引用中,还有更多可能针对不同版本的依赖程序集.

So i'v been battling it with several resources including the suggestions in diff post here.Still no luck. but the closest suggestion seems to indicate that some of references might be targeting a lower version of .net. Actually there are many many references targeting different versions and within some of this references there are many more dependent assemblies that possibly are targeting diff versions.

我一直在努力转换一些我使用 VS 2010(.net 4.0) 拥有源代码的程序集,整个过程几乎让我不知所措.

i'v been struggling to convert some of the assemblies i have the source using VS 2010(.net 4.0) and the whole stuff is almost overwhelming me.

所以我很沮丧地问:我的参考组件(及其依赖项)和我的项目目标必须是相同的版本吗?

And so i'm asking in frustration: MUST MY REFERENCE ASSEMBLIES(and their dependencies) AND MY PROJECT TARGET the same version?

推荐答案

只要库的目标版本是 <= 您的代码所需的版本,那就没问题.请注意,当然,任何行为更改都可能导致细微的错误,但这种情况很少见 - 基本上它应该可以正常工作.

As long as the libraries target a version that is <= the version your code wants, then that is fine. Note, of course, that any behavior changes could cause subtle bugs, but this is rare - fundamentally it should work ok.

如果库针对更高版本:坏事.

If the libraries target a higher version: bad things.

我怀疑有关特定无法从程序集 blah 加载类型 blah.blah.blah"的更多上下文.会很有用.

I suspect more context about the specific "could not load type blah.blah.blah from assembly blah." would be useful.

这篇关于我的项目可以引用面向较低版本 .net 框架的程序集吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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