Closed mosxl closed 6 years ago
I have checked ind now can confirm that the visibility of the button is not based on the config value but is computed at runtime according this algorithm:
public static bool IsVS2010PlusAvailable
{
get
{
using (var vs2010 = Registry.ClassesRoot.OpenSubKey("VisualStudio.DTE.10.0", false))
using (var vs2012 = Registry.ClassesRoot.OpenSubKey("VisualStudio.DTE.11.0", false))
using (var vs2013 = Registry.ClassesRoot.OpenSubKey("VisualStudio.DTE.12.0", false))
{
return (vs2010 != null || vs2012 != null || vs2013 != null);
}
}
}
Thus if you don't have VS2010-2013 installed then the button will not be visible.
Though I do think that the algorithm will need to be updated and also dedicated config value introduced. Starting from the next release the feature will be implemented as following:
public static bool IsVS2010PlusAvailable
{
get
{
using (var vs2010 = Registry.ClassesRoot.OpenSubKey("VisualStudio.DTE.10.0", false))
using (var vs2012 = Registry.ClassesRoot.OpenSubKey("VisualStudio.DTE.11.0", false))
using (var vs2013 = Registry.ClassesRoot.OpenSubKey("VisualStudio.DTE.12.0", false))
using (var vs2015 = Registry.ClassesRoot.OpenSubKey("VisualStudio.DTE.14.0", false))
using (var vs2017 = Registry.ClassesRoot.OpenSubKey("VisualStudio.DTE.15.0", false))
{
return (
Config.Instance.ShowOpenInVsAlways ||
vs2010 != null ||
vs2012 != null ||
vs2013 != null ||
vs2015 != null ||
vs2017 != null);
}
}
}
Thanks Oleg. I'll close the issue after it's released and tested. Looking forward to it.
Tested in 1.7.15.0, perfect : ) Close issue, thank you Oleg.
Environment: Visual studio 2017 Professional, and notepad++ 7.5.7, and using cs-script plugin 1.7.14.0.
Steps to reproduce:
Result: Cannot see the button "Open in VS" even "+openInVsBtn" is set in config file