There are many errors in other Demos_GameBase's samples run in silverlight

Feb 9, 2011 at 6:30 AM

The error is :

System.ArgumentNullException was unhandled by user code
  Message=值不能为 null。
参数名: input
  StackTrace:
       位于 System.IO.BinaryReader..ctor(Stream input, Encoding encoding)
       位于 System.IO.BinaryReader..ctor(Stream input)
       位于 Microsoft.Xna.Framework.Content.ContentReader..ctor(ContentManager manager, Stream stream, GraphicsDevice graphicsDevice)
       位于 Microsoft.Xna.Framework.Content.ContentManager.LoadXnb[T](String assetName)
       位于 Microsoft.Xna.Framework.Content.ContentManager.Load[T](String assetName)
       位于 Xen2D.XenCache`1.Initialize(Type contentElementEnumeration)
       位于 Xen2D.XenCache`1..ctor(ContentManager content, Type contentElementEnumeration)
       位于 Xen2D.SpriteFontCache..ctor(ContentManager content, Type contentElementEnumeration)
       位于 XenGameBase.GameBase.LoadContent()
       位于 Microsoft.Xna.Framework.Game.Initialize()
       位于 XenGameBase.GameBase.Initialize()
       位于 Demo_BasicElement2D.GameMain.Initialize()
       位于 Microsoft.Xna.Framework.Game.gameLoop_Update(Object sender, SimpleEventArgs`1 e)
       位于 SilverArcade.SilverSprite.GameLoop.CompositionTarget_Rendering(Object sender, EventArgs e)
       位于 System.Windows.Media.CompositionTarget.OnRendering(Object sender, RenderingEventArgs e)
       位于 MS.Internal.JoltHelper.RaiseEvent(IntPtr target, UInt32 eventId, IntPtr coreEventArgs, UInt32 eventArgsTypeIndex)
  InnerException:

 

System.MethodAccessException was unhandled by user code
  Message=方法“XenAspects.Pool`1<System.__Canon>.New()”访问方法“Demo_MouseSelection.ClickableElement..ctor()”的尝试失败。
  StackTrace:
       位于 System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
       位于 System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache)
       位于 System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache)
       位于 System.Activator.CreateInstance[T]()
       位于 XenAspects.Pool`1.New()
       位于 XenAspects.ComposableObject`1.Acquire()
       位于 Demo_MouseSelection.GameMain.LoadContent()
       位于 Microsoft.Xna.Framework.Game.Initialize()
       位于 XenGameBase.GameBase.Initialize()
       位于 Microsoft.Xna.Framework.Game.gameLoop_Update(Object sender, SimpleEventArgs`1 e)
       位于 SilverArcade.SilverSprite.GameLoop.CompositionTarget_Rendering(Object sender, EventArgs e)
       位于 System.Windows.Media.CompositionTarget.OnRendering(Object sender, RenderingEventArgs e)
       位于 MS.Internal.JoltHelper.RaiseEvent(IntPtr target, UInt32 eventId, IntPtr coreEventArgs, UInt32 eventArgsTypeIndex)
  InnerException:

Coordinator
Feb 9, 2011 at 8:09 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Coordinator
Feb 9, 2011 at 8:13 AM

Thanks again, chszu! We'll get Xen in Silverlight fixed up to parity with the other platforms as soon as we can.

Coordinator
Feb 10, 2011 at 7:01 AM

Hi chszu,

We narrowed the issue down to reflection in Silverlight not being able access the object pool if the classes are not public. It might solve your issue in the meantime if you want to try that, although we're looking deeper to see if there are any other issues on top of that for the demos. Also, when you add the .spritefont content files to the project, make sure to set the Build Action to "Content" or it will fail to load. We'll resolve the bug once we verify the rest of the demos port over to Silverlight successfully.

Thanks again for the feedback!