System.TypeInitializationException occurred

116 views
Skip to first unread message

Steven Taylor

unread,
Mar 18, 2015, 2:59:40 PM3/18/15
to fsharp-o...@googlegroups.com
Hi,

This problem went away when I changed the build target from F# 3.1 to 3.0.

Any clues on how to investigate this further (if necessary) so that I can at least provide some guidance on how to sort this issue out for future versions of F# would be much appreciated.

System.TypeInitializationException occurred
Message: A first chance exception of type 'System.TypeInitializationException' occurred in console.exe
Additional information: The type initializer for '<StartupCode$avn>.$Program' threw an exception.

thanks,
-Steven

Steven Taylor

unread,
Mar 18, 2015, 8:50:06 PM3/18/15
to fsharp-o...@googlegroups.com
just for reference... it seems to be merely an uncaught exception raised with failwith that was causing this.  

The returned message + drop into ILASM was misleading.  The System.TypeInitializationException made it look like a much more fundamental issue.  In this case I wrapped the offending code in a try-catch and placed returned details inside a DU.  

Pretty simple, but not intuitive.  The debugger refused to co-operate even if I loaded up external libraries + attached to the process.



Reply all
Reply to author
Forward
0 new messages