My BotFarm.exe crashes :(
sout12 opened this issue · comments
@sout12 : make BotFarm.exe use Windows Administrator permissions via the Compatibility tab.
I got a similar error message before I did that, because I use the C:\Program Files\TrinityCore\ folder:
Unhandled Exception: System.InvalidOperationException: There was an error generating the XML document. ---> System.IndexOutOfRangeException: Index was outside the bounds of the array.
at Microsoft.Xml.Serialization.GeneratedAssembly.XmlSerializationWriterList1.Write3_ArrayOfBotInfo(Object o)
--- End of inner exception stack trace ---
at System.Xml.Serialization.XmlSerializer.Serialize(XmlWriter xmlWriter, Object o, XmlSerializerNamespaces namespaces, String encodingStyle, String id)
at System.Xml.Serialization.XmlSerializer.Serialize(TextWriter textWriter, Object o, XmlSerializerNamespaces namespaces)
at BotFarm.BotFactory.SaveBotInfos() in C:\projects\botfarm\BotFarm\BotFactory.cs:line 262
at BotFarm.BotFactory.SetupFactory(Int32 botCount) in C:\projects\botfarm\BotFarm\BotFactory.cs:line 218
at BotFarm.Program.Main(String[] args) in C:\projects\botfarm\BotFarm\Program.cs:line 19
After setting BotFarm.exe to run as Administrator, the error disappeared.
Edit: I would also recommend using a shorter path with less spaces and punctuation in the folder names, because long paths can all too often make error troubleshooting more difficult.
If your problem was solved by using the suggested solution, please close this issue. 🐢
Probably better to handle the exception if this issue happens to users, showing at least a short message like "Permission denied creating new files, try running it as Administrator"
Lol, don't close issues I reopened, I want to handle this exception.
a5dab30
next time it's going to write a more understandable message