Compilation of Assembly failed due to difference in binary, blabla

To all who it might concern.

I just (again) came across a problem in Microsoft Dynamics NAV 2013 R2:

error CS1502: The best overloaded method match for ‘Microsoft.Dynamics.Nav.Runtime.ALStream.ALWrite(Microsoft.Dynamics.Nav.Runtime.INavStreamWriter, Microsoft.Dynamics.Nav.Types.DataError, bool, int)’ has some invalid arguments

Microsoft introduced new variable types (OemText and OemCode) but they did not create new overload functions for stream write/read.

So it is not possible anymore to write/read field content for text or code fields directly into/out of a stream.
The content of the field must be assigned to a text/code variable first before writing it into a stream.

So if anyone of you gets across this issue. This is the solution.

Thank you so much Thomas

Last week I face this error.