Toolbox items missing.

Hi All,

I have a couple of DSLs that I am working on and something odd has started happening ... the Toolbox items disappear in what appears to be a random fashion (obviously it is not 'random', but I can't figure out why). This has not happened before and I have not made any significant changes recently.

Here is the situation:

I have two DSLs that are esentially unrelated, except that I open them both in Visual Studio at the same time. One of them opens fine and shows the Toolbox items (although I have noticed that it is occasionally reordering the Toolbox tabs). The other opens fine except that the Toolbox items are missing. Everything else with the DSL works well though (not a Package Load Key error).

I have verified that the correct registry entries are in place, and have tried resetting the Visual Studio Hive a number of times. What is really weird is that after some resets the Toolbox items appear again, only to disappear with the next load.

Do any of you have any idea what might be happening?

Thanks in advance.

[1131 byte] By [GrahamSibley] at [2008-1-7]
# 1

Hi,

Did you try resetting the toolbox by right clicking on it and execute "Reset Toolbox"? Another option you might want to try is to manually reset the toolbox by deleting the .tbd files from the following location.

%UserProfile%\Local Settings\Application Data\Microsoft\VisualStudio\8.0Exp\*.tbd

Hope this helps.

Edward

EdwardBakker at 2007-10-2 > top of Msdn Tech,Visual Studio,Visual Studio Extensibility...
# 2

Hi Edward,

I have tried resetting the toolbox to no avail, and deleting the .tbd files did not do the trick either. I have found that the only thing that brings the items back is to do a "devenv /rootSuffix Exp /resetuserdata", but that will only work for one session. The next time I load the environment they will be gone again.

Any other ideas?

GrahamSibley at 2007-10-2 > top of Msdn Tech,Visual Studio,Visual Studio Extensibility...
# 3

I realize that I didn't indicate in my initial post that the project type that is hosting the DSL is a custom project type. Is it possible that this somehow has an effect? Are the toolbox settings somehow related to the project?
GrahamSibley at 2007-10-2 > top of Msdn Tech,Visual Studio,Visual Studio Extensibility...
# 4

Hi All,

I have a custom project type that utilizes DSL files and I have been experiencing some odd behaviour that I am hoping you will be able to help with. I have posted a similar thread in the DSL forums in case this problem is DSL related.

When I load my hive environment for the first time, create an instance of my custom project, and add a DSL to it, everything works fine. When I close the hive and then reload it with the new project, the DSL toolbox items disappear. I have found that running the command: "devenv /rootsuffix Exp /resetuserdata" will bring back the toolbox items, but if I close and reload they will be missing again.

Do any of you know if this is somehow related to my custom project type rather than to the DSL itself?

Thanks in advance.

GrahamSibley at 2007-10-2 > top of Msdn Tech,Visual Studio,Visual Studio Extensibility...
# 5

I'm not sure why my VS Extensibility post got moved here, but in any case I have another update ...

I have figured out what was going on, and it's due to the toolbox tab names for my DSLs being the same. Listed below is some generated code that executes when the package is loaded (note that this code only runs in your development environment):

if (this.DesignTimeRunMode)

{

// Toolbar registration doesn't work well under design run mode as the toolbox needs to be reset

// Instead we'll dynamically zap and recreate our toolbox every time

// Regular users of the finished tool will get the toolbox setup in the perfectly normal way

this.SetupDynamicToolbox();

}

After disassembling the SetupDynamicToolbox I noticed that the code in that method is removing any tabs that have the same name as the tab for the DSL that it is currently loading. In essence, the DSL that loads last will keep all its toolbox items, but any DSLs (or other packages for that matter) that load before and have any matching tab names will lose the toolbox items from the matching tabs.

Hopefully this will be fixed in the future.

GrahamSibley at 2007-10-2 > top of Msdn Tech,Visual Studio,Visual Studio Extensibility...

Visual Studio

Site Classified