简体   繁体   中英

Making tool window show automatically on VS load

In my Visual Studio extensibility project, I'm attempting to make my tool window visible upon launch after package installation.

The dotneteers describe a way of doing this that involves adding the following line to the package header (ie MyPackage.VSPackage.cs):

[ProvideToolWindowVisibility(typeof(MyToolWindow), Microsoft.VisualStudio.Shell.Interop.UIContextGuids80.NoSolution)]

Unfortunately, this doesn't work. It seems that Visual Studio doesn't pay attention to the "NoSolution" tool visibility directive (I can confirm that it does work for some of the other enumeration items , like Debugging, but this doesn't fit my use case).

If there's no way to make this auto-show the tool window on VS load, has anyone come up with any alternate (ie novel :)) solutions?

Alternatively, you can try making you package as auto load using ProvideAutoLoad and once at the Initialize() try to create this tool window. Use the Package.FindToolWindow() method.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM