.NET (295) administrative (41) Ajax (42) AngularJS (2) ASP.NET (144) bicycle (2) books (180) browser (8) C# (133) cars (1) chess (28) CodePlex (10) Coma (8) database (47) deployment (3) Entity Framework (2) essay (111) flash/shockwave (2) flex (1) food (3) friend (2) game (20) idea (5) IIS (8) javascript (82) LInQ (2) Linux (6) management (4) manga (42) misc (671) mobile (1) movies (91) MsAccess (1) murder (2) music (64) mysql (1) news (99) permanent (1) personal (68) PHP (1) physics (2) picture (307) places (12) politics (13) programming (503) rant (120) religion (3) science (43) Sharepoint (3) software (58) space (1) T4 (2) technology (11) Test Driven Development (4) translation (2) VB (2) video (97) Visual Studio (44) web design (46) Windows API (8) Windows Forms (3) Windows Server (5) WPF/Silverlight (63) XML (11)

Wednesday, June 10, 2009

Problems with adding user controls to the Visual Studio toolbox

So, I had just wasted a long time being stupid about a user control, but I had finally fixed everything and I was willing to try it out. Initially I had tested it by directly entering it in XAML, but now I wanted to add it to the toolbox and drag and drop it to the WPF form.

First I got an error like "The following assemblies are installed SDK assemblies but could not be shown in the customize toolbox dialog because they are missing one or more components. Please make sure that all necessary libraries are available:" and then Microsoft.Ink.dll. It didn't seem to do anything bad, but I googled it anyway. It seems that a lot of people had this problem. The only solution was to actually close Visual Studio and then open it again. Other people reported more complicated issues like Visual Studio suddenly closing or showing a lot more libraries and doing it every time. This could help in that case: 363321. Choose Items in Toolbox causes Visual Studio 2008 SP1 to crash.
It also may be linked to the Visual Studio 2008 SDK, which I had recently installed.

Anyway, after that problem was solved, I proceeded on loading my WPF user control library by clicking Choose Items on a new Visual Studio toolbox tab and then browsing the DLL. Boom! "There are no components in 'something.dll' that can be placed on the toolbox.". That is because you must FIRST select the WPF Components tab in the Choose Items dialog, THEN click Browse. If you have Visual Studio 2005 you are out of luck, you don't even have the WPF components tab and the only way to do it is use the XAML editor.

No comments: