CodeGen for hexBinary

May 10, 2010 at 3:59 PM

Hi there,

I've just downloaded and installed the current version of Xsd2Code and I really like the tool. I've unfortunately run into a couple of issues: the fist one is that its not working with VS2010 which will hopefully be resolved soon. The second one is that its not generating the code I would expect for a hexBinary. I was expecting the backing store for this to be an integer and not a byte array, regardless of me being right or wrong the generated code is as follows:

this.myHexValueField = new byte[]();

Which results in the error:

Array creation must have array size or array initializer


Keep up the good work.




Jun 7, 2010 at 4:52 PM

I am seeing a similar with 'new byte[]();' lacking a size initializer, for a color 'aabbggrr' field.

(BTW, Mark, I would expect byte arrays, not int arrays, for a binary object.  byte is a defined size; int size might [in future] vary, like in C/C++ compilers on various platforms. Now if it used System.Int32, that would be more specific.]