weixin_39965161
weixin_39965161
2020-12-02 19:12

After upgrading VSCode to 1.18.0, vscode show red error lines on almost every code line

After upgrading to 1.18.0, vscode show red error lines on almost every code line like at the screenshot.

Between, the project builds and runs properly. And idea?

image

该提问来源于开源项目:OmniSharp/omnisharp-vscode

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

17条回答

  • weixin_39877166 weixin_39877166 5月前

    image

    点赞 评论 复制链接分享
  • weixin_39846186 weixin_39846186 5月前

    Thanks and : One thing that your logs have in common is that you have VS 2017 RTM installed with none of the updates. Is it possible to update to the latest VS 2017 update? There have been four since RTM.

    点赞 评论 复制链接分享
  • weixin_39877166 weixin_39877166 5月前

    Updating now, I will let you know as soon as I can

    点赞 评论 复制链接分享
  • weixin_39877166 weixin_39877166 5月前

    updating VS 2017 to the latest has fixed the problem for me. Thank you for your help!

    点赞 评论 复制链接分享
  • weixin_39846186 weixin_39846186 5月前

    Excellent! I've filed https://github.com/OmniSharp/omnisharp-roslyn/issues/1014 to track this particular issue in OmniSharp.

    : Do you see the same?

    点赞 评论 复制链接分享
  • weixin_39965161 weixin_39965161 5月前

    , i will try it asap and let you know. Thanks for your help.

    点赞 评论 复制链接分享
  • weixin_39611031 weixin_39611031 5月前

    I would like to confirm that upgrading VS 2017 Community Edition to the latest version indeed fixes the problem. Also reporting that this particular error only appeared on 1.18.0

    点赞 评论 复制链接分享
  • weixin_39846186 weixin_39846186 5月前

    : Note that the issue is actually part of C# for VS Code 1.13, not VS Code 1.18. We will release a new version in the next day or two that addresses this issue.

    点赞 评论 复制链接分享
  • weixin_39965161 weixin_39965161 5月前

    , it worked for me too. Thanks again.

    点赞 评论 复制链接分享
  • weixin_39856055 weixin_39856055 5月前

    Is there a way to fix this issue WITHOUT upgrading Visual Studio 2017 to the latest version? The latest versions of Visual Studio 2017 are unstable with ReSharper; the last stable version is 15.2.

    点赞 评论 复制链接分享
  • weixin_39846186 weixin_39846186 5月前

    : There will be a new version of C# for VS Code in the next few days that should help address the issue by not allow OmniSharp to select VS 2017 RTM when locating MSBuild 15. However, it seems strange that R# would cause the latest releases of VS 2017 to become unstable. I've not heard of that.

    点赞 评论 复制链接分享
  • weixin_39965161 weixin_39965161 5月前

    image

    点赞 评论 复制链接分享
  • weixin_39877166 weixin_39877166 5月前

    I am having the same issue, the whole project is showing errors but still compiles correctly.

    点赞 评论 复制链接分享
  • weixin_39637363 weixin_39637363 5月前

    I have the same problem.

    点赞 评论 复制链接分享
  • weixin_39846186 weixin_39846186 5月前

    Hi! Could you provide your OmniSharp Log? Select View->Output from the menu to display the Output pane. Then, select "OmniSharp Log" from the drop-down in the top-right corner.

    点赞 评论 复制链接分享
  • weixin_39877166 weixin_39877166 5月前

    My log is:

    
    Starting OmniSharp server at 2017-11-9 12:22:50
        Target: c:\Projects\app
    
    OmniSharp server started
        Path: C:\Users\johnson_d\.vscode\extensions\ms-vscode.csharp-1.13.0\.omnisharp\OmniSharp.exe
        PID: 4512
    
    [info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
            Located 2 MSBuild instance(s)
                1: Visual Studio Professional 2017 15.0.26403.7 - "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin"
                2: StandAlone 15.0 - "C:\Users\johnson_d\.vscode\extensions\ms-vscode.csharp-1.13.0\.omnisharp\msbuild\15.0\Bin"
    [info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
            Registered MSBuild instance: Visual Studio Professional 2017 15.0.26403.7 - "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin"
    [info]: OmniSharp.Cake.CakeProjectSystem
            Detecting Cake files in 'c:\Projects\app'.
    [info]: OmniSharp.Cake.CakeProjectSystem
            Could not find any Cake files
    [info]: OmniSharp.DotNet.DotNetProjectSystem
            Initializing in c:\Projects\app
    [info]: OmniSharp.DotNet.DotNetProjectSystem
            Auto package restore: False
    [info]: OmniSharp.DotNet.DotNetProjectSystem
            Update workspace context
    [info]: OmniSharp.DotNet.DotNetProjectSystem
            Resolving projects references
    [info]: OmniSharp.MSBuild.MSBuildProjectSystem
            No solution files found in 'c:\Projects\app'
    [info]: OmniSharp.MSBuild.MSBuildProjectSystem
            Loading project: c:\Projects\app\app.csproj
    [info]: OmniSharp.MSBuild.MSBuildProjectSystem
            Update project: app
    [info]: OmniSharp.Script.ScriptProjectSystem
            Detecting CSX files in 'c:\Projects\app'.
    [info]: OmniSharp.Script.ScriptProjectSystem
            Could not find any CSX files
    [info]: OmniSharp.Stdio.Program
            Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpWorkspaceOptionsProvider
    [info]: OmniSharp.Stdio.Program
            Configuration finished.
    [info]: OmniSharp.Stdio.Program
            Omnisharp server running using Stdio at location 'c:\Projects\app' on host 5580.
    [fail]: OmniSharp.Roslyn.CSharp.Services.Refactoring.V2.GetCodeActionsService
            Error computing refactorings for Microsoft.CodeAnalysis.CodeRefactorings.ExtractMethod.ExtractMethodCodeRefactoringProvider
    System.NullReferenceException: Object reference not set to an instance of an object.
       at Microsoft.CodeAnalysis.ExtractMethod.MethodExtractor.Analyzer.WrapReturnTypeInTask(SemanticModel model, ITypeSymbol& returnType, Boolean& awaitTaskReturn)
       at Microsoft.CodeAnalysis.ExtractMethod.MethodExtractor.Analyzer.AdjustReturnType(SemanticModel model, ITypeSymbol returnType)
       at Microsoft.CodeAnalysis.ExtractMethod.MethodExtractor.Analyzer.<analyzeasync>d__10.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at Microsoft.CodeAnalysis.ExtractMethod.MethodExtractor.<extractmethodasync>d__13.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at Microsoft.CodeAnalysis.ExtractMethod.AbstractExtractMethodService`3.<extractmethodasync>d__2.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at Microsoft.CodeAnalysis.CodeRefactorings.ExtractMethod.ExtractMethodCodeRefactoringProvider.<getcodeactionasync>d__1.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at Microsoft.CodeAnalysis.CodeRefactorings.ExtractMethod.ExtractMethodCodeRefactoringProvider.<computerefactoringsasync>d__0.MoveNext()
    --- End of stack trace from previous location where exception was thrown ---
       at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
       at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
       at OmniSharp.Roslyn.CSharp.Services.Refactoring.V2.BaseCodeActionService`2.<collectrefactoringactions>d__13.MoveNext()
    </collectrefactoringactions></computerefactoringsasync></getcodeactionasync></extractmethodasync></extractmethodasync></analyzeasync>
    点赞 评论 复制链接分享
  • weixin_39846186 weixin_39846186 5月前

    In addition, could you check your %USERPROFILE%\.vscode\extensions and see if there are multiple versions of the ms-vscode.csharp extension there?

    点赞 评论 复制链接分享

相关推荐