I think I've identified the metadata that causes this issue.
When using the VS2005 style, the Microsoft.Help.Category attribute has the following value in each generated HTML file:
<meta name="Microsoft.Help.Category" content="DevLang:CSharp">
When using VS2010 it has the following value instead:
<meta name="Microsoft.Help.Category" content="DevLang:C#">
To verify I manually unzipped an .mshc file generated with the VS2010 style, changed the attribute value to
"DevLang:CSharp", and then reinstalled the help collection. This did the trick - I was able to F1 from Visual Studio and have the correct page load up in the viewer.
I couldn't work out where this attribute was getting set... the only reference to it that I could find was an XSLT copy from
/document/metadata/attribute[@name='Category'] in metadataHelp30.xsl. I'm not familiar with how SandCastle builds help files, but I was wondering where this attribute is set. Is it before the presentation style gets applied?
For now I am planning on a work around by doing a post-processing step to make this change on all the generated files.
PS I am using SHFB.