24.01.2016, 15:19 | #1 |
Участник
|
Axilicious:CombineXpos.exe Length cannot be less than zero
Источник: http://www.ksaelen.be/wordpresses/dy...ess-than-zero/
============== When I was using the combineXPOs.exe executable the other day on a new project, I ran into an issue. The error message thrown by the tool was the following: CombineXPOs.exe : Warning [-5] CombineXPOs.exe : Error [] Length cannot be less than zero. I remembered that Martin Dráb ran into the same error previously so I went to take a look at his blog post on this type of error. In his post, he explains this might be because of empty / corrupted XPO files and indeed, this error pops up when you either have an empty XPO file or a (corrupted) shared project node that contains no objects. Removing 2 of 6000+ XPO files that turned out to be empty indeed helped and the tool got further in the list of XPO files. But wait, it still gave the same error message?! So what was different here? I saw that the error code being returned was not -4, but -5. And I did not have empty XPO files anymore. And on top of that, now it was the directory with all the Shared Project XPO files that returned errors. I couldn’t see right away what the issue was here, so I decided to peek into the executable and reverse engineer a C# project out of it. The I stepped through the process of combining a single file and managed to see what was going on. Somewhere inside there, there is an XPOReader class that opens the XPO files and looks at the encoding of the files. X++: if (fileStream.Length > 3L &&(int)numArray[0] == 239 && ((int)numArray[1] == 187 && (int)numArray[2] == 191)) { this.fileEncoding = (Encoding)this.utf8Encoding; num1 = 1; } else { this.fileEncoding = Encoding.GetEncoding(1252); } X++: if (fileStream.Length > 3L && (int)numArray[0] == 239 && ((int)numArray[1] == 187 && (int)numArray[2] == 191)) { this.fileEncoding = (Encoding)this.utf8Encoding; num1 = 1; } else { // KeSae : Check for codepage UCS-2 LE if (numArray[0] == 0xFF && numArray[1] == 0xFE) { this.fileEncoding = Encoding.GetEncoding(1200); } else { this.fileEncoding = Encoding.GetEncoding(1252); } } Источник: http://www.ksaelen.be/wordpresses/dy...ess-than-zero/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору. Последний раз редактировалось mazzy; 25.01.2016 в 16:27. |
|
|
|