InvalidProgram exception with MSBuild 15

After upgrading to MSBuild 15 (specifically MSBuild v15.5.180.51428) and passing our assembly through Smart Assembly we get invalid IL and the program crashes. Attached is a small sample application that recreates the issue

Steps to recreate the problem
  • Rebuild the Sample application in release mode using MSBuild 15
  • Using the Sample.saproj project obfuscate the assembly (output is bin\obfuscated\Sample.exe)
  • Run the assembly that is generated and you will get an InvalidProgramException (sample error is in the root of the attached zip)
  • Run peverify on the generated assembly and it will report an error

    [IL]: Error: [Sample.exe : Sample.StringEqualityComparer::.ctor][offset 0x00000012] Attempt to enter a try block with nonempty stack.

  • If you rebuild the same application using an earlier version of MSBuild (we have tried v12 and v4) and follow the above steps the application does not raise an exception

From our investigation it appears to be related to the Error Reporting feature of SmartAssembly.

Note we get the same error with both v6.10.0.218 and v6.11.2.609 versions of SmartAssembly.
Tagged:

Answers

Sign In or Register to comment.