简体   繁体   中英

Can my project reference an assembly targeting a lower version of .net framework?

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.

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.

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.

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

No it is not necessary REFERENCE ASSEMBLIES(and their dependencies) AND Your PROJECT TARGET the same version.

I think you got another issue for could not load project or assembly.

Keep in mind

1> Add all assembly which is missing

2> don't run 4.0 targeting project in 2008 or lower (don't run higher version project in lower version SDK)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM