Visual Studio代码不加载OS X上的符号 [英] Visual Studio Code not loading symbols on OS X

查看:222
本文介绍了Visual Studio代码不加载OS X上的符号的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在OS X上使用ASP.NET Core设置一个Web api。我已经正确设置了我的环境(我认为),我可以使用构建和运行我的应用程序dotnet构建,我可以从Visual Studio代码开始调试,断点按预期工作。我的问题是当我使用EF核心查询我的Sqlite数据库时收到一个错误。 EF核心在这里并不重要,因为当我调试并尝试找出错误是什么,我没有得到任何堆栈跟踪。当我转载失败的代码,调试控制台打印:

 异常抛出:Microsoft.EntityFrameworkCore.dll中的'System.InvalidOperationException' 
加载'/usr/local/share/dotnet/shared/Microsoft.NETCore.App/1.0.0/System.Diagnostics.StackTrace.dll'。找不到或打开符号文件。
加载'/usr/local/share/dotnet/shared/Microsoft.NETCore.App/1.0.0/System.Reflection.Metadata.dll'。找不到或打开符号文件。
加载'/usr/local/share/dotnet/shared/Microsoft.NETCore.App/1.0.0/System.IO.MemoryMappedFiles.dll'。找不到或打开符号文件。
加载'/usr/local/share/dotnet/shared/Microsoft.NETCore.App/1.0.0/System.IO.UnmanagedMemoryStream.dll'。找不到或打开符号文件。

很多这些找不到或打开符号文件。 c $ c>也在启动时打印。我已检查文件是否在指定的位置,并且不应该有任何读取访问问题(已启动vs代码与 sudo代码。甚至完成一个 sudo chmod 777 * 在有问题的文件夹中)。



所以,任何想法为什么没有加载符号?

解决方案

在Windows 10 VM上运行VS代码的相同问题。



我发现的解决方案是将debugType:portable设置添加到 buildOptions 部分我的 project.json 文件。



我的样子如下所示:

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

调试VS代码实际上并不那么糟糕。 b $ b

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?

解决方案

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.

这篇关于Visual Studio代码不加载OS X上的符号的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆