Problem: In my Silverlight training class, we were instructed to try using a TabControl in a newspaper Silverlight app. I followed part of the instructions to add the Assembly as an xmlns reference in the page code, but I couldn’t get the sucker to compile.
Here’s the line of code I added to the page:
xmlns:my=”clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls”
It was giving me this error:
The type or namespace name ‘TabControl’ does not exist in the namespace ‘System.Windows.Controls’ (are you missing an assembly reference?)
Solution: (Big forehead slap) Every single time I try to get back into .NET code, I keep having to learn this ridiculously, embarrassingly simple lesson: for whatever reason, when I add a reference to a .NET assembly in my code, I also have to add a reference to the References tree in the Solution Explorer:
- In the Solution Explorer, browse to the Project where this code is failing
- Right-click the References folder, choose Add Reference, and add System.Windows.Controls from the .NET tab
Hi there! glad to drop by your page and found these very interesting and informative stuff. Thanks for sharing, keep it up!
LikeLike