PDB lock
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:
- Go to Debug | Options
- Go to Debugging | Symbols
- Select "Load only specified modules"
- In the dialog, add your executable
- 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.