Search code examples
compact-frameworkdesignermobile-devices

The type 'Microsoft.CompactFramework.Design.UnsafeControl' has no property named


I get this error when opening the design view of a form that has a Honeywell DecodeControl on it (for a Honeywell barcode scanner - Dolphin 6100 if anyone is interested).

I've googled this to death and done the following:

added an XMTA file with this in it:

<?xml version="1.0" encoding="utf-16"?>
<Classes xmlns="http://schemas.microsoft.com/VisualStudio/2004/03/SmartDevices/XMTA.xsd">
  <Class Name="Honeywell.DataCollection.WinCE.Decoding.DecodeControl">
    <Description></Description>
    <DesktopCompatible>true</DesktopCompatible>
    <DesignTimeVisible>true</DesignTimeVisible>
  </Class>
</Classes>

Set said XMTA's Build Action to 'none'

Ignoring the first error still gives me an 'Object reference not set to an instance of an object'.

This didn't help at all.

After some lengthy googling, this appears to be to do with controls that are device-specific, and this error is supposedly to stop anything that might cause instability in the designer...except that this control has been working quite happily in the designer all day at work, then when I get home it throws this at me. Nothing has changed - same dev machine, same device, same project, same code as when I last saved it at work.

I'm not even trying to debug the device on the desktop or an emulator - I have the device plumbed in via USB cradle.

Literally the only thing that's changed is that the dev machine is connected to my home network by wireless instead of the CAT5 to work's network. And I can't see that being even remotely related to this.

On a more related note, the control in question never showed up in the toolbox after I did Choose Items -> check the control. Not sure if this is related.

Can anyone shed any light?

I can post the designer code if necessary.

Thanks


Solution

  • Turns out I was targeting the wrong framework for the device - VS decided of it's own volition that I needed to target 3.5 instead of 2.0. Switched it back and all is well.