473,398 Members | 2,368 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 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 4680
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: JC | last post by:
hi i want to check a char in the char array public void characters(char chars, int start, int length) { if (chars!='/n' || chars((char)'/r')) { System.out.println("String read is " + new...
8
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- ...
1
by: Betty | last post by:
When marshalling a char array in a structure from C to .NET, I get the following error: System.ArgumentException: Type could not be marshaled because the length of an embedded array instance does...
8
by: intrepid_dw | last post by:
Hello, all. I've created a C# dll that contains, among other things, two functions dealing with byte arrays. The first is a function that returns a byte array, and the other is intended to...
0
by: Dmitry Shuklin | last post by:
I make __value type with some private fields. I want to implement System.ISerializable for custom serialization public __value struct NativeHandle : public...
15
by: Geoff Cox | last post by:
Hello, Can I separately declare and initialize a string array? How and where would I do it in the code below? It was created using Visual C++ 2005 Express Beta 2 ... In C# I would have ...
1
by: Tom | last post by:
Having some trouble with my assembly running another assembly, and I am starting to suspect this may be a windows bug or a framework bug. Everything works fine on my development workstation (XP...
51
by: Pedro Graca | last post by:
I run into a strange warning (for me) today (I was trying to improve the score of the UVA #10018 Programming Challenge). $ gcc -W -Wall -std=c89 -pedantic -O2 10018-clc.c -o 10018-clc...
4
by: setiarakesh | last post by:
I have designed a socket Server and developed asynchronous server . It is working fine with 60 Clients which are connecting to ths Server running at Machine (2 GB RAM and OS is Windows 2003...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.