0

Every modern version of JSIL I ever try to get working with XNA ends up with this error.

Error code from JSILc.exe with an XNA 4.0 solution

Everywhere I've ever looked in the past for information about why it doesn't run ends up with an answer about XNA 4.0 not being installed properly or something.

This error was reproduced on 3 different computers.

I CAN get A version of JSIL working, I can download one of the releases from the git repository (JSIL-0.7.6) and it'll work with XNA providing you don't give it anything the build is unable to support.

But those releases are a couple of years old now. It would've been nice to get a modern build working.

I try to offer up some speculation but I'm sort of out of my depth here.

JSIL-0.7.6 - won't build in AnyCPU, requires the solution platform be set to x86.

Latest JSIL git release - A lot of the projects are now set to AnyCPU and setting them to x86 will create a various mixture of errors or warnings.

So I think somewhere along the line I might be having problems with a build at the point certain projects in JSIL went from x86 to 64 bit support.

I have visual studio express 2010 and visual studio community installed.

I've tried things like using XNA refresh. Using emscription, FNA, etc...

In an ideal world I'd rather get JSIL working with monogame but I get so many errors on any version of JSIL it doesn't seem to be worth bothering. Porting monogame projects to xna isn't too much trouble.

1 Answers1

2

Trunk JSIL is designed to be built using VS2015 Community. Most of the dependencies have moved over to NuGet, which means that you need to restore packages before building for the first time - VS2015 will do this for you automatically; at the command line you may need to do a manual NuGet package restore.

If you want to use the XNA support, you'll want to compile as Debug|Any CPU or Release|Any CPU. This should still work because the compiler - JSILc - has 32-bit and 64-bit targets now. If you use the 32-bit target (Compiler.Executor.32bit) that will ensure the compiler is running in 32-bit mode and the XNA bits will work. The 32-bit target builds as JSILc.exe and the 64-bit target builds as JSILc.AnyCPU.exe.

As far as the content pipeline bits go, I'd need to see more log text to speculate as to why it's not working... but in general, the content pipeline does not work reliably in command-line msbuild. Your best bet is to first build the game project a single time using Visual Studio so all the content is built correctly, at which point command-line msbuild will handle it better.

For XNA in VS2015, use the VS2013 package from codeplex: https://mxa.codeplex.com/releases You may need to edit the manifest inside the package before VS2015 will let you install it, but it works perfectly.

Building with VS2013 will probably work fine, but I haven't done that recently.

If you're still having trouble, try ruling out the basics by doing a NoXNA build (Debug|NoXNA instead of Debug|AnyCPU) and make sure everything works there. An easy way to verify a working build is to run the 'SimpleTests' test suite using the VS2015 test runner - it takes a relatively short amount of time and will identify basic issues with the compiler or build pipeline.

Keep in mind that when you invoke tools like msbuild or csc from the command-line, it's somewhat unpredictable which version you'll get. VS2015 x64 native tools command prompt and VS2015 x86 native tools command prompt are two start menu shortcuts that will get you a command prompt with the right tools loaded if you have VS2015. Given that you have VS2010 installed, it's possible that old versions of msbuild and/or csc are being used when you try to build.

Katelyn Gadd
  • 1,383
  • 9
  • 13
  • Thanks Katelyn, great post. – Mark Randle Sep 01 '15 at 22:21
  • I mainly had express 2010 installed for XNA. I uninstalled everything (XNA, VS Express 2010, VS 2013) I installed VS 2015, for XNA I downloaded this version https://mxa.codeplex.com/releases/view/117230 I managed to get it installed with Visual Studio 2015 thanks to the top answer on this post : http://stackoverflow.com/questions/28008970/how-to-install-xna-in-visual-studio-2015-preview Red errors with solution, but if I point directly to the exe as you say, it's now working. Now I've just got to figure out how I'm supposed to get a content manifest now as content doesn't build. – Mark Randle Sep 01 '15 at 22:28
  • I ran all the tests. 27 pass and 256 fail, I'm guessing that's bad? Among the failed were three SimpleTests. – Mark Randle Sep 02 '15 at 00:25
  • Update from more tinkering. I don't know why the tests are failing, ignoring. I don't think they're relaying accurate information. Tested on another pc and they worked. One thing I can't get past on latest git release, I keep getting exceptions to do with XNA colors being undefined, I see it's not building XNAcolor.js like it used to so I added it from and old build and readded it to the manifest. I end up with Error: Unbalanced canvas save/restore. Making all XNA colours from non preset RBG values also threw a differet error but with the same lines. – Mark Randle Sep 02 '15 at 21:42