Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best way to detect if WIF runtime is installed

Tags:

c#

asp.net

wif

A few pages of my ASP.Net app connect directly to another service using WIF. WIF is just making inroads here, and while it is installed on the Test and Production servers, every time a new programmer or tester gets latest and happens to hit those pages without the WIF run-time installed on their machine, he gets a YSOD and an error about not finding Microsoft.IdentityModel ... which they don't ever read and instead fire off an IM telling me my app is broken.

I'd like to detect if the WIF runtime is installed and show a every helpful error message and link to the download page if not. I don't want to check for a specific .dll path as this might change... and there are already different paths for 3.5 and 4.0.

Is there a best way to detect if the WIF run-time is installed?

(obviously in a page that doesn't reference it already... which would not display correctly without it installed)

Edit

It looks like WIF is included in the framework with 4.5 so a 3.5/4.0 specific approach would be fine. It won't be necessary to be future-proof.

like image 388
DanO Avatar asked Aug 07 '12 20:08

DanO


1 Answers

Official comment of microsoft:

Q: Under what registry key is WIF installed?
A: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WindowsIdentityFoundation\setup\v3.5\.

Reference here

like image 195
dmitry gilyaev Avatar answered Sep 28 '22 03:09

dmitry gilyaev