After starting a desktop program, found a form cfdata=null, the execution of an error, but at the time of initialization, I was clearly cfdata=new cfdata (), why this error occurs.
I started tracking and found that when execution Cfdata=new cfdata (), execution was interrupted, the following code was not executed, but VS2010 did not error, that is, execution to Cfdata=new Cfdata () was wrong! But VS2010 didn't prompt me!
To continue debugging tracing, the problem occurs with the following code that uses the value of the member of the Unassigned tuple<t1,t2>, and VS2010 does not catch the error prompt me:
Publictuple<string,string,string>spath; PublicPersonall () {stringSA = ME. Rnowfolder (1,1); stringSB =ZCspathasm20150407; //There is no assignment to the spath, it uses its member value, so it must be wrong, but the VS2010 is not an error, but the execution terminates here, so that the object cannot be instantiated, and the object containing the Personall instance cannot be instantiated. The outermost cfdata cannot be instantiated, so although Cfdata=new Cfdata () is executed, cfdata remains null. stringsc = spath.item1 +spath.item2; Spath=Newtuple<string,string,string>(SA, SB, SC); }
It's just weird, string sc = spath.item1 + spath.item2; Since the value of the unassigned member is used here, why is the VS2010 execution here not to give a hint, if the prompt, then I know the first step where the error, and do not have to step-to-step debugging to find , perhaps, tuple as a new class, there are still some small problems not perfect it!
VS2010 environment. A small bug problem with tuple<t> in NET4.0