Visual Studio代码断点警告:源代码与原始版本不同 [英] Visual Studio Code Breakpoint warning: The source code is different from the original version

查看:840
本文介绍了Visual Studio代码断点警告:源代码与原始版本不同的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Visual Studio Code的新手.我正在尝试调试通过Git克隆的已经存在的应用程序.我的文件都没有被修改.我已经下载了Microsoft扩展"C#for Visual Studio Code(由OmniSharp支持)". 该应用程序启动,将我带到主页( http://localhost:5000/).但是它并没有在我启动时在我的断点处停止.

I'm very new to Visual Studio Code. I'm trying to debug an application that exists already that I've cloned via Git. None of my files are modified yet. I've downloaded the microsoft extension "C# for Visual Studio Code (powered by OmniSharp)". The application starts and it brings me to the home page (http://localhost:5000/). However it didn't stop at my breakpoints within startup.cs

当我在运行该应用程序时,它不是一个红色的项目符号,而是一个空心的灰色断点.将鼠标悬停在它上面会告诉我源代码与原始版本不同.要命中此断点:向launch.json添加"requireExactSource":false并重新启动调试..我不明白.

When I look at the application while its running instead of being a red bullet point its a hollow gray breakpoint. Hovering over it tells me "The source code is different from the original version. To allow this breakpoint to be hit: Add "requireExactSource":false to launch.json and restart debugging.". I can't understand this.

我正在使用:

  • Visual Code 1.17.1
  • Shell 1.7.7
  • 渲染器58.0.3029.110
  • 节点7.9.0
  • 体系结构 x64
  • Visual Code 1.17.1
  • Shell 1.7.7
  • renderer 58.0.3029.110
  • node 7.9.0
  • architecture x64

我也在使用dotnet版本1.0.3

I'm also using dotnet version 1.0.3

推荐答案

当我将项目从.NET Core 2.0升级到2.1时,这发生在我身上.问题是我忘记编辑launch.json来将二进制路径从netcoreapp2.0更改为netcoreapp2.1,因此VS Code在错误的位置寻找二进制文件.编辑路径可以解决此问题.

This happened to me when I upgraded my project from .NET Core 2.0 to 2.1. The problem was that I forgot to edit launch.json to change the binary path from netcoreapp2.0 to netcoreapp2.1 so VS Code was looking for binaries in the wrong place. Editing the path fixed the problem.

这篇关于Visual Studio代码断点警告:源代码与原始版本不同的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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