title: How to add a new file association to Visual Studio?
body: <p>(Windows XP, Visual Studio 2010 Express (Web Developer))</p>
  
  <p>I would like to add various file types to open in Visual Studio that it does not open by default, namely <code>.js</code>, <code>.html</code>, <code>.shtml</code>, <code>.css</code>, etc.</p>
  
  <p>I tried looking for UI inside Visual Studio to add new file types, but I couldn't find anything, so I tried the naive approach of right clicking on the file -> Open With -> Choose Program -> Browse -> <code>c:\program files\Microsoft Visual Studio 10.0\Common7\IDE\VWDExpress.exe</code>. This almost works, except it starts a new instance of the IDE rather than opening a new tab the way <code>.cs</code> files do.</p>
  
  <p>I've tried to go registry diving, exported the association for <code>.cs</code> files, and changing it to point to <code>.shtml</code> (for example), but this still spawns new windows.</p>
  
  <pre><code>Windows Registry Editor Version 5.00
  
  [HKEY_CLASSES_ROOT\.shtml]
  "Content Type"="text/plain"
  "PerceivedType"="text"
  @="VWDExpress.cs.10.0"
  
  [HKEY_CLASSES_ROOT\.shtml\OpenWithProgids]
  "VSTA.cs.9.0"=""
  "VWDExpress.cs.9.0"=""
  "VWDExpress.cs.10.0"=""
  
  [HKEY_CLASSES_ROOT\.shtml\OpenWithProgids\Shared]
  @="Shared key to keep this from being removed with install/uninstall of side-by-side components."
  
  [HKEY_CLASSES_ROOT\.shtml\PersistentHandler]
  @="{5e941d80-bf96-11cd-b579-08002b30bfeb}"
  </code></pre>
  
  <p>I strongly suspect that doing this is the wrong way to go about this, but I can't find a better solution. Is there one? </p>