Problems with newer versions FP3

Sep 8, 2010 at 6:59 PM

I'm unable to update due to two different problems.

If I take the latest revision (76968), I can't compile because I still work with VS2008 / XNA 3.1. Eventhough I can open the Class project, I can't build it because the Body class uses a 'Default parameter specifier', which is (I guess) a feature of C#4.0.
-Will Farseer quit supporting VS2008 / XNA3.1?? I really hope not, because I'm pretty bound to this laptop which has XP running.

If I take a somewhat older revision, say 76818, I can build, but I receive about 80 errors because now Farseer also has it's Vector3 and Vector2 classes defined. With both using statements for XNA and Farseer, most classes in my project have conflicts.
-Is this gonna stay this way?

Sep 8, 2010 at 7:26 PM

This is of course just my 2 cents... and I'm not sure what the author's general philosophy is on supporting legacy APIs is. But personally, I would be very concerned about having to support lots of legacy APIs/SDKs. I really like the fact that Farseer moves forward with technology and can do so in a lightweight manner without being tied to older technologies. 

Now, that said -- I don't use XNA (I use Silverlight) for Farseer so it's easy for me to say :) 

I just would hate to see the Farseer project enter into a death spiral of code bloat because it has to support older .net platforms and other APIs. 


All IMHO of course ...


Sep 8, 2010 at 8:25 PM

The main reason for me to switch to VS2010 and .NET 4.0 (and XNA 4.0) is that this setup simply works together. I can't run VS2010 with XNA 3.1 - not in an easy way at least. As long as the technologies I use (VS2010 express, .NET 4.0 and XNA 4.0) are free, I see no reason not to upgrade to the latest version. Also, have in mind that the next release could be anywhere between a month and ½ year - most people will use those technologies in half a year.

Another reason is that it is hard for me to keep the library up to date while keeping older versions working. I recommend that you use FPE 3.0 if you need XNA 3.1 and VS2008. As for the .NET 4.0 - I'm wondering if it is worth updating to this version since I only use it for default parameters (2 places so far) - I will keep using it for now (since VS2010 comes with .NET 4.0) - if it causes any trouble before the next release, I will revert the changes and fall back to .NET 3.5 SP1.

Sep 8, 2010 at 8:39 PM
Edited Sep 8, 2010 at 11:36 PM

Reiterating what genbox said,

the only real places that run into problems are a couple parameters that use the "optional parameter" notation.

You can easily modify it to make it 3.1 compatible.

For instance, in Body.cs, the CreateFixture method has parameters "Shape shape, float density = 1"

Just delete the " = 1" and add another [overloaded] method above it that calls it.

For example:

public Fixture CreateFixture(Shape shape)


return CreateFixture(shape, 1);



Good luck!

Sep 8, 2010 at 9:11 PM

Ok, I understand you want to work with the newest version and to be honest I would like too. Shame that Microsoft bound XNA 4 to VS2010 and VS2010 to Vista / W7.

Anyway, thanks for the advise oranjoose, as long as the number of those changes stays within reason I can still update. That is, if I can fix this:
"Error 1 The type 'Microsoft.Xna.Framework.Vector3' exists in both 'Microsoft.Xna.Framework.dll' and 'FarseerPhysics.dll'"
I thought "using Vector3 = Microsoft.Xna.Framework.Vector3" would fix it, but it doesn't. Any idea?

Thanks alot for your feedback guys. I think the physics part of my game is almost finished, so I won't have that much troubles and I'm allright with using the current version. All I need still is the MaxDistanceJoint. Speaking of which, it seems to be gone even in the newest release. I posted an issue, which I thought was fixed. Or at least it was removed by someone :)


Sep 8, 2010 at 9:30 PM

The Vector3 (and Vector2, MathHelper and Matrix) files should not be inside the XNA projects. They should only be referenced inside the class libraries. We have to provide a clone of the classes in the class library (and silverlight version).

Sep 9, 2010 at 8:27 AM

What do you mean, should not be? It's inside the dll of XNA 3.1.
What can I do about it?

And do you know what happened to the MaxDistanceJoint or how I can get it back, just take it from an older revision?

Sorry for bothering you with all these questions, but I'd love to update to at least PH3.0 official release and finish my game. Thanks alot for your help so far.

Sep 9, 2010 at 8:34 AM

The error you wrote tells us that Vector3 is inside both the XNA 3.1 framework DLL (as it should be) and inside the FarseerPhysics DLL (where it should NOT be). You are probably using the class library version of the library inside a XNA project. If that is the case, use the XNA version of the library or remove the conflicting files from the class library.

The MaxDistanceJoint was superseded by the SliderJoint. It has the same functionality, but also support a minimum distance.

Sep 9, 2010 at 8:46 AM

Ok, I see! Indeed I used the Class library, because I couldn't open the XNA project.

I will fall back to the official release of PH3.0 and use the SliderJoint then :)