Referencing other managed libraries from XNA Game Studio Express

Is it possible to reference other (safe) managed libraries from XNA Game Studio Express?

Since the JITer doesn’t care about what language the binary was initially written in, it should work properly on the 360 right?

The reason I’m asking, is that with this approach I could keep some of my libraries which requires very high performance in managed C++. Then I can just reference them from XNA game studio express in the C# project, and voila, we get the best of both worlds.

Thanks,

Roger Larsen

[1511 byte] By [twospoons] at [2008-2-11]
# 1

In general, you can reference assemblies as you wish. The idea of building a high performance assembly in managed C++ for referencing in the game is likely to fall apart pretty quickly though. The problem is two-fold. C++/CLI has a runtime component which won't work properly on Xbox 360 without some work on our part (a similar problem exists for Visual Basic and some other .NET languages). Secondly, if your concern is performance, you're likely going to be doing PInvokes, using unsafe code, or linking to native libraries. This would require that you compile your assembly as something other than /clr:pure. Doing so is going to make it difficult to run on the Xbox 360.

So, in practice, you can reference any assembly you want on Windows but you'll likely only get very far on Xbox 360 referencing assemblies built within XNA Game Studio Express which only supports C# in v1.

PaulBleisch at 2007-8-30 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,XNA Game Studio Express...
# 2
Paul Bleisch wrote:

In general, you can reference assemblies as you wish. The idea of building a high performance assembly in managed C++ for referencing in the game is likely to fall apart pretty quickly though. The problem is two-fold. C++/CLI has a runtime component which won't work properly on Xbox 360 without some work on our part (a similar problem exists for Visual Basic and some other .NET languages). Secondly, if your concern is performance, you're likely going to be doing PInvokes, using unsafe code, or linking to native libraries. This would require that you compile your assembly as something other than /clr:pure. Doing so is going to make it difficult to run on the Xbox 360.

So, in practice, you can reference any assembly you want on Windows but you'll likely only get very far on Xbox 360 referencing assemblies built within XNA Game Studio Express which only supports C# in v1.

I was referring to not using any PInvokes or unsafe C++ code :-). The reason I'm asking is that certain math operations in managed C++ is up to 6 times faster than in managed C#. This might be a non-issue on the 360 though.

I just did a quick test with a console app in C++ with /clr:pure, and the IL for main() looks like it only uses mscorlib. I do however see that there are references to System.Runtime.CompilerServices in the IL elsewhere. Is that where the issue is?

Thanks,

Roger Larsen

twospoons at 2007-8-30 > top of Msdn Tech,Game Technologies: DirectX, XNA, XACT, etc.,XNA Game Studio Express...