Hi All, Can anyone help me out, how to detect if MSXML parser is installed on a machine or not. I looked for a registry entry,but unable to get one. I am writing a VB.NET application. Thanks in advance :)
views:
485answers:
4
A:
I would check if these files exists and check the version.
Or I would use this
Or maybe there is a better way?
Fredou
2009-12-22 12:27:42
Thanks for the reply. The 2nd option looks useful, but I am not getting how can I make use of this in VB.NET application. I want to execute this in background.
Vijay Balkawade
2009-12-22 12:41:30
A:
If possible, target MSXML 3.0. It's included in all Windows operating systems starting with Win2k SP4, so there's usually no need to check for it's presence.
Anyway, if you are using VB.NET, consider using the System.Xml namespace instead. It is part of the .net framework, which is needed by your VB.NET application anyway.
Heinzi
2009-12-22 12:53:36
Microsoft recommend targetting MSXML6 by default, with MSXML3 as the preferred fallback (this is the recommended advice in that blog entry you've linked to).
Chris J
2009-12-22 14:35:21
@Chris: Thanks for pointing that out! I can understand that MS wants people to use the new library, but, personally, if I do not *need* any of the MSXML6 features, I'd stick to MSXML3, since (a) MSXML6 is not pre-installed on WinXP, (b) WinXP is still in widespread use, and (c) this means I'd have to test and maintain *twice* the code (both the MSXML6 and the MSXML3 version).
Heinzi
2009-12-22 14:45:19
A:
tyranid
2009-12-22 13:09:26
ok.Please correct me, if I am getting it wrong. So, you mean to say, if any version of MSXML parser is installed on my machine, this code segment will create an instance. If MSXML parser is not installed on my machine it will not create an instance and will throw an exception.
Vijay Balkawade
2009-12-22 16:46:28
Yes, basically if in this case MSXML3 is not installed then you will get an exception. You can also choose different progids to select specific versions for test. You could just look for the progids in the registry as well (say HKCR\MSXML2.DOMDocument) but that will not necessarily prove that the DLL is correctly installed.
tyranid
2009-12-23 14:31:20
A:
One thing to notice is that The use of MSXML is not supported in .NET applications since the GC inside MSXML is not compatible with .Net framework.
Samuel Zhang
2009-12-30 08:54:39