title: How can I detect which version of Windows is running?
body: <p>I have an application which runs as a Word add-in. (VSTO).</p>
  
  <p>It runs on many PCs all over the world.  In certain cases I need to trouble shoot problems (obviously remotely) and have a reporting mechanism which tells me which Windows OS is running - I use <code>Environment.OSVersion</code> in .NET.  At least it did until Windows 10.</p>
  
  <p>There is an article on MSDN (<a href="https://msdn.microsoft.com/en-us/library/windows/desktop/dn481241%28v=vs.85%29.aspx?f=255&amp;MSPPError=-2147217396" rel="nofollow">Targeting your application for Windows</a>) about creating an application manifest which will enable the correct version to be returned.</p>
  
  <p>But my application is a DLL, not an EXE and so won't really accommodate the XML code referred to in that article.</p>
  
  <p>Is there no way to just ask Windows, "What version are you?  Really, I won't cry if you admit to the real version".</p>
  
  <p>Or an entry in the registry or something?</p>