BUTR/Bannerlord.Module.Template

Breakpoint warnings In "base.OnSubModuleLoad();"

HeiDaShuai666 opened this issue · 8 comments

I successfully ran the MOD function content in the game, but I was unable to use breakpoints.
Visual Studio 2022
Even the first sentence cannot be interrupted, for example " base.OnSubModuleLoad(); ".
Breakpoint warnings, "No Symbols have been loaded for this document".
the Modules window (Debug > Windows > Modules) ,all module isn't loaded.
Is there anyone like me?
What should I do?

Was Debug configuration used? Was the game path set correct?
If speaking in basic steps, if the correct Game Folder is set when creating, the build & run actions should copy the newly created project to the game's /Modules directory and run the game with the mod enabled. The debugging feature should work in this case.

"the build & run actions should copy the newly created project to the game's /Modules directory and run the game with the mod enabled." These have indeed been implemented,
but breakpoint warnings, "No Symbols have been loaded for this document".
The Modules window (Debug > Windows > Modules) ,all module isn't loaded.

I used Bannerlord. Module. Templat again to create a new project without adding any new code and ran it directly. The game started, but the breakpoint for 'base. OnSubModuleLoad();' was not triggered.
I can use breakpoints using dnSpy, The startup setting is to copy vs2022. 0.0

Visual Studio 2022 and Bannerlord have both been uninstalled and reinstalled.

Was Debug configuration used? Was the game path set correct? If speaking in basic steps, if the correct Game Folder is set when creating, the build & run actions should copy the newly created project to the game's /Modules directory and run the game with the mod enabled. The debugging feature should work in this case.

I resolved the issue and finally installed version 1.3.1.71. The target framework must be ". NET Framework 4.7.2", and all debugging can proceed normally.
dotnet new install Bannerlord.Templates::1.3.1.71
Game version 1.1.4, Windows 10, Visual Studio 2022

Was Debug configuration used? Was the game path set correct? If speaking in basic steps, if the correct Game Folder is set when creating, the build & run actions should copy the newly created project to the game's /Modules directory and run the game with the mod enabled. The debugging feature should work in this case.

I resolved the issue and finally installed version 1.3.1.71. The target framework must be ". NET Framework 4.7.2", and all debugging can proceed normally. dotnet new install Bannerlord.Templates::1.3.1.71 Game version 1.1.4, Windows 10, Visual Studio 2022

Sorry, I didn't had the time to test it myself!
So when netstandard2.0 is used the breakpoints are not hit?

and all debugging can proceed normally.

Was Debug configuration used? Was the game path set correct? If speaking in basic steps, if the correct Game Folder is set when creating, the build & run actions should copy the newly created project to the game's /Modules directory and run the game with the mod enabled. The debugging feature should work in this case.

I resolved the issue and finally installed version 1.3.1.71. The target framework must be ". NET Framework 4.7.2", and all debugging can proceed normally. dotnet new install Bannerlord.Templates::1.3.1.71 Game version 1.1.4, Windows 10, Visual Studio 2022

Sorry, I didn't had the time to test it myself! So when netstandard2.0 is used the breakpoints are not hit?

I don't know if everyone is like this,
When I use Netstandard2.0 to debug, the Modules window (Debug>Windows>Modules), all modules are not loaded, let alone breakpoints.
As mentioned in this website, 'No Symbols have been loaded for this document', 'If your module is not loaded, check the following to find the cause:', 'Check to see that you're debugging the right code...'.
https://learn.microsoft.com/en-us/troubleshoot/developer/visualstudio/debuggers/troubleshooting-breakpoints?view=vs-2022
I tried to start game first and use vs2022 to attach to the process, displaying Managed (.NET 4.x), all modules are loaded.
If I use netstandard2.0 vs2022 to debug the game, it will display Managed (.NET Croe.NET 5+), all module isn't loaded.

So I tried using the ".NET Framework 4.7.2" to debug the game, displaying Managed (.NET 4.x), all modules are loaded. and all debugging can proceed normally.

Oh! Were you using BLSE or the standard executable?

Oh! Were you using BLSE or the standard executable?

  "profiles": {
    "Bannerlord": {
      "commandName": "Executable",
      "executablePath": "$(GameFolder)\\bin\\Win64_Shipping_Client\\Bannerlord.exe",
      "commandLineArgs": "/singleplayer _MODULES_*Bannerlord.Harmony*Native*SandBoxCore*CustomBattle*Sandbox*StoryMode*$(ModuleName)*_MODULES_  /continuegame",
      "workingDirectory": "$(GameFolder)\\bin\\Win64_Shipping_Client"
    }
  }

The standard executable,I am still studying Artisan Workshop Mod Tutorial. Ha ha ha