Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.

mlsomers

Member Since 12 Sep 2013
Offline Last Active Feb 07 2016 12:55 AM
-----

#64730 NetMf bug? Assigning an array type (typeof(x[])) to an array entry

Posted by mlsomers on 10 January 2016 - 01:49 AM

I'm using a NetDuino Plus, but this also happens in the emulator:

 

If I do this:

Type myType = typeof(object[]);

it works fine, so I can instantiate a typeof(object[]).

 

Also assigning a non array type to an array is working:

Type[] myTypes = new Type[] { typeof(object) };

No problem here, but... assign the first example to that array, or:

Type[] myArrayTypes = new Type[] { typeof(object[]) };

and I get:

 

#### Exception System.Exception - CLR_E_WRONG_TYPE (1) ####
#### Message:

#### ...

 

Also doing it indirectly gives the same result:

Type myType = typeof(object[]);
Type[] myArrayTypes = new Type[] { myType }; // boem!

I'll find a way to work around this somehow, maybe using the type name instead, but I'm sure this must be a bug in netmf? Or am I missing something?




home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.