Re: Serialization Issues and bloated objects

Tech-Archive recommends: Fix windows errors by optimizing your registry



Hi Sagi,

I see.

Let's take following code for example:

[Serializable]
public class Member
{
private Policies _policies = new Policies();

(I have the policies collection created by default).

Then I have following code in Page_Load():

Profile.Member.Age = 1;
Profile.Member.Name = "Name";
Profile.Member.Policies.Add(new Policy(1, "n1"));
Profile.Member.Policies.Add(new Policy(2, "n2"));


Refreshing the page several times, and you will see duplicated policy
objects in the serialized text. This is because I'm not checking if the
policies collection is initialized or not before adding new policy objects.
Note that since Profile has already saved the object for us, when we
execute the code second time, there're already policies objects there.

If in doubt, please post some of your code how you're reading/writing the
profile. Thanks.


Regards,
Walter Wang (wawang@xxxxxxxxxxxxxxxxxxxx, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.


.



Relevant Pages

  • Re: Serialization Issues and bloated objects
    ... private Policies _policies = new Policies; ... and you will see duplicated policy ... Note that since Profile has already saved the object for us, ... execute the code second time, ...
    (microsoft.public.dotnet.framework)
  • Re: Local Policies with Roaming Profiles - Security ID Prob
    ... are only local policies, they should be stored in the Group Policies ... when a second computer tries overwrite the copy of the profile, ... I'm guessing that other computers won't then recognise that SID ...
    (microsoft.public.win2000.security)
  • RE: gp still tatooing!
    ... > more and more policies. ... > policies tatooed locally stored locopy of user profile and when the profile ... > when the affected user logs onto another workstation (the one that he had ... > never log on to) he gets a new local profile and no policies are applied to ...
    (microsoft.public.windows.server.active_directory)
  • RE: gp still tatooing!
    ... the article "Understanding Policy Tattooing" ... >> i check affected user with GPResults and it showes than no policies are ... >> policies tatooed locally stored locopy of user profile and when the profile ... >> never log on to) he gets a new local profile and no policies are applied to ...
    (microsoft.public.windows.server.active_directory)
  • Re: gp still tatooing!
    ... "Piotr Majcher" wrote in message ... > does anyone know how can I avoid tattooing local user profiles? ... >>>> i check affected user with GPResults and it showes than no policies ... >>>> policies tatooed locally stored locopy of user profile and when the ...
    (microsoft.public.windows.server.active_directory)