MissingFieldException - DebugViewXNA.cs, Line 186

Topics: User Forum
Sep 22, 2010 at 3:39 AM

Apologies for being somewhat muddled, but I'm having a strange time with FarSeer 3.0. Here's what I've got going on:

  • I have built the Farseer Physics 3.0 XNA project from the released version, copied the resultant .dll into my game's directory, and included it as a reference in my project
  • I have built DebugView XNA project files from Changeset 77314, coied the resultant .dll into my game's directory, and included it as a reference in my project
  • Everything builds correctly, but when I run my .exe, I am seeing the following exception from DebugViewXNA.cs, line 186:

 

System.MissingFieldException was unhandled
  Message=Field not found: 'FarseerPhysics.Collision.Shapes.LoopShape.Vertices'.
  Source=DebugViewXNA
  StackTrace:
       at FarseerPhysics.DebugViewXNA.DebugViewXNA.DrawShape(Fixture fixture, Transform xf, Color color)
       at FarseerPhysics.DebugViewXNA.DebugViewXNA.DrawDebugData() in D:\Code Projects\XNA Projects\Pure Space\DebugViewXNA\DebugViewXNA.cs:line 186
       at FarseerPhysics.DebugViewXNA.DebugViewXNA.RenderDebugData(Matrix& projection) in D:\Code Projects\XNA Projects\Pure Space\DebugViewXNA\DebugViewXNA.cs:line 604
       at FarseerPhysics.DebugViewXNA.DebugViewXNA.RenderDebugData(Matrix& projection, Matrix& view) in D:\Code Projects\XNA Projects\Pure Space\DebugViewXNA\DebugViewXNA.cs:line 643
       at PureSpace.Engine.RenderingHandler.Draw() in D:\Code Projects\XNA Projects\Pure Space\Pure Space\PSEngine\RenderingHandler.cs:line 105
       at PureSpace.Engine.PSEngine.Draw() in D:\Code Projects\XNA Projects\Pure Space\Pure Space\PSEngine\PSEngine.cs:line 88
       at PureSpace.GameplayScreen.Draw(GameTime gameTime) in D:\Code Projects\XNA Projects\Pure Space\Pure Space\ScreenManager\Screens\GameplayScreen.cs:line 172
       at PureSpace.ScreenManager.Draw(GameTime gameTime) in D:\Code Projects\XNA Projects\Pure Space\Pure Space\ScreenManager\ScreenManager.cs:line 223
       at Microsoft.Xna.Framework.Game.Draw(GameTime gameTime)
       at PureSpace.PureSpaceGame.Draw(GameTime gameTime) in D:\Code Projects\XNA Projects\Pure Space\Pure Space\PureSpaceGame.cs:line 110
       at Microsoft.Xna.Framework.Game.DrawFrame()
       at Microsoft.Xna.Framework.Game.Tick()
       at Microsoft.Xna.Framework.Game.HostIdle(Object sender, EventArgs e)
       at Microsoft.Xna.Framework.GameHost.OnIdle()
       at Microsoft.Xna.Framework.WindowsGameHost.RunOneFrame()
       at Microsoft.Xna.Framework.WindowsGameHost.ApplicationIdle(Object sender, EventArgs e)
       at System.Windows.Forms.Application.ThreadContext.System.Windows.Forms.UnsafeNativeMethods.IMsoComponent.FDoIdle(Int32 grfidlef)
       at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
       at System.Windows.Forms.Application.Run(Form mainForm)
       at Microsoft.Xna.Framework.WindowsGameHost.Run()
       at Microsoft.Xna.Framework.Game.RunGame(Boolean useBlockingRun)
       at Microsoft.Xna.Framework.Game.Run()
       at PureSpace.Program.Main() in D:\Code Projects\XNA Projects\Pure Space\Pure Space\PureSpaceGame.cs:line 129
  InnerException: 

That field does appear to be present in the FarseerPhysics.Collision.Shapes.LoopShape class, according to the Object Browser view of the Farseer Physics 3.0 XNA Assembly. For what it's worth, I don't see this same error when I build the sample projects or run HelloWorldXNA, so I'm thinking it's a problem with my project's configuration, but even with a few hours of searching and working on it, I can't figure out what's happening. I have done both Clean and Rebuild All builds, but that hasn't resolved/fixed things.

Help? :)

 

 

Sep 22, 2010 at 4:40 AM

...and inevitably, asking the question means I solved it myself an hour later. Turns out the .dll versions were borked; building DebugViewXNA.dll and Farseer Physics 3.0 XNA.dll from scratch via the 77314 sources resolved the issue. Hopefully, nobody else has the same problem and this thread is entirely useless.