473,406 Members | 2,377 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,406 software developers and data experts.

Serializing a Generics Dictionary?

Hi there,

I could serialize a class until I added this member to it:

private Dictionary<string><TableMapper> = new
Dictionary<string><TableMapper>();

The class has the [Serializable()] attribute, but now it won't serialize.

Does any one know of a code sample that shows how can this be done? Any
workarounds?

Best Regards,

-Benton

Nov 18 '05 #1
1 1758
Benton,

Are you sure the TableMapper has the serializable attribute? When you
say it won't serialize, what do you mean? Is an exception thrown?

Also, your syntax is wrong, it should be:

private Dictionary<string, TableMapper> myVariable = new Dictionary<string,
TableMapper>();
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Benton" <co*******@gmail.com> wrote in message
news:3u************@individual.net...
Hi there,

I could serialize a class until I added this member to it:

private Dictionary<string><TableMapper> = new
Dictionary<string><TableMapper>();

The class has the [Serializable()] attribute, but now it won't serialize.

Does any one know of a code sample that shows how can this be done? Any
workarounds?

Best Regards,

-Benton


Nov 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
by: atgraham | last post by:
Here is the "lead C# architect" attempting to impugn C++ templates (bottom of the page). http://www.artima.com/intv/generics2.html (bottom of the page) (Full article begins at...
18
by: riftimes | last post by:
Hello, would you help me to find totorials with examples about generics and Dictionary thank you.
4
by: Cedric Rogers | last post by:
I wasn't sure if I could do this. I believe I am stretching the capability of what generics can do for me but here goes. I have a generic delegate defined as public delegate bool...
3
by: Showjumper | last post by:
Back in asp.net 1.1 i made custom collection classes per Karl Seguin's article On the Way to Mastering ASP.NET: Introducing Custom Entity Classes to take advantage of strongly typed data. Now with...
7
by: =?Utf-8?B?Q29kZVJhem9y?= | last post by:
Can someone explain a few things about collections to me. In C# 2 generics, you can create a collection class by inheriting from System.Collections.ObjectModel.Collection. Using this you can...
8
by: ThunderMusic | last post by:
Hi, We need to serialize (binary) objects containing generic collections. The thing is, when we try to get the objects back (deserialize) with a different instance of the application, we receive...
2
by: =?Utf-8?B?c2lwcHl1Y29ubg==?= | last post by:
Hi I have a class that inherits from Generics Dictionary The string that is used for the key is passed thru-out my pgm and sometimes it has modifiers added to the key string that are used in the...
1
by: =?Utf-8?B?TWFyaw==?= | last post by:
Hi... I'm a little perplexed by some of the generics collection stuff. Dictionary<Key, Valuebeing the rough equivalent of Hashtable, I was surprised to find there was no direct way to get to the...
3
by: csharpula csharp | last post by:
Hello, I want to perform the follwing action with the use of generics: Method which will append 2 dictionaries such as input will be Dictionary <T,list<U>d1 and Dictionary <T,list<U>d2 . The...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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.