locked
DTE2.Solution.Create() and MRU list ? RRS feed

  • Question

  • Hi everyone!

    I'm working on a add-in which creates a solution and one or more projects based on user's input (iow some kind of wizard...).
    Everything is working fine except that the solution is never added to the MRU list ?

    I'm using DTE2.Solution.Create() and DTE2.Solution.SaveAs() in order to create the solution. Projects are created using Solution.AddFromTemplate().

    I couldn't find any API related to the MRU list. Apparently (from what I googled), there is not : everyone seems to hack the registry directly. Which doesn't work in my case, since VS write the registry when closing...

    Any ideas are welcome !

    Thanks for reading,
    Ludovic.
    Friday, May 16, 2008 11:09 AM

Answers

  • "I couldn't find any API related to the MRU list."
    Yes, going through the registry is the only way. The
    PowerCommands for Visual Studio 2008 has an command(
    Clear Recent Project List) can let you manipulate the projects MRU list. So you can check out it's implementation.

    And I tried add some reg value to the MRU list located at [HKCU\Software\Microsoft\VisualStudio\9.0\ProjectMRUList] while VS is running and they persist after VS restarts. Directly writing to the reg should work in this scenario and you can check it again, remember to call RegistryKey.Close() or RegistryKey.Flush() to commit the changes to the registry.

    Hope this helps!

    Thanks!
    Monday, May 19, 2008 5:18 AM