You might typically get this when the control uses P/Invokes or device level funtionality not supported on the desktop - such as the WindowsCE assembly.
There are two ways to get around this problem:-
1. Add an .Xmta (Design Time Attributes) file to your project.
2. Add the DesktopCompatible(true) attribute to the user control.
The prefered method is to add an .xmta (Design Time Attributes) file to your assembly. This is because typically if you have a library of controls you won't need to keep using the DesktopCompatible attribute for every form that uses your control. In addition you can add comments for memebers that will show up in the designer when using an .xmta file. The xml schema should be as follows:
<?xml version="1.0" encoding="utf-16"?>
<Classes xmlns="http://schemas.microsoft.com/VisualStudio/2004/03/SmartDevices/XMTA.xsd">
<Class Name="Company.Mobile.Forms.PropertyHeader">
<DesktopCompatible>true</DesktopCompatible>
<Property Name="Description">
<Description>Displays the description of the parent forms function.</Description>
</Property>
</Class>
</Classes>
The above example would be used in a case where your user control's class was named: Company.Mobile.Forms.PropertyHeader.
2 comments:
Thanks for the tip ;)
Thanks, solved a problem that just popped up
Gus
Post a Comment