错误0054:默认值(System.Byte [])对二进制无效。 [英] error 0054: Default value (System.Byte[]) is not valid for Binary.

查看:50
本文介绍了错误0054:默认值(System.Byte [])对二进制无效。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将EDM公开为WCF数据服务。


当我将WCF数据服务作为服务引用添加到我的控制台应用程序时,我得到了跟随错误。


错误0054:默认值(System.Byte [])对二进制无效。值必须为 格式0x123,其中123代表十六进制数字的非空序列。


为该属性生成的元数据为...


  < 物业
名称 =" 版本 " 类型 =" Edm.Binary < span style ="color:#0000ff">"
Nullable
=" false " DefaultValue =" System.Byte [] "
p7:GetterAccess
=" 私人 " p7:SetterAccess =" 私人 "
/>


但我在EDM中为该属性提供了默认值"0x1" 并且该默认值仍未反映在元数据中。我在这里遗漏了什么吗?


谢谢,


Kowshik Palivela

解决方案

这是一个错误。我们已将其修复为将来的版本,但目前,解决此问题的唯一方法是从属性中删除默认值,至少暂时是为了能够添加服务引用。该错误特定于二进制
属性,因此其他类型的默认值应该有效。


谢谢,


Sarah


I am trying to expose a EDM as a WCF Data Service.

When I am adding a WCF Data Service as a Service Reference to my Console App I am getting the following error.

error 0054: Default value (System.Byte[]) is not valid for Binary. Value must be of form 0x123 where 123 stands for a non-empty sequence of hex digits.

The metadata that is generated for the property is as ...

 <Property Name="version" Type="Edm.Binary" Nullable="false" DefaultValue="System.Byte[]" p7:GetterAccess="Private" p7:SetterAccess="Private" />

But I gave a default value of `0x1`for that property in the EDM  and still that default value is not getting reflected in the metadata. Am I missing something here ?

Thanks,

Kowshik Palivela

解决方案

This is a bug. We have fixed it for a future release, but for now, the only way to get around this is to remove the default value from the property, at least temporarily in order to be able to add the service reference. The bug is specific to binary properties, so other types of default values should work.

Thanks,

Sarah


这篇关于错误0054:默认值(System.Byte [])对二进制无效。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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