Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Code not loading symbols on OS X

I am trying to set up a web api using ASP.NET Core on OS X. I have set up my environment correctly (I think) and I'm able to build and run my application using dotnet build from the terminal, and I'm able to start debugging from Visual Studio Code with breakpoints working as expected. My problem is that I receive an error when trying to query my Sqlite database using EF core. EF core is not really important here, because when I am debugging and trying to find out what the error is, I don't get any stack trace. When I step over the failing code the debug console prints:

Exception thrown: 'System.InvalidOperationException' in Microsoft.EntityFrameworkCore.dll
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/1.0.0/System.Diagnostics.StackTrace.dll'. Cannot find or open the symbol file.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/1.0.0/System.Reflection.Metadata.dll'. Cannot find or open the symbol file.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/1.0.0/System.IO.MemoryMappedFiles.dll'. Cannot find or open the symbol file.
Loaded '/usr/local/share/dotnet/shared/Microsoft.NETCore.App/1.0.0/System.IO.UnmanagedMemoryStream.dll'. Cannot find or open the symbol file.

A lot of these Cannot find or open the symbol file. are printed at startup as well. I have checked that the files are at the location specified, and that there shouldn't be any read access problem (having started vs code with sudo code . and even done a sudo chmod 777 * in the folder in question).

So, any ideas why the symbols aren't loaded?

like image 370
Erik Avatar asked Jul 13 '16 11:07

Erik


People also ask

How do you get Symbols in VS Code?

Go to Symbol# You can navigate symbols inside a file with Ctrl+Shift+O. By typing : the symbols will be grouped by category. Press Up or Down and navigate to the place you want.

How do I see loaded Symbols in Visual Studio?

In Visual Studio, open Tools > Options > Debugging > Symbols (or Debug > Options > Symbols).

How do I fix No Symbols have been loaded for this document?

"No Symbols have been loaded for this document"Go to the Modules window (Debug > Windows > Modules) and check whether your module is loaded. If your module is loaded, check the Symbol Status column to see whether symbols have been loaded.


1 Answers

Ran into the same issues running VS Code on a Windows 10 VM.

The resolution I found was to add a "debugType": "portable" setting to the buildOptions section of my project.json file.

Mine looks like this:

"buildOptions": {
    "emitEntryPoint": true,
    "preserveCompilationContext": true,
    "debugType": "portable"
}

Debugging in VS Code isn't that bad actually.

like image 58
Brendan Green Avatar answered Sep 30 '22 01:09

Brendan Green