代码改变世界

安装Visual Studio 2008后建立WPF项目 不能在工具箱上拖曳工具/设计器报错

2008-04-09 09:48  Nicholas Yuen  阅读(1034)  评论(0编辑  收藏  举报
安装好VSTS2008后,新建一个WPF工程。想在工具上拖几个控件玩玩,竟然无法拖到设计器上面。
上MSDN查了一下。解决方法如下:

1. Exit Visual Studio

2. Navigate to your user profile directory for Visual Studio (this is found at %USERPROFILE%\AppData\Local\Microsoft\VisualStudio\9.0)

3. Delete the TBD files found there (they are often hidden files)

4. Re-start Visual Studio and open your WPF application - the toolbox should be automatically rebuilt (which can take a while depending on your machine's performance). You should now be able to drag/drop controls onto the design surface as you would expect.

Note also that the Toolbox only shows controls in RTM Visual Studio 2008 in the WPF designer when the Designer Pane is selected (not the XAML Pane). This behavior is likely to improve in a future SP or version.


参考:
http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=2746947&SiteID=1