Click here to Skip to main content
15,899,474 members
Home / Discussions / C#
   

C#

 
QuestionXML Serialize Pin
ruanr10-Jul-07 22:47
ruanr10-Jul-07 22:47 
AnswerRe: XML Serialize Pin
WillemM11-Jul-07 0:33
WillemM11-Jul-07 0:33 
Questiontext editor Pin
Sebastian T Xavier10-Jul-07 22:35
Sebastian T Xavier10-Jul-07 22:35 
AnswerRe: text editor Pin
Colin Angus Mackay10-Jul-07 23:32
Colin Angus Mackay10-Jul-07 23:32 
AnswerRe: text editor Pin
Luc Pattyn10-Jul-07 23:34
sitebuilderLuc Pattyn10-Jul-07 23:34 
GeneralRe: text editor Pin
Sebastian T Xavier11-Jul-07 1:13
Sebastian T Xavier11-Jul-07 1:13 
AnswerRe: text editor Pin
mav.northwind11-Jul-07 8:45
mav.northwind11-Jul-07 8:45 
Questionhelp with strange bug re Activator.CreateInstance Pin
s0ren10-Jul-07 21:54
s0ren10-Jul-07 21:54 
Hello all,

I'm very frustrated with a bug that I can't seem to beat. I'm using Activator.CreateInstance to create an array of objects based on a sampleObject. Each instance of SampleObject contains a uniqueid which is generated randomly in the constructor. Something like this:

<br />
SampleObject sampleObject = new SampleObject();<br />
SampleObject[] array;<br />
<br />
<cut other stuff><br />
for (int i = 0; i < numberToCreate;i ++)<br />
   array[i] = Activator.CreateInstance(sampleObject.GetType());<br />
<br />
<cut rest of code><br />


Now, when I run this in the VS debugger it works fine and I get a proper batch of unique objects. However, when I run the code outside of VS, all the objects have the same uniqueid!

Anyone out there have any idea what is going wrong or more importantly how to fix it Confused | :confused:

TIA
AnswerRe: help with strange bug re Activator.CreateInstance Pin
Vikram A Punathambekar10-Jul-07 22:10
Vikram A Punathambekar10-Jul-07 22:10 
GeneralRe: help with strange bug re Activator.CreateInstance Pin
s0ren10-Jul-07 22:18
s0ren10-Jul-07 22:18 
GeneralRe: help with strange bug re Activator.CreateInstance Pin
Vikram A Punathambekar10-Jul-07 22:25
Vikram A Punathambekar10-Jul-07 22:25 
AnswerRe: help with strange bug re Activator.CreateInstance [solved] Pin
s0ren10-Jul-07 22:37
s0ren10-Jul-07 22:37 
GeneralRe: help with strange bug re Activator.CreateInstance [solved] Pin
Vikram A Punathambekar10-Jul-07 22:47
Vikram A Punathambekar10-Jul-07 22:47 
QuestionArrayList -> SortedList -> SortedList. Right ? Pin
Saikek10-Jul-07 21:49
Saikek10-Jul-07 21:49 
AnswerRe: ArrayList -> SortedList -> SortedList. Right ? Pin
Vikram A Punathambekar10-Jul-07 21:57
Vikram A Punathambekar10-Jul-07 21:57 
GeneralWhat do you mean ? Pin
Saikek10-Jul-07 22:04
Saikek10-Jul-07 22:04 
GeneralRe: What do you mean ? Pin
Vikram A Punathambekar10-Jul-07 22:19
Vikram A Punathambekar10-Jul-07 22:19 
GeneralRe: What do you mean ? Pin
Saikek10-Jul-07 22:28
Saikek10-Jul-07 22:28 
GeneralRe: What do you mean ? Pin
Vikram A Punathambekar10-Jul-07 22:33
Vikram A Punathambekar10-Jul-07 22:33 
GeneralRe: What do you mean ? Pin
J4amieC11-Jul-07 0:17
J4amieC11-Jul-07 0:17 
GeneralRe: What do you mean ? Pin
Sathesh Sakthivel11-Jul-07 0:21
Sathesh Sakthivel11-Jul-07 0:21 
QuestionHow to hold up some key on the keyset? Pin
jason_mf10-Jul-07 21:45
jason_mf10-Jul-07 21:45 
AnswerRe: How to hold up some key on the keyset? Pin
Martin#10-Jul-07 22:09
Martin#10-Jul-07 22:09 
GeneralRe: How to hold up some key on the keyset? Pin
jason_mf10-Jul-07 22:49
jason_mf10-Jul-07 22:49 
GeneralRe: How to hold up some key on the keyset? Pin
Martin#10-Jul-07 23:32
Martin#10-Jul-07 23:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.