G
Guest
I've found that My.Computer.FileSystem.WriteAllText in .Net 2.0 writes three
additional, non-text bytes in front of the string it's supposed to be
writing. These bytes are not in the normal text range of values, and don't
show up if you load the file into Notepad or other text viewers, but can be
easily seen with Visual Studio 2005's Binary editor. Additionally, if you use
this method to write out an HTML file to be embedded in other HTML (like an
Outlook signature), these bytes get rendered. Finding this bug was a pain, to
say the least. I have an example VS2005 solution folder which shows the bug,
and would be happy to send it to someone at MS if anyone is interested, but
you can verify in about 2 minutes with a simple "Hello World!" output to a
new text file using the above method.
additional, non-text bytes in front of the string it's supposed to be
writing. These bytes are not in the normal text range of values, and don't
show up if you load the file into Notepad or other text viewers, but can be
easily seen with Visual Studio 2005's Binary editor. Additionally, if you use
this method to write out an HTML file to be embedded in other HTML (like an
Outlook signature), these bytes get rendered. Finding this bug was a pain, to
say the least. I have an example VS2005 solution folder which shows the bug,
and would be happy to send it to someone at MS if anyone is interested, but
you can verify in about 2 minutes with a simple "Hello World!" output to a
new text file using the above method.