c# 4.0 - Silverlight 4 WScript.RegRead failing to read newly added value in registry under Windows 7 -


i have silverlight 4 application in can read existing registry values hklm branch no problem if add new value read fails filenotfoundexception. can see in code below; first read works fine second 1 fails read test value added in registry.

note: able read newly added key under windows xp; not under windows 7.

any appreciated.

if (application.current.installstate == installstate.installed && application.current.haselevatedpermissions) {     if (automationfactory.isavailable)     {         dynamic shell = automationfactory.createobject("wscript.shell");          try         {             var resa = shell.regread(@"hklm\software\microsoft\.netframework\installroot");             var resb = shell.regread(@"hklm\software\microsoft\.netframework\test");              var regvalue = shell.regread(dbtyperegkeyname);             var dbtype = extractdbtypefromid(regvalue);         }         catch (filenotfoundexception filenotfoundexception)         {             throw new exception(string.format("failed read registry value '{0}' error '{1}'.", dbtypevaluename, filenotfoundexception));         }     } } 

worked okay under 32 bit version of windows. turns out 64 bit version of windows has different view of registry. adding key under wow6432node key in registry solved problem.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -