DragonflightDesign
Resource contributor
- Messages
- 1,138
- Country
The instructions for debugging WASM gauges in the SDK is... somewhat lacking in completeness. They imply (actually, pretty much state) that once you have attached the debugger to MSFS you do not need to disconnect it for that session. This is not so. If you don't disconnect it, you will never get an updated .pdb file copied to the project folder. The result of that will be that the debugger cannot connect to the updated WASM module.
From SU12 onwards you must also do the following:
1. Start Steam
2. Find MSFS in your library and right-click | select Properties
3. Add the following to the Launch Options box:
-FastLaunch -AllowDebugger
The first bypasses the Asobo screens and is optional, but you MUST have -AllowDebugger. If you do not, then any attempt to attach a debugger to MSFS will crash the sim. No, it's not in the SDK but it is in the SU12 update notes.
From the top:
1. (Optional) Open Windows Explorer to C:\Users\<username>\AppData\Roaming\Microsoft Flight Simulator\packages\
2. Build your WASM module and copy it to the (...)\PackageSources\SimObjects\Airplanes\<myAircraft>\panel\ folder
3. Start MSFS
4. Attach the debugger any time after the sim starts displaying the splash screens (from the Visual Studio menu, Debug | Attach to Process | select FlightSimulator.exe)
5. Once you arrive at the main menu, build your project from the Devmode menu (File | etc.)
6. Load/create a scenario with the new aircraft in it. As MSFS compiles the WASM module to a debug .dll, if you have done step (1) then you will see a new folder appear with the name of your aircraft. In that folder you will see a bunch of files all with the same cryptic name but with different suffixes: .dll, .cache, .obj, .lib, .pdb and .natvis. There is also a sub-folder called 'work' but I've never seen anything in that yet
7. Start the flight. If all has gone well, the breakpoints in the debugger should now attach to the .dll and .pdb files.
To update the WASM module:
8. Detach the debugger from MSFS (Visual Studio Debug | Stop Debugging)
9. Build your WASM module and copy it to the (...)\PackageSources\SimObjects\Airplanes\<myAircraft>\panel\ folder
10 (Optional) Manually delete the files from the C:\Users\<username>\AppData\Roaming\Microsoft Flight Simulator\packages\<myProject> folder. This at least ensures that you know the compiled files will be up to date
11. Build your project from the Devmode menu (File | (...))
12. Re-attach the debugger
13. Start the scenario.
If you're not afraid of experimental stuff, see also this topic on the MSFS dev forum:-
EDITED TO REMOVE DEAD LINK.
My guess is this will become standard at some point.
-Dai
From SU12 onwards you must also do the following:
1. Start Steam
2. Find MSFS in your library and right-click | select Properties
3. Add the following to the Launch Options box:
-FastLaunch -AllowDebugger
The first bypasses the Asobo screens and is optional, but you MUST have -AllowDebugger. If you do not, then any attempt to attach a debugger to MSFS will crash the sim. No, it's not in the SDK but it is in the SU12 update notes.
From the top:
1. (Optional) Open Windows Explorer to C:\Users\<username>\AppData\Roaming\Microsoft Flight Simulator\packages\
2. Build your WASM module and copy it to the (...)\PackageSources\SimObjects\Airplanes\<myAircraft>\panel\ folder
3. Start MSFS
4. Attach the debugger any time after the sim starts displaying the splash screens (from the Visual Studio menu, Debug | Attach to Process | select FlightSimulator.exe)
5. Once you arrive at the main menu, build your project from the Devmode menu (File | etc.)
6. Load/create a scenario with the new aircraft in it. As MSFS compiles the WASM module to a debug .dll, if you have done step (1) then you will see a new folder appear with the name of your aircraft. In that folder you will see a bunch of files all with the same cryptic name but with different suffixes: .dll, .cache, .obj, .lib, .pdb and .natvis. There is also a sub-folder called 'work' but I've never seen anything in that yet
7. Start the flight. If all has gone well, the breakpoints in the debugger should now attach to the .dll and .pdb files.
To update the WASM module:
8. Detach the debugger from MSFS (Visual Studio Debug | Stop Debugging)
9. Build your WASM module and copy it to the (...)\PackageSources\SimObjects\Airplanes\<myAircraft>\panel\ folder
10 (Optional) Manually delete the files from the C:\Users\<username>\AppData\Roaming\Microsoft Flight Simulator\packages\<myProject> folder. This at least ensures that you know the compiled files will be up to date
11. Build your project from the Devmode menu (File | (...))
12. Re-attach the debugger
13. Start the scenario.
If you're not afraid of experimental stuff, see also this topic on the MSFS dev forum:-
EDITED TO REMOVE DEAD LINK.
My guess is this will become standard at some point.
-Dai
Last edited: