简体   繁体   中英

Can I use Windows Identity Foundation 3.5 with .NET 4.5?

I'm looking to build some reusable components for an SSO retrofit. Almost all of the applications are currently on .NET 3.5 or 4.0, however all new projects are being started on .NET 4.5.

I know a lot of WIF changed with .NET 4.5, so my question is: if I create some reusable components targeting WIF 4.0 that obfuscate the claims interactions, can the .NET 4.5 projects still use these components targeting the previous WIF framework?

(Note, I'm still a bit fuzzy on the version numbering but I believe WIF jumped directly from 1.0 to 4.5; AFAIK 1.0 was the stable version for both .NET 3.5 & 4.0 previous to the .NET Framework 4.5 release.)

Before .NET 4.5, all WIF types lived in out-of-band namespaces/assemblies which have now been moved into the core framework. So in .NET 4.5, you can certainly reference the WIF 1.0 assemblies and work with both sets of types simultaneously; you just need to watch out for namespace collisions when you reference them.

Actually, using WIF 1.0 assemblies from .NET 4.5 is the only recommended way to do things that involve WIF classes which have been made internal in .NET 4.5 (some certificate- & cryptography-related classes).

I would recommend building your reusable components to a common interface, and providing a different implementation for .NET 3.5/4.0 (using WIF 1.0) and .NET 4.5 (using WIF 4.5) (total of 3 assemblies).

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