471,066 Members | 1,195 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,066 software developers and data experts.

Cannot initialize array of chars (System.TypeLoadException)

DC
Hi,

I am programming a windows service and all went well until I needed to
use a simple array of chars which I initialize like this:

char[] test = new char[2] {'\x002F', '\x005E'};

Immediatly upon starting the service with this line in code (long
before this line is even being used) I get a System.TypeLoadException
which I cannot debug since it seems to happen somwhere deep in the
..Net dust.

Any clue? Thanks for any suggestion,

Regards

DC
Nov 15 '05 #1
1 4571
DC
Thanks Tu-Thach! Although your syntax is only a short form of the
declaration (if the online help is right), it does not produce the
exception. BTW:

char[] test = new char[2] {'\x002F', '\x005E'};

and

char[] test = new char[] {'\x002F', '\x005E'};

both produced the typeloadexception.

Best regards

DC

"Tu-Thach" <tu*****@yahoo.com> wrote in message news:<0f****************************@phx.gbl>...
char[] test = {'\x002F', '\x005E'};

Tu-Thach
-----Original Message-----
Hi,

I am programming a windows service and all went well

until I needed to
use a simple array of chars which I initialize like this:

char[] test = new char[2] {'\x002F', '\x005E'};

Immediatly upon starting the service with this line in

code (long
before this line is even being used) I get a

System.TypeLoadException
which I cannot debug since it seems to happen somwhere

deep in the
..Net dust.

Any clue? Thanks for any suggestion,

Regards

DC
.

Nov 15 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by JC | last post: by
8 posts views Thread by intrepid_dw | last post: by
15 posts views Thread by Geoff Cox | last post: by
1 post views Thread by Tom | last post: by
51 posts views Thread by Pedro Graca | last post: by
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.