-
Notifications
You must be signed in to change notification settings - Fork 240
Windows Phone XNA #54
Comments
If you run your project through command line msbuild, does it work? Or do you have to use the version of visual studio specific to wp7? Also, can you tell me the location of the devices sensors assembly on disk?Sent from my Android phone with K-9 Mail. Please excuse my brevity. kierepka reply@reply.github.com wrote: Hi, When I try to convert XNA game using JSILc I'm getting this error: Unhandled Exception: System.AggregateException: One or more errors occurred. ---> System.NullReferenceException: Object reference not set to an instance of an object. Reply to this email directly or view it on GitHub: |
Yes I'm using just Visual Studio. This dll (sensors) should be in SDK for Windows Phone (I try to find it but without any success) |
I'm now moving code from Wp7 to PC - maybe this will help? |
ok. After translation to PC I got this error (when I'm using exe file):
|
This error is generated when I'm using SLN solution file: (is there command for generating output file with log)? at JSIL.Ast.JSAstVisitor.VisitorCache.Adapter |
I get the same error. Did you find a solution for solving this issue? |
How big are the .exe and .dll files in your solution's bin\ folder, all added up? It sounds like your app has too much code to fit into memory. I might be able to address this by changing the way I use ILSpy, but it relies on fitting everything into memory to a certain degree. |
Whole Windows Phone directory: 1 323 072 FarseerPhysicsXNA.dll PC directory: |
There was missing 1 column in Windows Phone: So whole game with content is almost 30MB but PC version (just exe) has 0,4MB, |
If you pass --nothreads on the command line, does it still fail? Can you run it in the debugger and look at the memory usage when the exception is thrown? |
no this same problem (in debugger it stops in AssemblyTranslator.cs on line 278): Instruction NYI: Ldvirtftn Mono.Cecil.MethodDefinition Unhandled Exception: System.AggregateException: One or more errors occurred. ---
|
How can there be 46k methods to analyze if it is only 0.4mb?! Do you have some huge dependencies that are living in the Global Assembly Cache? |
Now (after removing 3 not necessery (now) libraries) I have these references: Farseer Physics XNA But after decompiling: |
That's an order of magnitude more assemblies than I would expect to see. Make sure anything you don't want translated is being stubbed. For example, PresentationFramework and Microsoft.Build.* and WindowsBase and UIAutomationTypes and ReachFramework and Accessibility will all be translated by default unless you add them to the stub list. It's also just possible you don't have enough memory to load all those assemblies. For some reason, Mono.Cecil insists on caching the raw bytes for every assembly you ever load in memory alongside the metadata, so that eats up a ton of memory. |
hmm after removing libraries I have: methodsToAnalyze.Count = 61889 ?? |
This should be no memory problem (I have 8GB RAM and i7/1TB HD). I have to read how to add to stub list (do you have sample hot to do this?) |
Since JSILc is a 32-bit executable, .NET won't allow it to use more than roughly 2GB of memory. Running it as a 64-bit executable would let it use more of your machine's memory but right now that isn't supported. There are two ways to stub an assembly. The first is via the command line: --stub: For example, to ignore all the 'Microsoft.Build' assemblies, you would do: --stub: Microsoft.Build.* You can do this permanently by adding regexes to the Stubbed list in a .jsilconfig file. The included defaults.jsilconfig file (that JSILc loads by default) includes four regexes, so you can add new ones there. It's JSON, so you can look up the syntax anywhere. Note that stubbing won't completely eliminate memory usage from an assembly. It still has to be loaded and scanned for type information, in case your code uses it. |
If you have a chance, please try translating this app again with the latest version of JSIL. Memory usage has dramatically improved so that might address some of your problems (especially if you manage to stub out or ignore libraries you don't care about). |
Of course. I'll check it tomorrow or the day after. |
Hi,
When I try to convert XNA game using JSILc I'm getting this error:
// Building 'C:\prywatne\FunApp\XGame\Wp7\XGame.sln' ... done.
// Applied settings from 'defaults.jsilconfig'.
// Loaded C:\prywatne\FunApp\XGame\Wp7\Platformer\Platformer\bin\Windows Phone\Debug\XGame.dll
// Could not load module Microsoft.Devices.Sensors, Version=7.0.0.0, Culture=neutral, PublicKeyToken=24eec0d8c86cda1e: Failed to resolve assembly: 'Microsoft.Devices.Sensors, Version=7.0.0.0, Culture=neutral, PublicKeyToken=24eec0d8c86cda1e
'
// Loaded C:\Windows\Microsoft.NET\assembly\GAC_32\Microsoft.Xna.Framework.Game\v4.0_4.0.0.0__842cf8be1de50553\Microsoft.Xna.Framework.Game.dll
// Loaded C:\prywatne\FunApp\XGame\Wp7\Platformer\Platformer\bin\Windows Phone\Debug\FarseerPhysicsXNA.dll
// Loaded C:\Windows\Microsoft.NET\assembly\GAC_32\Microsoft.Xna.Framework.Graphics\v4.0_4.0.0.0__842cf8be1de50553\Microsoft.Xna.Framework.Graphics.dll
// Loaded C:\Windows\Microsoft.NET\assembly\GAC_32\Microsoft.Xna.Framework\v4.0_4.0.0.0__842cf8be1de50553\Microsoft.Xna.Framework.dll
// Loaded C:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll
Unhandled Exception: System.AggregateException: One or more errors occurred. ---> System.NullReferenceException: Object reference not set to an instance of an object.
at JSIL.AssemblyTranslator.<>c__DisplayClassf.b__b(Int32 i) in E:\GitHub\JSIL\JSIL\AssemblyTranslator.cs:line 227
at System.Threading.Tasks.Parallel.<>c__DisplayClassf
1.<ForWorker>b__c() at System.Threading.Tasks.Task.InnerInvoke() at System.Threading.Tasks.Task.InnerInvokeWithArg(Task childTask) at System.Threading.Tasks.Task.<>c__DisplayClass7.<ExecuteSelfReplicating>b__ 6(Object ) --- End of inner exception stack trace --- at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceled Exceptions) at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken) at System.Threading.Tasks.Parallel.ForWorker[TLocal](Int32 fromInclusive, Int32 toExclusive, ParallelOptions parallelOptions, Action
1 body, Action2 bodyWithState, Func
4 bodyWithLocal, Func1 localInit, Action
1 localFinally)at System.Threading.Tasks.Parallel.For(Int32 fromInclusive, Int32 toExclusive, ParallelOptions parallelOptions, Action`1 body)
at JSIL.AssemblyTranslator.LoadAssembly(String path, Boolean useSymbols, Boolean includeDependencies) in E:\GitHub\JSIL\JSIL\AssemblyTranslator.cs:line 0
at JSIL.AssemblyTranslator.LoadAssembly(String path) in E:\GitHub\JSIL\JSIL\AssemblyTranslator.cs:line 116
at JSIL.AssemblyTranslator.Translate(String assemblyPath, Boolean scanForProxies) in E:\GitHub\JSIL\JSIL\AssemblyTranslator.cs:line 260
at JSIL.Compiler.Program.Main(String[] arguments) in E:\GitHub\JSIL\Compiler\Program.cs:line 253
The text was updated successfully, but these errors were encountered: