c# - OmniSharp 智能感知无法识别新的类文件

标签 c# .net-core visual-studio-code omnisharp

我有一个从 cli 生成的 dotnet core 控制台应用程序dotnet new console -n EODG.VsCodeTester.Cli使用 C# Extensions扩展,我右键单击 VSCode 中的项目文件夹,然后单击“新建 C# 类”。
类/文件打开得很好,但 Omnisharp 似乎无法识别文件/类。来自 Program.cs ,该类没有出现在代码完成中,并且新类中的codelens没有出现。
以下是从 OmniSharp 日志中输出的...

[info]: OmniSharp.Roslyn.CSharp.Services.Completion.CompletionService
        Could not find document for file c:\Users\elrod\src\test\src\EODG.VsCodeTester.Cli\Cat.cs
现在,如果我重新启动 OmniSharp,它会很好地识别新文件......但是每次创建新类/接口(interface)或重命名它们时重新启动omnisharp 会很痛苦。我以前从未见过这种情况,而且我从 v1.1 开始就一直在 vscode 中进行 dotnet core 开发。
我试过谷歌搜索OmniSharp "Could not find document for file" ...它说No results found for OmniSharp "Could not find document for file". ……所以,这很好。
相关细节
  • 操作系统:Windows 10(全新安装... 不到 2 小时)
  • VSCode 版本:1.50.1
  • OmniSharp 版本:1.23.5
  • 点网版本:3.1.403

  • 我将非常乐意提供我能提供的任何其他细节。
    谢谢大家!

    最佳答案

    看起来 OmniSharp 版本 1.23.5 可能会被破坏......我恢复到版本 1.23.3,现在一切正常。可能与 this issue 有关在他们的 git repo 上。
    更新:更新到 v1.23.6 解决了这个问题。

    关于c# - OmniSharp 智能感知无法识别新的类文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64689585/

    相关文章:

    c# - 我可以在 ValueTuple 中返回泛型类型吗?

    c# - Crystal Report ASP.NET MVC 中不显示本地镜像

    asp.net-core - aspnet 核心 2.0 dotnet 运行时出现警告

    c# - 净核心: ManagementObjectSearcher throws exception on initializing

    spring-boot - 如何在 Visual Studio 代码中运行 Spring Boot 应用程序?有可能吗?

    typescript - 使用 spec/test 文件夹设置 tsconfig

    c# - 在当前页面找到一个控件

    c# - 空的 ASP.NET Core (.NET 5.0) 项目对针对其执行的每个请求持续使用更多 RAM

    asp.net - IdentityServer3 仅在移动设备上登录时持续重定向

    typescript - 在 VS Code 中显示 Typescript 类层次结构