Debugger not showing dictionary during binary serialization

When I am in the debugger and I step into the DataContext serialization constructor the _regionsDictionary has a count of zero. However, in main program Deserialize method (Program.Deserialize()) the DataContext has the proper items.  Why is the debugger
showing no objects in the DataContext(Serialization info, StreamingContext context) constructor?
class Program
static void Main(string[] args)
Serialize();
Deserialize();
static void Serialize()
var appContext = new DataContext();
List<IShapeRegion> rectRegions = new List<IShapeRegion>();
rectRegions.Add(new RectangleRegion(5, 3));
rectRegions.Add(new RectangleRegion(2, 2));
appContext.Insert("RectangularRegions", rectRegions);
FileStream fs = new FileStream("DataFile.dat", FileMode.Create);
BinaryFormatter formatter = new BinaryFormatter();
try
formatter.Serialize(fs, appContext);
catch (SerializationException e)
Console.WriteLine("Failed to serialize. Reason: " + e.Message);
throw;
finally
fs.Close();
static void Deserialize()
DataContext context = null;
FileStream fs = new FileStream("DataFile.dat", FileMode.Open);
try
BinaryFormatter formatter = new BinaryFormatter();
context = (DataContext)formatter.Deserialize(fs);
catch (SerializationException e)
Console.WriteLine("Failed to deserialize. Reason: " + e.Message);
throw;
finally
fs.Close();
var rectangularRegions = context.GetRegionByName("RectangularRegions");
foreach (var region in rectangularRegions)
Console.WriteLine(region.ToString());
[Serializable]
public class DataContext : ISerializable
private Dictionary<string, List<IShapeRegion>> _regionsDictionary;
public DataContext()
_regionsDictionary = new Dictionary<string, List<IShapeRegion>>();
public void Insert(string regionName, List<IShapeRegion> regions)
_regionsDictionary.Add(regionName, regions);
public List<IShapeRegion> GetRegionByName(string regionName)
var regions = _regionsDictionary.FirstOrDefault(x => x.Key == regionName).Value;
return regions;
public void GetObjectData(SerializationInfo info, StreamingContext context)
info.AddValue("RegionsDictionary", _regionsDictionary);
protected DataContext(SerializationInfo info, StreamingContext context)
SerializationInfoEnumerator e = info.GetEnumerator();
while (e.MoveNext())
switch (e.Name)
case "RegionsDictionary":
_regionsDictionary = (Dictionary<string, List<IShapeRegion>>)e.Value;
break;
public interface IShapeRegion
double Area();
[Serializable]
public class RectangleRegion : IShapeRegion, ISerializable
private double _length_in;
private double _width_in;
public RectangleRegion(double length_in, double width_in)
_length_in = length_in;
_width_in = width_in;
public double Area()
return _length_in * _width_in;
public void GetObjectData(SerializationInfo info, StreamingContext context)
info.AddValue("Length", _length_in);
info.AddValue("Width", _width_in);
protected RectangleRegion(SerializationInfo info, StreamingContext context)
SerializationInfoEnumerator e = info.GetEnumerator();
while (e.MoveNext())
switch (e.Name)
case "Length":
_length_in = Convert.ToDouble(e.Value);
break;
case "Width":
_width_in = Convert.ToDouble(e.Value);
break;
public override string ToString()
return String.Format("Rectangle: Length = {0}, Width = {1}", _length_in, _width_in);

According to one article, the deserialization operation is a complex process which is not always well documented.
Try this workaround:
case
"RegionsDictionary":
_regionsDictionary = (Dictionary<string,
List<IShapeRegion>>)e.Value;
_regionsDictionary.OnDeserialization( this);
break;
By the way, it is not always necessary to implement ISerializable. For example, if you simplify
RectangleRegion removing ISerializable and two special serialisation members, then it will work too.

Similar Messages

  • Crystal Report not showing up during deployment for CRVS2010

    Hi,
    Have encountered problem when deploying Crystal Report using VB 2010. The report is able to show up during ASP.net development using VS 2010 but when i try to deploy on a IIS server, the report is just showing a blank page when trying to view using an Explorer on the client side. I'm using Window XP IIS 5.1 web server.
    Have tried doing VB setup and installing the merge module CRruntime_13_0_1 but still not working.
    Any help will be appreciated.
    Thanks
    KB

    While the supported platform text says that Microsoft  IIS5.1 is supported, I'm a bit dubious as CR 2008 (v. 12.x) did not support IIS5.1. See [KB 1494954 - Crystal Reports 2008 DHTML viewer for VS .NET is blank when displayed on a web form|http://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes_boj/sdn_oss_boj_bi/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes%7B6163636573733d36393736354636443646363436353344333933393338323636393736354637333631373036453646373436353733354636453735364436323635373233443330333033303331333433393334333933353334%7D.do].
    I'll check with Program Management and get back with a definitive answer.
    Ludek
    Follow us on Twitter http://twitter.com/SAPCRNetSup
    Got Enhancement ideas? Try the [SAP Idea Place|https://ideas.sap.com/community/products_and_solutions/crystalreports]

  • Hard disk partition not showing up during window 7 install

    STOP - 0x00000116 error . I
    want to install fresh OS from usb stick but the hard disk partition is not showing up. Only USB stick is getting detected.
    Please help .. I have an interview and I need to fix this issue asap.

    Hi there,
    Welcome to the HP Support Forums! It is a great place to find the help you need, both from other users, HP experts and other support personnel.
    I understand that your hard drive is not showing up, presumably as a bootable partition. I am happy to help, but I need a bit more clarification of your problem. You mention a 0x00000116 error as well, which is normally part of a Blue Screen of Death. Does this happen regularly as well, or is that the real complaint, that you are getting the 0x code and a BLue Screen on startup?
    That particular code is generally associated with a video driver problem.
    Is the hard drive you are trying to install to, a new replacement hard drive or the original hard drive?
    If you try to boot up the system, what error do you see?
    Are there any repeating flashing LED patterns, or beeping patterns?
    Assuming this is your original installed hard drive, did you try the recovery manager for the drive?
    Performing an HP System Recovery (Windows 7)
    Troubleshooting HP System Recovery Problems (Windows 7)
    Let me know, so I can better target my help to your situation.
    Malygris1
    I work on behalf of HP
    Please click Accept as Solution if you feel my post solved your issue, it will help others find the solution.
    Click Kudos Thumbs Up on the right to say “Thanks” for helping!

  • Interactive form is not showing data during design time

    Hello,
    I have created a interactive form to display PDF. It is of 12 page. I created and checked in the code to DTR but now when I checked out the DC and and edited the interactive form for further update it is not showing any thing in the design time,showing only one blank page. However if I build and run that checked out project it is showing the proper data at runtime, so now i am unable to update the pdf.
    Please help and let me know what to do.

    Hi Timo,
    Sorry for the late response and not specifying more in detail.
    My Jdeveloper version is 11.1.1.6 R1.  When I ran for the first time, it was working fine. Then later on, when I was running it was opening completely blank screen.
    I thought it is something to do with the permission to the task flow. I have opened web.xml and jazn-data.xml file to check and closed without tweaking these files.
    Now, I was not able to open the page in the designer also. It was just showing hierarchy of all the components.
    I copied the backup again and it worked. What could be the reason so that I can avoid doing this in future?
    Is this related to Jdeveloper bug as I have seen on other forums highlighting this issue.

  • JSR-75 and Files not showing up during File Browing

    I was wondering if this is a known issue because I cannot make sense of it. In running the default sample code from sun for browsing filesystems using JSR-75 and sometimes files in my filesystem just stop showing up! I am trying this with WTK25 and using Eclipse for development. The files will be showing up and suddenly when I traverse my tree using the emulator all I see is 'root1' and 'photos' while the default Readme file and the extra images I placed are not showing up. I've made sure to put content in every filesystem I could find (DefaultColorPhone/DefaultGrayPhone etc). I've tried erasing and readding files, even cycling my machine. I know about the emulator's ability to mount other filesystems but the short of it is I have no idea why I cannot see my files, only these strange default directories.
    In fact, if I erase root1/photos from DefaultColorPhone it still shows up when I browse. I've searched my computer for other locations. Is this a known issue?
    thanks

    Control-click an application's Dock icon and choose Show in Finder. You'll most likely find that it's at the top level of the drive and you dragged the file to the one in your home folder.
    (98641)

  • Rc.sysinit and btrfs: not show partition during the boot

    Hi,
    I see, during the boot, that show only partition NOT in btrfs...
    e.g i have two partitions: /dev/sda1 for / in ext4 and /dev/sda3 for /home in btrfs
    during the boot I see only /dev/sda1 clean but I don't see /dev/sda3...
    But partition mounted correctly.
    This my fstab
    /dev/sda1 / ext4 defaults,relatime,commit=10 0 1
    /dev/sda3 /home btrfs defaults,relatime 0 2
    /dev/sda2 swap swap defaults 0 0

    falconindy wrote:
    btrfs's fsck prog doesn't use the same name scheme as every other fsck prog (fsck.FSNAME). I don't know if renaming /sbin/btrfsck would be lethal to other btrfs utilities, so a symlink takes care of it:
    # ln -s /sbin/{btrfsck,fsck.btrfs}
    uhm...thank's...
    I'll try later, now I have experimented with udev, hal, usb device, xfce, default mount options

  • Purchased TV shows not showing up during home sharing

    Hello All,
                I love doing home sharing on my iPad and my Apple TV.  However I am having some problems with home sharing of TV shows on my iPad.  Let me give you an example.  I purchased Criminal Minds season 7.  When I do home sharing on my Apple TV it shows up and plays just fine, but will not on my iPad.  All of the other seasons are there but not season 7.  How do I fix this?
    Thank You,
    Christina

    Files purchased from the iTunes store don't automatically download a second time. Files that were purchased on the old computer won't download again unless you contact the iTunes store and ask them to re-authorize them.
    If you can still access the hard drive on the old computer, you should try to copy them over to the new computer via your network or an external hard drive. If you are now using the new computer to sync with your ATV, only files that are present on that computer will sync. If the files aren't there, they won't sync. Files don't sync from the iTunes store, they sync from the iTunes library on your computer.

  • Certain data columns not showing up during a query

    I have having trouble seeing certain data types when I search in Oracle SQL developer. Fields such as Dates and numeric values are showing as blank when I run a query. If I run the same query in SQL Plus, date values and numeric values appear.

    I am using SQL developer 2.1, but this was also happening when I was using early versions such as 1.5.5
    THe Database is an oracle 11g database
    on my machine I have an instance of java 1.5.0_18 running but within the application there is a java 1.6, I am not sure if the 1.6 is executing the program or not.
    WIndows XP service 2002 service pack 3
    Edited by: user9958587 on Jan 7, 2010 3:27 AM
    SELECT * FROM AsAddress which will return our address table containing dates.
    Edited by: user9958587 on Jan 7, 2010 3:27 AM

  • Contribute CS4 not showing up during install

    I'm trying to install Contribute CS4 on a PC running Windows 7.
    I've had it up and running using the same installer previously, so I know that it works (I also tried downloading the files again but the same issue returned).
    What's happening is, that the installer runs fine but only shows me the option of installing various smaller adobe programs - not Contribute.
    I've tried uninstalling and running the cleaner tool but the issue is still there.
    What can I do? I need the software for maintaining a website.
    Thanks in advance.

    if you follow all 7 steps you can directly download a trial here:  http://prodesigntools.com/download-adobe-cs4-and-cs3-free-trials-here.html
    and activate with your serial number.
    if you have a problem downloading, you didn't follow all 7 steps, or your browser does not accept cookies. 
    the most common problem is caused by failing to meticulously follow steps 1,2 and/or 3 (which adds a cookie to your system enabling you to download the correct version from adobe.com). 
    failure to obtain that cookie results in an error page being displayed after clicking a link on prodesigntools.com

  • Prices not showing up during creation of Lead to opportunity

    hello all,
    iam working on CRM2007,i have a created a Hot lead and i have a follow up creation of opportunity
    for the hot lead,during this process my product data has been copied from the lead but  neither Net Value nor the Expected total value is showing up in the Assignment block for the Item in that opportunity,
    can you please tell me what could be the problem,
    do i have to make any customizing setting for this.
    helpful answers will be rewarded.
    regards
    chandrashekar

    Hello
       Have you maintained the Pricing procedure for the Business Transaction for the required Organization, Document pricing procedure and Customer Pricing procedure?
    Regards,
    Sowmiya

  • Preview not showing up during RAW import

    So I want to import some pics and this statement comes up, " Preview unavailable for this file" see attached. I imported the pics once and then realized that I did not batch name them like I always do. So I deleted them from LR then renamed them in Bridge, then tried to important them again, it is a no go. So I have LR 4.1, I use Mac book pro, Mac os x version 10.7.4. attached is a screen shot. Ok also I am pulling these pics off of my external Hard drive, I have never run into this problem before when I was using LR3.

    I can't think of many situations where a colon (:) is not a reserved character - so, unwise inside a filename - at least, in the MS Windows context.
    I understand MacOS may have looser rules in its own right, and one may seem to get away with all kinds of things. But it seems to me a bad idea to flirt with incompatibility where you don't have to - remembering that with LR it is particularly easy to switch platform due to the licensing arrangements. Such an application is likely to be written so as to work as smoothly as possible across both; which requires, so as to conform to the rules of both.
    Other sometimes problematic characters include < > \ / | , much punctuation including ! ?, @, probably others too.  Some such as the semicolon (;) may be perfectly fine in many contexts, but prove unsuitable for others - for example, they may breach the file naming rules of a CD's or DVD's file system.
    I encountered a problem recently archiving several thousands of someone else's files, where anything with a semicolon in the name was rejected by the software involved. It was impossible to search and replace semicolons with a more acceptable character - because a semicolon was flagged as invalid entry by the search dialog. It took me several eye-crossing hours to track down and fix every single one by hand. Word to the wise.
    Personally, I stick habitually to alphanumeric, international accented characters etc, space, square and round brackets, hyphen and underscore - avoiding all other punctuation marks except for the dot immediately before the file extension. It may be a little more restrictive, but it is a lot more certain.

  • Content Repositories not showing up during Check in

    Hi All,
    In OACT, I see 3 content categories DMS_C1_ST; DVS1CONT;  DVS1STRUCT of type 'DMS'. But when I am checking in a file in a DMS Document Type, it gives me 3 options Vault, (ii) Archive, (iii) SAP DB. On the contrary I wanted to see the three categories as above (DMS_C1_ST, DVS1CONT, DVS1STRUCT) so that I could have selected one of the categories for checking in the Document. Dont know why I am not able to see the 3 content categories when I am trying to check in a file in Document Type. Can kindly someone help.
    Thanks,
    Sachin

    Hi,
    For that document type, select Kpro option in DC10, this will enable you to save in CS categories.
    By not clicking that option you are actually saving in sap database i.e. why those options are seen to you.
    Anirudh,

  • Why doesn't Xcode 4.3.3 debugger not showing all my ivars (like those defined in @implementation)?

    I have the latest Xcode build and I commonly place ivars in both the @interface section and the @implementation section.  This is actually very useful to bridge from Objective-C to C++.  I keep all the C++ definintions in the .mm, allowing the .h file to be imported in both .m and .mm files.  However, the debugger seems to only list the ivars that are defined in the @interface section.  I understand that the ivars in the @implementation section are "private" but the debugger should still be able to see them right?
    Any plans to fix this?  Or is there some secret option I have to enable to make it work?
    Thanks.

    'task bar'...?
    Drag 4.3.3 from the .dmg to your /Applications folder.
    Eject the .dmg when done. Run Xcode from /Applications
    Use the Xcode menu to install other tools from Apple, and Preferences to load components and docs as needed.
    Use Organizer to submit apps....Application Loader can be downloaded like other tool, tho, if you want it instead.
    Afghanistan, eh?
    Photos would be cool, thanks
    Ken

  • Xcode debugger not showing my instance variables!!

    I hate asking questions like this.
    I set a breakpoint in an IBAction method 'pushed:' inside FooViewController.  At runtime I pressed a GUI button and processing stopped in pushed:.
    In the data-viewing pane of xcode, I see
    {code}
    self = (FooViewController *) 0x... etc.
    {code}
    Indented under this is
    {code}
    UIViewController = (UIViewController) { ...
    {code}
    Nowhere do I see any of my instance variables!!
    Now, they were synthesized from properties, but that doesn't matter, does it?
    The code that proceeds to set some instance variables runs fine.
    Why isn't xcode displaying self's instance vars?
    Thanks,
    Chap

    Yes, yours looks like I was expecting mine to look.
    Note that viewDidLoad (below) does work correctly, producing the expected results in the simulator!
    Hangman3ViewController.h:
    @interface Hangman3ViewController : UIViewController {
    @property (         nonatomic )           NSInteger  wordLength;
    @property ( retain, nonatomic )           NSString  *alphabet;
    @property (         nonatomic )           unichar    guess;
    @property (         nonatomic )           NSInteger  guessNo;
    @property ( retain, nonatomic )           NSMutableString *board;
    @property ( retain, nonatomic ) IBOutlet  UILabel   *boardLabel;
    @property ( retain, nonatomic ) IBOutlet  UILabel   *guessNumberLabel;
    @property ( retain, nonatomic ) IBOutlet  NSArray   *keyboardButtons;
    - (IBAction)letter:(id)sender;
    - (void)showBoard;
    @end
    and, Hangman3ViewController.m:
    #import "Hangman3ViewController.h"
    @implementation Hangman3ViewController
    @synthesize wordLength       = _wordLength;  // preprocessor command to gen getter/setter and instance variable
    @synthesize boardLabel       = _boardLabel;  // preprocessor command to gen getter/setter and instance variable
    @synthesize guessNumberLabel = _guessNumberLabel;  // Guess #n
    @synthesize keyboardButtons  = _keyboardButtons;   // array of buttons
    @synthesize alphabet         = _alphabet;    // A-Z unichars
    @synthesize guess            = _guess;       // unichar
    @synthesize guessNo          = _guessNo;     // int
    @synthesize board            = _board;
    - (IBAction)letter:(id)sender
                Get letter from sender - driven when key button is pressed.
                The button's tag is an int from 0-25, identifying what letter of the alphabet it is.
                Extract that unichar from ALPHABET as 'guess'.  Then, disable the button,
                which has been defined to have its text turn white (invisible) when disabled.
        UIButton *button = (UIButton *)sender;
        self.guess = [self.alphabet characterAtIndex: button.tag];
        NSLog(@"Received keystroke: %C", self.guess);
        [button setEnabled:NO];
    - (void)showBoard
        self.boardLabel.text = self.board;
        self.guessNumberLabel.text = [NSString stringWithFormat:@"Guess #%d", self.guessNo];
    - (void)dealloc
        [_boardLabel release];
        [_guessNumberLabel release];
        [_keyboardButtons release];
        [super dealloc];
    - (void)didReceiveMemoryWarning
        // Releases the view if it doesn't have a superview.
        [super didReceiveMemoryWarning];
        // Release any cached data, images, etc that aren't in use.
    #pragma mark - View lifecycle
    // Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
    - (void)viewDidLoad
        NSLog(@"Hello from viewDidLoad");
        [super viewDidLoad];
        self.alphabet   = @"ABCDEFGHIJKLMNOPQRSTUVWXYZ"; // unichar string
        self.wordLength = 7;  // temp - will be set from flipside later on
        self.guessNo    = 1;
        [self.board setString:@"_______"]; // actually dynamic based on wordLength
        self.board = @"_______";
        [self showBoard];
    - (void)viewDidUnload
        [super viewDidUnload];
        // Release any retained subviews of the main view.
        // e.g. self.myOutlet = nil;
    - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
        // Return YES for supported orientations
        return (interfaceOrientation == UIInterfaceOrientationPortrait);
    @end

  • Why EM database express URL did not show up during 12c installation?

    Installation is successful, but https://localhost:5500/em/ doesn't work. What is wrong?

    emctl status dbconsole 
    in a terminal/command prompt to get your EM url.
    Have you tried that with EM Express 12c?
    C:\Oracle\product\12.1.0\dbhome_1>dir /s /b emctl*
    File Not Found
    The following might be better:
    How can I find the port on which EM Express is configured?
    Regards,
    Mark

Maybe you are looking for

  • FaceTime feature is not available on brand new iphone 5 from Dubai, United Arab Emirates (UAE)

    We got a brand new iphone 5 from Dubai, United Arab Emirates (UAE). We are living in Italy and we are trying to setup the FaceTime on brand new iphone 5 but to no avail. Is there a way to enable the FaceTime features? Can Apple or the carrier are cap

  • Spaces not showing correctly in ADF 11g table columns .

    We have a simple af:table with only two columns (clickToEdit) is enabled . Please see the pictures bellow: Screenshot 1: http://i.imgur.com/84PCL.png (as you can see in the last row the "Cheie" value contains leading spaces - the row is editing mode)

  • Is this a Photoshop problem?

    Version 8.0p Framemaker Version 10.0.1 Photoshop Version 8.2.6 Adobe Acrobat Professional I'm not sure if this is the right place to bring up this issue. I have been making marketing documents in Frame. I built my group's logo in Photoshop starting w

  • Email Notification in lead center

    Hi, I have an issue with email notificaiton in Lead Center of Telesales. Once the lead is converted into qualified, Sales channel and Lead rank will be populated automatically and email notification workflow will be triggered and email is sent to lea

  • PDF's Background Transparent

    I just imported a PDF and the white background is appearing transparent in Keynote. How can I make the background show up as white? -Kirk