Can .NET v3.5 assembly reference .NET v4.5 assembly?

Viewed 50

I have a .NET assembly built in v3.5, and i want that this assembly may reference a .NET assembly built in v4.5. Is this possible? If not, is there any workaround?

Example: v3.5 => v4.5 (v3.5 references v4.5)

Tks

1 Answers

I have a .NET assembly built in v3.5, and i want that this assembly may reference a .NET assembly built in v4.5. Is this possible?

No.

If not, is there any workaround?

Any of the following might work:

  • Get the source code of the library and try to backport it to v3.5.
  • Upgrade your .NET assembly to v4.5.
  • Create a small v4.5 exe whose only purpose is to host your v4.5 library. Your v3.5 application can remote-control your v4.5 exe via named pipes, WCF or any other inter-process communication protocol supported by both .NET 3.5 and 4.5.

(We actually implemented the latter approach in a .NET 3.5 project that needed to use a hardware device whose .NET "driver library" was only available as .NET 4. Fortunately, a short time later we got clearance to upgrade the whole project to 4.8, use the library directly and throw away this "out-of-process proxy".)

Related