monogame-hotload icon indicating copy to clipboard operation
monogame-hotload copied to clipboard

PDB lock

Open ghost opened this issue 7 years ago • 0 comments

I wrote a similar hot reload system and then came across your video. I ended up finding a few different ways to get around the lock on the PDB file from the VS debugger, but the simplest is this:

  1. Go to Debug | Options
  2. Go to Debugging | Symbols
  3. Select "Load only specified modules"
  4. In the dialog, add your executable
  5. Uncheck "always load symbols located next to modules"

I load the symbols in via one of the overloads to Assembly.Load and breakpoints, etc. still work.

Also to avoid having to run two instances of the project I created an external command that just rebuilds the solution using msbuild externally and bound it to F6. Unfortunately this doesn't save all of the files before build, so I bound that to F7. At some point I'll have to read up on creating a plugin to do both on one keystroke.

I went the AppDomain approach but I still get a leak, apparently from the DataContract serializer I'm using, but I have yet to dig into it deeply.

ghost avatar Mar 28 '19 19:03 ghost