Wednesday, March 26, 2008

I'm running a dll from .net 2.0, and it runs fine. I load it into a .Net 3.0 program, and boom it fails --- on a basic switch statement it takes the wrong branch. I can set breakpoints, verify values/equality in the immediate window, all is fine. It just chooses to run the wrong branch. Very disturbing.

For the record here is the code that is failing, maybe I'm just not spotting something obvious.

switch (curTag) // value is TagType.RemoveObject2
{
	case TagType.RemoveObject: // *** takes this branch
		ControlTags.Add(new RemoveObjectTag(r)); 
		break;

	case TagType.RemoveObject2:
		ControlTags.Add(new RemoveObject2Tag(r));
		break;
		
// from the immediate window:

curTag == TagType.RemoveObject
false
(int)curTag
28
(int)TagType.RemoveObject2
28
(int)TagType.RemoveObject
5
curTag == TagType.RemoveObject2
true

Not sure what to say here, I keep thinking it is something stupid, but it is the same dll both times (runs fine from a .net 2.0 program that refs the same dll, and parses the same swf file, and even uses the same code to do that). Maybe they just aren't meant to run together? Hmm...

posted @ 1:16 AM | Feedback (2)

Blog Stats

  • Posts - 120
  • Stories - 1
  • Comments - 389
  • Trackbacks - 47

.Net Blogs

01101 Blogs

Flash Blogs

Graphics

People