I have a p2p app for file transfers using TCP. I am trying to send a DLL file and use reflection to read classes from it using Assembly.LoadFile("file directory") and i get the good old BadImageFormatException.
When I run the same file generated on this PC it works smoothly, but after i transfer it using the p2p it doesn't work.
I have tested files of bigger and smaller sizes than the file in question, and they transfer properly with no missed bytes.
For making the file i'm using File.WriteAllBytes() with the received bytes from the other peers. The other files I have tested were .txt and .xml formats and they worked well.