Sign in to follow this  

XNA 4.0 IntermediateSerializer.Deserialize problem in List List

This topic is 2544 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Sorry! i cannot delete this post now!! I had post another in DirectX and XNA.

When I Deserialize, it break and show "TypeAccessException was unhandled" error as below:

Attempt by security transparent method 'DynamicClass.ReflectionEmitUtils(System.Object, System.Object)' to access security critical type 'UtilityWinGameLibrary.CellData' failed.

Assembly 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' is marked with the AllowPartiallyTrustedCallersAttribute, and uses the level 2 security transparency model. Level 2 transparency causes all methods in AllowPartiallyTrustedCallers assemblies to become security transparent by default, which may be the cause of this exception.


Does somebody know how to resolve this problem?
My project is WinForm that saves and loads xml files. The xml files will use in my XNA game client. I wish I can use IntermediateSerializer, becuase game client can load xml(xnab) by conent manager.


public class SaveFloorData
{
public float hexWidth;
public Point size;

public List<List<CellData>> CellArray;
}

public bool LoadFloorFileIntermediate(string filename)
{
XmlReaderSettings settings = new XmlReaderSettings();
settings.IgnoreComments = true;

using (XmlReader reader = XmlReader.Create(filename, settings))
{
saveFloorData = IntermediateSerializer.Deserialize<SaveFloorData>(reader, null);
}

return true;
}






[Edited by - akira32 on December 26, 2010 6:36:10 AM]

Share this post


Link to post
Share on other sites

This topic is 2544 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this