Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AssertionFailedException in BamlDecompiler.Baml.SizedBamlRecord.Read #1483

greenozon opened this Issue Apr 11, 2019 · 2 comments


None yet
2 participants
Copy link

greenozon commented Apr 11, 2019

ILSpy version

go to any .g.baml record from resources:

   at ICSharpCode.ILSpy.ILSpyTraceListener.Fail(String message, String detailMessage)
   at ICSharpCode.ILSpy.ILSpyTraceListener.Fail(String message)
   at System.Diagnostics.TraceInternal.Fail(String message)
   at System.Diagnostics.Debug.Assert(Boolean condition)
   at ILSpy.BamlDecompiler.Baml.SizedBamlRecord.Read(BamlBinaryReader reader)
   at ILSpy.BamlDecompiler.Baml.BamlReader.ReadDocument(Stream str, CancellationToken token)
   at ILSpy.BamlDecompiler.BamlResourceEntryNode.LoadIntoDocument(PEFile module, IAssemblyResolver assemblyResolver, Stream stream, CancellationToken cancellationToken)
   at ILSpy.BamlDecompiler.BamlResourceEntryNode.LoadBaml(AvalonEditTextOutput output, CancellationToken cancellationToken)
   at ILSpy.BamlDecompiler.BamlResourceEntryNode.<>c__DisplayClass1_1.<View>b__2()


PS works (decodes) fine in dnSpy 604


This comment has been minimized.

Copy link

siegfriedpammer commented Apr 11, 2019

I get the same assertion in dnSpy. You probably did not use a debug build of dnSpy (thus no assertion).
Not sure how the BAML was generated, but the length of the record is definitely wrong, the BAML says it's 6 however the actual length of the record is 8: 2 bytes (short) + 4 bytes (string) + 1 byte (prefixed string length) + 1 byte (record length).

You can safely ignore this assertion.


This comment has been minimized.

Copy link

greenozon commented Apr 12, 2019

dnSpy project does not release debug builds, are you building by hands?
most probably baml was a bit eaten by obfuscator with a known aim to make life harder :)
and yeah - thanks for details on the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.