Jump to content
  • Advertisement
Sign in to follow this  

XNA 4.0 IntermediateSerializer.Deserialize problem in List List

This topic is 2907 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=, 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
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!