Currently the source map generator sets the sourceRoot to the empty string. However, the sources are relative paths to the C# files from the project directory.
If building and debugging in the same repo (standard development workflow), the sourceRoot property should be set to the project path. This allows the debugger to locate the source files.
Example: for a project at "/MyRepo/Applications/MyCoolApp" the source map should be:
I tested these changes using vscode with chrome remote debugging and verified it was able to find my code files with the sourceRoot set.
There could be cases in which you might want the sourceRoot to be different than the project directory - E.g. building and debugging in different environments. However, I don't think leaving it empty makes sense. By defaulting to the project directory the source maps will work for most development workflows.
@theolivenbaum any thoughts on this change? I'm open to suggestions. I've tested this out and it works great for us. We would love to see this merged in.
Currently the source map generator sets the
sourceRoot
to the empty string. However, thesources
are relative paths to the C# files from the project directory.Example of current source map:
If building and debugging in the same repo (standard development workflow), the sourceRoot property should be set to the project path. This allows the debugger to locate the source files.
Example: for a project at "/MyRepo/Applications/MyCoolApp" the source map should be:
I tested these changes using vscode with chrome remote debugging and verified it was able to find my code files with the sourceRoot set.
There could be cases in which you might want the sourceRoot to be different than the project directory - E.g. building and debugging in different environments. However, I don't think leaving it empty makes sense. By defaulting to the project directory the source maps will work for most development workflows.