类型“Microsoft.CompactFramework.Design.UnsafeControl”;没有名为的属性

发布于 2024-10-15 03:28:27 字数 1080 浏览 2 评论 0原文

当打开带有 Honeywell DecodeControl 的表单的设计视图时,我收到此错误(对于 Honeywell 条码扫描仪 - Dolphin 6100,如果有人感兴趣的话)。

我已经用谷歌搜索了这个并完成了以下操作:

添加了一个包含以下内容的XMTA文件:

<?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>

将所述XMTA的构建操作设置为“无”

忽略第一个错误仍然给我一个“对象引用未设置为对象的实例” 。

这根本没有帮助。

经过一番长时间的谷歌搜索后,这似乎与特定于设备的控件有关,并且这个错误应该会阻止任何可能导致设计器不稳定的事情......除了这个控件在设计器中工作得非常愉快之外一天上班,然后当我回到家时,它就把这个扔给我。一切都没有改变 - 与我上次在工作中保存时相同的开发机器、相同的设备、相同的项目、相同的代码。

我什至没有尝试在桌面或模拟器上调试该设备 - 我已通过 USB 底座连接该设备。

从字面上看,唯一改变的是开发机器通过无线连接到我的家庭网络,而不是通过 CAT5 来连接工作网络。我看不出这与此有任何关系。

更相关的是,在我执行“选择项目 ->”之后,相关控件从未出现在工具箱中。检查控制。不确定这是否相关。

任何人都可以阐明吗?

如果需要的话我可以发布设计师代码。

谢谢

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

诗酒趁年少 2024-10-22 03:28:27

事实证明,我针对的设备框架是错误的 - VS 自行决定我需要针对 3.5 而不是 2.0。切换回来一切都很好。

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.

囚我心虐我身 2024-10-22 03:28:27

我遇到了这个错误,但它是由我在表单中使用 MessageBeep API 引起的。尽管此表单与我的用户控件或组件没有任何关系,但仅在表单中引用 Interop 命名空间就会损坏我的应用程序中的每个控件,并且无法在设计器中查看它们。

这个故事的寓意是不要在 CE (PInvoke) 中使用 Interop。

那太可怕了。只是提醒任何其他不幸的人试图发出蜂鸣声。

I ran into this error but it was caused by my playing around with the MessageBeep API in a form. Even though this form was not related in any way to my user controls or components, just having that reference to the Interop namespace in a form corrupted every control in my application and made it impossible to view them in the designer.

The moral of the story is DON'T USE Interop IN CE (PInvoke).

That was scary. Just a heads up for any other unfortunate soul trying to make a Beep sound.

月朦胧 2024-10-22 03:28:27

我在 VS2102 和 WEC2013 中也遇到同样的问题。

无需 P/Invoke,但具有自定义控件,完全托管的 .net 代码。
问题是我的自定义控件的枚举属性。
还没有解决方案。

I've the same problem in VS2102 with WEC2013.

And without P/Invoke but with a custom control, entirely managed .net code.
The problem is the Enum properties of my custom control.
And NO solution yet.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文