- Home /
How do you show C# line numbers in a WebGL build's stack trace?
We have a WebGL build of our C# Unity app that is throwing exceptions. We have enabled "Full Exceptions" and are executing the app via Build and Run. When we get a call stack it contains the names of the functions being called, but no C# line numbers. For example:
DirectoryNotFoundException: Directory 'http:/localhost:51972/../Icons' not found.
System.IO.Directory.GetFileSystemEntries (System.String path, System.String searchPattern, FileAttributes mask, FileAttributes attrs)
System.IO.Directory.GetDirectories (System.String path, System.String searchPattern)
System.IO.Directory.GetDirectories (System.String path)
OurAppName.SetupIcons ()
OurAppName.Start ()
If the same call stack appeared inside the editor we would get C# line numbers. Is there a way to get the C# line numbers to appear inside the JavaScript Console (or anywhere for that matter)?
Thank you so much for anybody that can assist!
Note: For those that immediately see the problem in this stack trace above we know why it's failing, it's just being used as an example.
Answer by Schubkraft · Jul 27, 2015 at 10:20 AM
There is no way to do that, sorry. That information is lost in the IL2CPP/emscripten steps of the compilation.
That is really too bad. Hopefully there will be some form of symbols/metadata/whatever to enable this in the future, the debugging story is very difficult without line numbers.
Thank you @schubkraft for the reply.
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Distribute terrain in zones 3 Answers
MongoDb in Unity WebGL 0 Answers
Issue with shaders and WebGL 1 Answer
Is there a way to load resources with unkown case (.png/.PNG) using www objects? 1 Answer