Upgrade for Visual Studio 2010

Sep 25, 2012 at 7:50 PM

First of all current add-in that was compiled under VS 2008 could be used also in VS 2010. To use it you should copy ScriptOutline.AddIn and ScriptOutline.dll into 

C:\Users\<youruser>\Documents\Visual Studio 2010\Addins

and then change in ScriptOutline.AddIn row <Version>9.0</Version> to

<Version>10.0</Version>

It makes this add-in visible for VS 2010.

But there is one annoyed thing: when you run the add-in that is click on Tools/Add-In manager and in the list check "Script outline" you get an error message 

Object reference not set to an instance of an object

and then one other message. After that the script outline window is opened and you could use it. To remove these error messages you should recompile the source code (in VS 2008 or 2010) with the following change:

 public void BuildFunctionsList()
        {
            AllDocument = new ArrayList();
            if (m_dte != null)
                if (m_dte.ActiveWindow.Document != null)
                    _FileFullName = m_dte.ActiveWindow.Document.FullName;
                else
                {
                    trvScript.Nodes.Clear();
                    return;
                }
            else
            {
                trvScript.Nodes.Clear();
                return;
            }
            _DocumentFileExtension = Path.GetExtension(_FileFullName);
            ReadDocument(_FileFullName);
            ParseDocument();
            AllDocument.Clear();//release memory of this ArrayList
            BuildSortedTree();
        }