I finally got the program to work using Writeline.
The problem was that I was never setting the dimension of the array Ifamsp() which is an element in the structure.
Apparently this was allowing the data to be corrupted.

But I was never able to get the Serialization to write anything to the file. No error messages - just didn't put anything in the file.