What are the challenges you face when working across database platforms? Take the survey

Dot net 2.0 x86 build

brett_eslerbrett_esler Posts: 6
edited February 27, 2014 5:17PM in SmartAssembly
I have a class library + dependencies build for x86 and dot net 2.0

SmartAssembly builds
- includes Dependencies Merging + Embedding
- Obfuscation
- Strings Encoding

All seems fine until I try to load from an x86 built exe - when I obtain error
"The type initializer for '<Module>' threw an exception."
Inner: "Common Language Runtime detected an invalid program."

I have requirement to force running as x86.

I have also tried building all libs for Any CPU.- it runs under x64 okay (loads+runs) - except for the parts that I need to be 32bit.

Any ideas?


  • Options
    Follow-up: I have worked around this by going back to version 3.2 of SmartAssembly which works just fine for x86 32bit builds of my libraries and calling exe - is this something that can be supported in the current version?
  • Options
    Jessica RJessica R Posts: 1,319 Rose Gold 4
    Hi Brett,

    Sorry to hear you're running into an issue with SA!

    I'm very glad you've found a workaround by downgrading, but I don't immediately know why this shouldn't work with the latest version 6.8--hopefully we can find an alternative workaround to downgrading. To help us better understand first what was going wrong, can I please check:

    (with 6.8..)

    -If you turn off all options and just process your assembly through SmartAssembly, does the error still occur then?

    -Should the simple SA-processed version still work, could you kindly try turning on merging/embedding, obfuscation, and strings encoding features one-by-one to see which particular one is causing the error?

    -Would you be able to share your application with us or a cut-down version? That would be the best way for us to troubleshoot this, but I understand if this isn't possible!

    Jessica Ramos | Product Support Engineer | Redgate Software

    Have you visited our Help Center?

  • Options
    Great advice - thanks for the help.

    The issue only arises when the Other Optimizations "I want to reduce unused allocated memory" option is checked (does that even make sense for class libraries?) - everything else merging, embedding, strings encoding etc work fine now.

    I have just been evaluating SmartAssembly and will be purchasing now (tell your boss ;)) - product is great, fora and support awesome :D

Sign In or Register to comment.