Pyrdacor / Ambermoon.net

Ambermoon rewrite in C#
GNU General Public License v3.0
424 stars 22 forks source link

[Bug report] Debugging on Windows throws error #348

Closed midwan closed 1 year ago

midwan commented 1 year ago

Describe the bug Trying to debug the solution on Windows (VS 2022), throws an error on startup:

Unable to find file 'AM2_CPU'.
   at Ambermoon.Data.Legacy.GameData.<Load>g__HandleFileNotFound|54_1(String file, Char disk, <>c__DisplayClass54_0&) in D:\Github\Ambermoon.net-midwan\Ambermoon.Data.Legacy\GameData.cs:line 545
   at Ambermoon.Data.Legacy.GameData.Load(Func`2 fileLoader, Func`2 diskLoader, Func`2 fileExistChecker, Boolean savesOnly) in D:\Github\Ambermoon.net-midwan\Ambermoon.Data.Legacy\GameData.cs:line 654
   at Ambermoon.Data.Legacy.GameData.Load(String folderPath, Boolean savesOnly) in D:\Github\Ambermoon.net-midwan\Ambermoon.Data.Legacy\GameData.cs:line 477
   at Ambermoon.GameWindow.ShowVersionSelector(BinaryReader builtinVersionReader, Action`4 selectHandler, TextureAtlasManager& createdTextureAtlasManager) in D:\Github\Ambermoon.net-midwan\Ambermoon.net\GameWindow.cs:line 929
   at Ambermoon.GameWindow.Window_Load() in D:\Github\Ambermoon.net-midwan\Ambermoon.net\GameWindow.cs:line 1258
   at Silk.NET.Windowing.Internals.ViewImplementationBase.Initialize()
   at Silk.NET.Windowing.WindowExtensions.Run(IView view)
   at Ambermoon.GameWindow.Run(Configuration configuration) in D:\Github\Ambermoon.net-midwan\Ambermoon.net\GameWindow.cs:line 1620
   at Ambermoon.Program.Main() in D:\Github\Ambermoon.net-midwan\Ambermoon.net\Program.cs:line 67
Press return to exit

To Reproduce Steps to reproduce the behavior:

  1. Select a Debug configuration / Any CPU
  2. Start with Debugging
  3. See error

Expected behavior I would expect to be able to start the solution with debugging, without errors :)

Pyrdacor commented 1 year ago

You have two options here. Either copy the file "versions.dat" from the root folder to the sub-folder Ambermoon.net (the main project). Or you have to provide original game data. I would suggest the former as it also enables the version selector.

Pyrdacor commented 1 year ago

Did it work?

midwan commented 1 year ago

Yes, that worked, thanks. I'm thinking if that should be part of the Project build steps, to automate it

Pyrdacor commented 1 year ago

I will add it as a build dependency.

Pyrdacor commented 1 year ago

I moved the versions.dat to the project dir so this should work now with a clean repo etc.