Closed RononDex closed 3 years ago
What is going on is that the source file paths in your .pdb files are no longer full paths. I suspect what is going on is that you are compiling your code with the -pathmap
C# compiler option. I believe this would be controlled with the PathMap
msbuild property. I would suggest looking at an msbuild binary log if it isn't obvious why this is happening for your project. If you can't figure it out, or if you want your PDBs to have the partial paths, you can use the sourceFileMap
launch.json option to map these partial paths to full paths for VS Code.
Apparently there is also a 'ContinuousIntegrationBuild' msbuild property that can mess things up like this.
There is no such setting in our csproj or .props files.
Same Problem also appears in vim using omnisharp-vim
This isn't a debugger problem, so it will happen with any .NET debugger, at least to some degree based on how well the debugger deals with these partial paths.
Does this reproduce for you in a new 'hello world' project? If not, I would try using the msbuild binary log viewer output -- look at what options are being passed to the compiler.
It works in Rider, but not in any omnisharp IDE.
It works in other projects. And I just checked, even setting ContinuousIntegrationBuild
to false
in the .props files did not fix the problem. It used to work before.
Did you check if pathmap is passed to the compiler? You might also check that the compiler-produced assembly is the one that is being used, and not some sort of linker produced one.
PathMap is beeing passed as $(MSBuildThisFileDirectory)
Basically, we have a Directory.Build.Props in the root directory, containing
<Project>
<PropertyGroup>
<!--
Using solution dir is a bad practice and for example it breaks when building a csproj instead of a solution or if a solution is not in the root directory
Defining the root path in Directory.Build.props seems to be the prefered way to handle this, see https://github.com/Microsoft/msbuild/issues/2743#issuecomment-350391255
-->
<MonolithRootDir>$(MSBuildThisFileDirectory)</MonolithRootDir>
</PropertyGroup>
</Project>
And then a Common.props file referenced by all the csproj containing this:
<PathMap>$(MonolithRootDir)=/</PathMap>
However, even with the <PathMap>
removed and a dotnet clean
debug still does not work
Just ran a git bisect
on the repo. It appears its the git commit at fault that added said <PathMap>
Property
Was able to fix it now using sourceFileMap
"sourceFileMap": {
"/": "${workspaceFolder}/"
}
Issue Description
Steps to Reproduce
Start any project with debug (Asp .net core 2.2) and try to debug. Once it hits a debug point or an exception is cought:
Expected Behavior
It enters the debug point or breaks at the uncought exception
Actual Behavior
It can't find the file, even though it is open in the editor right now. (NOTE the ' at the end of the file name, the file exists without the ' at the end. However, the debugger tries to open the file with ' at the end of the filename and cant find it, resulting in the error message) --> Debugging is impossible right now
Logs
OmniSharp log
C# log
Environment information
VSCode version: 1.51.1 C# Extension: 1.23.6
Dotnet Information
.NET SDK (reflecting any global.json): Version: 5.0.100 Commit: 5044b93829 Runtime Environment: OS Name: Windows OS Version: 10.0.19041 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\5.0.100\ Host (useful for support): Version: 5.0.0 Commit: cf258a14b7 .NET SDKs installed: 2.1.801 [C:\Program Files\dotnet\sdk] 3.0.100 [C:\Program Files\dotnet\sdk] 3.1.103 [C:\Program Files\dotnet\sdk] 3.1.201 [C:\Program Files\dotnet\sdk] 3.1.301 [C:\Program Files\dotnet\sdk] 3.1.402 [C:\Program Files\dotnet\sdk] 3.1.404 [C:\Program Files\dotnet\sdk] 5.0.100 [C:\Program Files\dotnet\sdk] .NET runtimes installed: Microsoft.AspNetCore.All 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.1.23 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.1.23 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.3 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.9 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.10 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 5.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.23 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.3 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.9 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.10 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 5.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 3.1.3 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 3.1.5 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 3.1.9 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 3.1.10 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 5.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] To install additional .NET runtimes or SDKs: https://aka.ms/dotnet-downloadVisual Studio Code Extensions
|Extension|Author|Version| |---|---|---| |1987|annliu|0.3.1| |add-reference|adrianwilczynski|1.0.2| |auto-using|Fudge|0.7.15| |better-align|wwm|1.1.6| |Bookmarks|alefragnani|12.0.0| |calmness-vsc-theme|azamuddin|1.1.1| |city-lights-theme|yummygum|1.1.8| |code-settings-sync|Shan|3.4.3| |code-spell-checker|streetsidesoftware|1.10.2| |codesnap|adpyke|1.2.0| |csharp|ms-dotnettools|1.23.6| |csharp-grammar-extended|dannymcgee|1.1.1| |csharp-model-to-builder|frasercrosbie|0.1.2| |docomment|k--kato|0.1.19| |dotnet|formulahendry|0.0.4| |dotnet-core-essentials|KishoreIthadi|0.0.8| |dotnet-test-explorer|formulahendry|0.7.4| |EditorConfig|EditorConfig|0.16.4| |eva-theme|fisheva|1.0.1| |git-graph|mhutchie|1.28.0| |git-tree-compare|letmaik|1.10.0| |gitlens|eamodio|11.0.6| |gruvbox|jdinhlife|1.4.0| |horizon-theme-vscode|jolaleye|2.0.2| |jira-plugin|gioboa|0.22.2| |jupyter|ms-toolsai|2020.11.399280825| |latex-utilities|tecosaur|0.3.7| |latex-workshop|James-Yu|8.15.0| |material-icon-theme|PKief|4.4.0| |material-theme|zhuangtongfa|3.9.11| |mdx|silvenon|0.1.0| |midnight-city|dillonchanis|0.5.0| |msbuild-project-tools|tintoy|0.3.10| |mssql|ms-mssql|1.9.0| |namespace|adrianwilczynski|1.1.2| |noctis|liviuschera|10.39.1| |output-colorizer|IBM|0.1.2| |python|ms-python|2020.11.371526539| |python-extension-pack|donjayamanne|1.6.0| |rainbow-brackets|2gua|0.0.6| |slime|smlombardi|3.2.1| |sqltools|mtxr|0.23.0| |synthwave-vscode|RobbOwen|0.1.8| |team|ms-vsts|1.161.1| |theme-onedark|azemoh|0.6.0| |theme-panda|tinkertrain|1.3.0| |todo-tree|Gruntfuggly|0.0.188| |vim|vscodevim|1.18.0| |vscode-csharp-snippets|jorgeserrano|1.1.0| |vscode-docker|ms-azuretools|1.8.1| |vscode-mdx-preview|xyc|0.3.0| |vscode-nxunit-test-adapter|wghats|0.1.3| |vscode-peacock|johnpapa|3.9.1| |vscode-test-explorer|hbenl|2.19.3| |vscode-theme-hydra|juanmnl|3.1.0| |vscode-typescript-tslint-plugin|ms-vscode|1.2.3| |vscode-versionlens|pflannery|1.0.9| |xml|DotJoshJohnson|2.5.1|;