基于ApplicationSpecific为自定义类生成XSD [英] Generate an XSD for a custom class based on ApplicationSpecific

查看:74
本文介绍了基于ApplicationSpecific为自定义类生成XSD的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


尝试使用xsd.exe为我们创建的类生成xsd时出现故障。从仅包含已剥离的测试类的dll生成仍然返回"Microsoft.Health.HealthRecordItemKey无法序列化,因为它不具有无参数构造函数的
。"所以它似乎是ApplicationSpecific继承的基础,尽管我们的类和ApplicationSpecific都有无参数构造函数。


我们有很多开发经验,只是在构建复杂的HealthVault时没有太多 - 基于类,所以解决方案可以是"noob"。这个特定领域的错误。


您是否看到并解决了这个问题?


感激不尽的任何指导。


谢谢。


PS我们已经阅读了Eric G关于课堂建设的帖子,所以任何
的回复都指出我们没有太多的帮助。

解决方案

嗨Dramacrat,


我不熟悉xsd.exe工具,所以我对它的原因无能为力,但是什么(报告的错误)几乎都说明了。



ApplicationSpecific类派生自HealthRecordItem,它具有HealthRecordItemKey类型的私有成员,实际上并没有定义无参数构造函数。如果你有SDK源可以创建SDK的私有版本,并修改有问题的
类,允许该工具运行。我不认为这样的改变会影响输出,使其无法使用。



-Sean


Hi,

We get a failure when trying to use xsd.exe to generate an xsd for a class we have created. Generating from a dll containing only a stripped down test class still returns "Microsoft.Health.HealthRecordItemKey cannot be serialized because it does not have a parameterless constructor." so it seems to be fundamental to the inheritance of ApplicationSpecific even though both our class and ApplicationSpecific do have parameterless constructors.

We have loads of dev experience, just not a lot in building complex HealthVault-based classes so the solution could be a "noob" error in this specific area.

Have you seen and overcome this problem?

Any guidance gratefully received.

Thanks.

P.S. We have read Eric G's posts on class construction so any responses that only point us there won't be a lot of help.

解决方案

Hi Dramacrat,

I am not familiar with the xsd.exe tool, so I can't help much with the why, but the what( the error being reported ) pretty much says it all.

The ApplicationSpecific class derives from HealthRecordItem which has a private member of type HealthRecordItemKey that, in fact does not define a parameterless constructor. If you have the SDK source could create a private build of the SDK, and modify the class in question, allowing the tool to run. I would not think that such a change would impact the output so much as to make it unusable.

-Sean


这篇关于基于ApplicationSpecific为自定义类生成XSD的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆