Currently the compiler will rewrite the assembly at the MSIL level, one of the most annoying things is that this break debugging the dll for multiple reasons:
(1) MVID is changed, but this can be hacked back in
(2) Portable PDBs are not supported during rewriting, so cross-platform scenarios suffer, which is mostly why this project exists.
Given (1) and (2) having another option (/source) where we take in the PInvoke declarations as C# code and analyze it to produce a dll will solve the debugging issue. However it will come with an additional assembly reference -- something like YourProjectPInvokeHelpers.dll because we need to still generate a set of instructions not supported by the C# compiler.