I had a look in your code and I guess you have the same problem like here: https://github.com/dotnet/runtime/issues/1442 I'm searching for a small tool which don't mess up with this.