问题
I am adding on to an existing WPF Project, and am running into an odd error. My Toolbox is empty.
I am developing in a Windows 7 environment using Visual Studios 2008 run as Administrator. I have created a project from scratch, and the tools were there. However, when I load the existing project, there are no tools in the Toolbox. I do have an element in the UI selected.
I fixed this once by going into Tools -> Choose Toolbox Items... -> WPF Components. I then added the tools that I needed. After that, they remained for a while. However, I went to add a label this morning, and the toolbox was empty. I went back into Choose Toolbox Items, and all selections were cleared. I tried selecting the tools I needed again, but the Toolbox was still empty. When I go back into the Choose Toolbox Items, the items that I just selected have been unselected.
I have tried closing and opening the xaml window, restarting VS after selecting tools, resetting the Toolbox, and none of these things have worked this time. I know they are there and work, because I have used them before with this application. Does anyone know how to fix this issue?
Thank you for your help.
回答1:
Tools -> Options -> XAML Designer. Check "Enable XAML Designer". Restart VS.
回答2:
Try to reset the settings. In Visual Studio 2010 the way is Tools->Settings->Reset. In 2008 must be something like that.
来源:https://stackoverflow.com/questions/11904833/wpf-toolbox-empty