kevingadd/JSIL — Issue #73: Compiling XNA libraries
Author: XeeR
Created: 2012-03-06 05:48:53+00:00
State: open

Hello! I have tried to convert my own simple XNA4 application to JS using JSIL. I have found that all XNA functionality is "not implemented" as XNA libraries are in "Stubbed" list. If I try to remove "microsoft.*" namespace from stubbed list, I receive error:
"Unhandled Exception: System.AggregateException: One or more errors occurred.
---> System.Collections.Generic.KeyNotFoundException:
No cache entry for method ' System.Runtime.InteropServices.GCHandle System.Void .cctor ( )'.
at JSIL.FunctionCache.GetCacheEntry(QualifiedMemberIdentifier method)
in D:\Work\.net\JSIL\JSIL\JSIL\FunctionCache.cs:line 64
at JSIL.AssemblyTranslator.TranslateMethod(DecompilerContext context,
MethodReference methodRef, MethodDefinition method, JavascriptAstEmitter astEmitter,
JavascriptFormatter output, Boolean stubbed, HashSet`1 externalMemberNames,
HashSet`1 staticExternalMemberNames, Action`1 dollar, Action`1 bodyTransformer)
in D:\Work\.net\JSIL\JSIL\JSIL\AssemblyTranslator.cs:line 1490..."
I have tried to convert different XNA4 libraries separately, with different settings in defaults.jsilconfig.
If I have tried to skip execution of this code "AssemblyTranslator.cs:line 1490" for "System.Runtime.InteropServices.GCHandle System.Void .cctor ( )" in debug mode, then JSIL meets another similar errors related to System.* namespace.
Also JSILc returns batch of such errors:
"// Could not decompile method Microsoft.Xna.Framework.Vector4 Microsoft.Xna.Fram
ework.Vector4::Transform(Microsoft.Xna.Framework.Vector3,Microsoft.Xna.Framework
.Matrix): Arithmetic operation resulted in an overflow.
// Could not decompile method Microsoft.Xna.Framework.Color Microsoft.Xna.Framew
ork.Color::get_Tomato(): Arithmetic operation resulted in an overflow..."
All code was compiled using VS2010 + x86|Debug.

Am I doing something wrong? Tetris and Platformer meet the same problem for me (I have converted them to XNA4).

Thanks in advance,
XeeR