dotnet / vscode-csharp

Official C# support for Visual Studio Code
MIT License
2.84k stars 663 forks source link

C# Extension fails only for netcoreapp3.0 GA #3289

Closed MicKramer closed 4 years ago

MicKramer commented 4 years ago

Issue Description

C# Extensions complains "The type or namespace name 'System' could not be found ..." (likewise System.String, System.Object, System.Void, etc.)

This happens only when Target Framework = netcoreapp3.0. No problems for netcoreapp2.0, netcoreapp2.1, nor netcoreapp2.2. Code builds and runs fine at command prompt.

Steps to Reproduce

  1. Installed software

    • VS Code latest (1.38.1)
    • C# Extensions latest (1.21.3)
    • . . . with OmniSharp latest (1.34.3)
    • .NET Core 3.0 SDK (3.0.100)
    • Restart workstation after installs (just in case)
  2. Actions in Command Prompt

    • Create folder = OmniDemo
    • Create new console app in that folder: dotnet new console
    • dotnet build => builds successfully
    • dotnet run => runs successfully
    • Inspect .csproj file => App uses TargetFramework = netcoreapp3.0.
  3. Open VS Code in this folder

    • Warning = No assets … => Accept to add assets
    • Warning = Unresolved dependencies => Accept to restore
    • Warning (repeated) = Unresolved dependencies => Accept to restore

Expected Behavior

C# Extensions displays c# code without any errors independent of whether TargetFramework = netcoreapp3.0, 2.2, 2.1, or 2.0.

Actual Behavior

C# Extensions accepts code for 2.0, 2.1, and 2.2.

For netcoreapp3.0 completely different behavior => C# Extensions complains of syntax errors (no type or namespace name) for System, System.String, System.Object, System.Void, etc.

Logs

OmniSharp log

Starting OmniSharp server at 9/23/2019, 11:34:25 PM Target: c:\DEV\OmniDemo

OmniSharp server started. Path: C:\Users\mickr.vscode\extensions\ms-vscode.csharp-1.21.3.omnisharp\1.34.3\OmniSharp.exe PID: 13104

    Starting OmniSharp on Windows 6.2.9200.0 (x64)
    DotNetPath set to dotnet
    Located 2 MSBuild instance(s)
        1: Visual Studio Community 2017 15.9.28307.770 - "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin"
        2: StandAlone 16.0 - "c:\Users\mickr\.vscode\extensions\ms-vscode.csharp-1.21.3\.omnisharp\1.34.3\.msbuild\Current\Bin"
    MSBUILD_EXE_PATH environment variable set to 'c:\Users\mickr\.vscode\extensions\ms-vscode.csharp-1.21.3\.omnisharp\1.34.3\.msbuild\Current\Bin\MSBuild.exe'
    Registered MSBuild instance: StandAlone 16.0 - "c:\Users\mickr\.vscode\extensions\ms-vscode.csharp-1.21.3\.omnisharp\1.34.3\.msbuild\Current\Bin"
        CscToolExe = csc.exe
        CscToolPath = c:\Users\mickr\.vscode\extensions\ms-vscode.csharp-1.21.3\.omnisharp\1.34.3\.msbuild\Current\Bin\Roslyn
        MSBuildExtensionsPath = c:\Users\mickr\.vscode\extensions\ms-vscode.csharp-1.21.3\.omnisharp\1.34.3\.msbuild
        MSBuildToolsPath = c:\Users\mickr\.vscode\extensions\ms-vscode.csharp-1.21.3\.omnisharp\1.34.3\.msbuild\Current\Bin
    Detecting Cake files in 'c:\DEV\OmniDemo'.
    Could not find any Cake files
    No solution files found in 'c:\DEV\OmniDemo'
    Queue project update for 'c:\DEV\OmniDemo\OmniDemo.csproj'
    Detecting CSX files in 'c:\DEV\OmniDemo'.
    Could not find any CSX files
    Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0
    Loading project: c:\DEV\OmniDemo\OmniDemo.csproj
    Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.RenameWorkspaceOptionsProvider, Order: 100
    Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.EditorConfigWorkspaceOptionsProvider, Order: 200
    Configuration finished.
    Omnisharp server running using Stdio at location 'c:\DEV\OmniDemo' on host 3140.
    Successfully loaded project file 'c:\DEV\OmniDemo\OmniDemo.csproj'.
    Adding project 'c:\DEV\OmniDemo\OmniDemo.csproj'
    Update project: OmniDemo

[warn]: OmniSharp.MSBuild.PackageDependencyChecker OmniDemo: Did not find 'Microsoft.NETCore.App' in lock file.

    Queue project update for 'c:\DEV\OmniDemo\OmniDemo.csproj'
    Loading project: c:\DEV\OmniDemo\OmniDemo.csproj
    Successfully loaded project file 'c:\DEV\OmniDemo\OmniDemo.csproj'.
    Update project: OmniDemo

[warn]: OmniSharp.MSBuild.PackageDependencyChecker OmniDemo: Did not find 'Microsoft.NETCore.App' in lock file.

C# log

C# log is EMPTY

Environment information

VSCode version: 1.38.1 C# Extension: 1.21.3

Dotnet Information .NET Core SDK (reflecting any global.json): Version: 3.0.100 Commit: 04339c3a26 Runtime Environment: OS Name: Windows OS Version: 10.0.18362 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\3.0.100\ Host (useful for support): Version: 3.0.0 Commit: 7d57652f33 .NET Core SDKs installed: 2.1.403 [C:\Program Files\dotnet\sdk] 2.1.500 [C:\Program Files\dotnet\sdk] 2.1.508 [C:\Program Files\dotnet\sdk] 2.2.300 [C:\Program Files\dotnet\sdk] 3.0.100 [C:\Program Files\dotnet\sdk] .NET Core runtimes installed: Microsoft.AspNetCore.All 2.1.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.1.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.2.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.1.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.2.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.1.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.12 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.2.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] To install additional .NET Core runtimes or SDKs: https://aka.ms/dotnet-download
Visual Studio Code Extensions |Extension|Author|Version| |---|---|---| |csharp|ms-vscode|1.21.3| |mssql|ms-mssql|1.6.0| |remote-wsl|ms-vscode-remote|0.39.5| |team|ms-vsts|1.149.2| |vscode-eslint|dbaeumer|1.9.1|;
filipw commented 4 years ago

what is the content of your csproj file? the warning says that you have 'Microsoft.NETCore.App' there which is not needed in 3.0.

also can you please set omnisharp.logginglevel to "debug" and post the output again?

cduplantis commented 4 years ago

I found the same issue on OSX on a dotnet new webapi generated project.

I followed the steps above for comparison. I additionally added the debug flag.

OmniSharp log

Starting OmniSharp server at 9/23/2019, 10:57:18 PM Target: /Users/macuser/code/OmniDemo OmniSharp server started with Mono 5.18.1. Path: /Users/macuser/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/omnisharp/OmniSharp.exe PID: 54099 [info]: OmniSharp.Stdio.Host Starting OmniSharp on MacOS 10.14.6 (x64) [info]: OmniSharp.Services.DotNetCliService DotNetPath set to dotnet [info]: OmniSharp.MSBuild.Discovery.MSBuildLocator Located 2 MSBuild instance(s) 1: Mono 16.0 - "/Library/Frameworks/Mono.framework/Versions/5.18.1/lib/mono/msbuild/15.0/bin" 2: StandAlone 16.0 - "/Users/macuser/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/omnisharp/.msbuild/Current/Bin" [info]: OmniSharp.MSBuild.Discovery.MSBuildLocator Registered MSBuild instance: Mono 16.0 - "/Library/Frameworks/Mono.framework/Versions/5.18.1/lib/mono/msbuild/15.0/bin" CscToolPath = /Users/macuser/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/omnisharp/.msbuild/Current/Bin/Roslyn CscToolExe = csc.exe [info]: OmniSharp.Cake.CakeProjectSystem Detecting Cake files in '/Users/macuser/code/OmniDemo'. [info]: OmniSharp.Cake.CakeProjectSystem Could not find any Cake files [info]: OmniSharp.MSBuild.ProjectSystem No solution files found in '/Users/macuser/code/OmniDemo' [info]: OmniSharp.MSBuild.ProjectManager Queue project update for '/Users/macuser/code/OmniDemo/OmniDemo.csproj' [info]: OmniSharp.Script.ScriptProjectSystem Detecting CSX files in '/Users/macuser/code/OmniDemo'. [info]: OmniSharp.Script.ScriptProjectSystem Could not find any CSX files [info]: OmniSharp.WorkspaceInitializer Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0 [info]: OmniSharp.MSBuild.ProjectManager Loading project: /Users/macuser/code/OmniDemo/OmniDemo.csproj [info]: OmniSharp.WorkspaceInitializer Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.RenameWorkspaceOptionsProvider, Order: 100 [info]: OmniSharp.WorkspaceInitializer Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.EditorConfigWorkspaceOptionsProvider, Order: 200 [info]: OmniSharp.WorkspaceInitializer Configuration finished. [info]: OmniSharp.Stdio.Host Omnisharp server running using Stdio at location '/Users/macuser/code/OmniDemo' on host 54079. [info]: OmniSharp.MSBuild.ProjectManager Successfully loaded project file '/Users/macuser/code/OmniDemo/OmniDemo.csproj'. [info]: OmniSharp.MSBuild.ProjectManager Adding project '/Users/macuser/code/OmniDemo/OmniDemo.csproj' [info]: OmniSharp.MSBuild.ProjectManager Update project: OmniDemo [warn]: OmniSharp.MSBuild.PackageDependencyChecker OmniDemo: Did not find 'Microsoft.NETCore.App' in lock file.

OmniSharp Log (-debug)

Starting OmniSharp server at 9/23/2019, 11:07:49 PM Target: /Users/macuser/code/OmniDemo OmniSharp server started with Mono 5.18.1. Path: /Users/macuser/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/omnisharp/OmniSharp.exe PID: 54171 [dbug]: OmniSharp.CompositionHostBuilder Loaded OmniSharp.Cake, Version=1.34.0.0, Culture=neutral, PublicKeyToken=null [dbug]: OmniSharp.CompositionHostBuilder Loaded OmniSharp.DotNetTest, Version=1.34.0.0, Culture=neutral, PublicKeyToken=null [dbug]: OmniSharp.CompositionHostBuilder Loaded OmniSharp.Host, Version=1.34.0.0, Culture=neutral, PublicKeyToken=null [dbug]: OmniSharp.CompositionHostBuilder Loaded OmniSharp.MSBuild, Version=1.34.0.0, Culture=neutral, PublicKeyToken=null [dbug]: OmniSharp.CompositionHostBuilder Loaded OmniSharp.Roslyn, Version=1.34.0.0, Culture=neutral, PublicKeyToken=null [dbug]: OmniSharp.CompositionHostBuilder Loaded OmniSharp.Roslyn.CSharp, Version=1.34.0.0, Culture=neutral, PublicKeyToken=null [dbug]: OmniSharp.CompositionHostBuilder Loaded OmniSharp.Script, Version=1.34.0.0, Culture=neutral, PublicKeyToken=null [dbug]: OmniSharp.CompositionHostBuilder Loaded OmniSharp.Shared, Version=1.34.0.0, Culture=neutral, PublicKeyToken=null [info]: OmniSharp.Stdio.Host Starting OmniSharp on MacOS 10.14.6 (x64) [info]: OmniSharp.Services.DotNetCliService DotNetPath set to dotnet [info]: OmniSharp.MSBuild.Discovery.MSBuildLocator Located 2 MSBuild instance(s) 1: Mono 16.0 - "/Library/Frameworks/Mono.framework/Versions/5.18.1/lib/mono/msbuild/15.0/bin" 2: StandAlone 16.0 - "/Users/macuser/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/omnisharp/.msbuild/Current/Bin" [dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator SUCCESS: Resolved to '/Library/Frameworks/Mono.framework/Versions/5.18.1/lib/mono/msbuild/15.0/bin/Microsoft.Build.Utilities.Core.dll' (name-only). [dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator SUCCESS: Resolved to '/Library/Frameworks/Mono.framework/Versions/5.18.1/lib/mono/msbuild/15.0/bin/Microsoft.Build.Tasks.Core.dll' (name-only). [dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator SUCCESS: Resolved to '/Library/Frameworks/Mono.framework/Versions/5.18.1/lib/mono/msbuild/15.0/bin/Microsoft.Build.Framework.dll' (name-only). [dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator SUCCESS: Resolved to '/Library/Frameworks/Mono.framework/Versions/5.18.1/lib/mono/msbuild/15.0/bin/Microsoft.Build.dll' (name-only). [info]: OmniSharp.MSBuild.Discovery.MSBuildLocator Registered MSBuild instance: Mono 16.0 - "/Library/Frameworks/Mono.framework/Versions/5.18.1/lib/mono/msbuild/15.0/bin" CscToolPath = /Users/macuser/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/omnisharp/.msbuild/Current/Bin/Roslyn CscToolExe = csc.exe [dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator Attempting to resolve 'Microsoft.CodeAnalysis.VisualBasic.Workspaces, Version=3.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' [dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator FAILURE: Could not locate '/Library/Frameworks/Mono.framework/Versions/5.18.1/lib/mono/msbuild/15.0/bin/Microsoft.CodeAnalysis.VisualBasic.Workspaces.dll'. [dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator Attempting to resolve 'Microsoft.CodeAnalysis.VisualBasic.Features, Version=3.4.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' [dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator FAILURE: Could not locate '/Library/Frameworks/Mono.framework/Versions/5.18.1/lib/mono/msbuild/15.0/bin/Microsoft.CodeAnalysis.VisualBasic.Features.dll'. [info]: OmniSharp.Cake.CakeProjectSystem Detecting Cake files in '/Users/macuser/code/OmniDemo'. [info]: OmniSharp.Cake.CakeProjectSystem Could not find any Cake files [dbug]: OmniSharp.MSBuild.ProjectSystem MSBuild environment: Mode: Standalone RunningTests: False RunningInVisualStudio: False MSBuildToolsDirectory32: /Library/Frameworks/Mono.framework/Versions/5.18.1/lib/mono/msbuild/15.0/bin MSBuildToolsDirectory64: /Library/Frameworks/Mono.framework/Versions/5.18.1/lib/mono/msbuild/15.0/bin MSBuildSDKsPath: /Library/Frameworks/Mono.framework/Versions/5.18.1/lib/mono/msbuild/15.0/bin/Sdks CurrentMSBuildConfigurationFile: /Library/Frameworks/Mono.framework/Versions/5.18.1/lib/mono/msbuild/15.0/bin/MSBuild.dll.config CurrentMSBuildExePath: /Library/Frameworks/Mono.framework/Versions/5.18.1/lib/mono/msbuild/15.0/bin/MSBuild.dll CurrentMSBuildToolsDirectory: /Library/Frameworks/Mono.framework/Versions/5.18.1/lib/mono/msbuild/15.0/bin VisualStudioInstallRootDirectory: MSBuildExtensionsPath: /Library/Frameworks/Mono.framework/Versions/5.18.1/lib/mono/msbuild/15.0/bin [dbug]: OmniSharp.MSBuild.ProjectLoader 'CscToolPath' set to '/Users/macuser/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/omnisharp/.msbuild/Current/Bin/Roslyn' [dbug]: OmniSharp.MSBuild.ProjectLoader 'CscToolExe' set to 'csc.exe' [info]: OmniSharp.MSBuild.ProjectSystem No solution files found in '/Users/macuser/code/OmniDemo' [info]: OmniSharp.MSBuild.ProjectManager Queue project update for '/Users/macuser/code/OmniDemo/OmniDemo.csproj' [info]: OmniSharp.Script.ScriptProjectSystem Detecting CSX files in '/Users/macuser/code/OmniDemo'. [info]: OmniSharp.Script.ScriptProjectSystem Could not find any CSX files [info]: OmniSharp.WorkspaceInitializer Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0 [info]: OmniSharp.MSBuild.ProjectManager Loading project: /Users/macuser/code/OmniDemo/OmniDemo.csproj [info]: OmniSharp.WorkspaceInitializer Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.RenameWorkspaceOptionsProvider, Order: 100 [info]: OmniSharp.WorkspaceInitializer Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.EditorConfigWorkspaceOptionsProvider, Order: 200 [info]: OmniSharp.WorkspaceInitializer Configuration finished. [info]: OmniSharp.Stdio.Host Omnisharp server running using Stdio at location '/Users/macuser/code/OmniDemo' on host 54079. [dbug]: OmniSharp.Stdio.Host ************ Request ************ { "Type": "request", "Seq": 80, "Command": "/projects" } [dbug]: OmniSharp.Stdio.Host ************ Request ************ { "Type": "request", "Seq": 79, "Command": "/projects" } [dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator Attempting to resolve 'Microsoft.Build.resources, Version=15.1.0.0, Culture=en-US, PublicKeyToken=b03f5f7f11d50a3a' [dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator FAILURE: Could not locate '/Library/Frameworks/Mono.framework/Versions/5.18.1/lib/mono/msbuild/15.0/bin/Microsoft.Build.resources.dll'. [dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator Attempting to resolve 'Microsoft.Build.Tasks.Core.resources, Version=15.1.0.0, Culture=en-US, PublicKeyToken=b03f5f7f11d50a3a' [dbug]: OmniSharp.MSBuild.Discovery.MSBuildLocator FAILURE: Could not locate '/Library/Frameworks/Mono.framework/Versions/5.18.1/lib/mono/msbuild/15.0/bin/Microsoft.Build.Tasks.Core.resources.dll'. [info]: OmniSharp.MSBuild.ProjectManager Successfully loaded project file '/Users/macuser/code/OmniDemo/OmniDemo.csproj'. [info]: OmniSharp.MSBuild.ProjectManager Adding project '/Users/macuser/code/OmniDemo/OmniDemo.csproj' [info]: OmniSharp.MSBuild.ProjectManager Update project: OmniDemo [warn]: OmniSharp.MSBuild.PackageDependencyChecker OmniDemo: Did not find 'Microsoft.NETCore.App' in lock file. [dbug]: OmniSharp.Stdio.Host ************ Response ************ { "Request_seq": 80, "Command": "/projects", "Running": true, "Success": true, "Message": null, "Body": { "MsBuild": { "SolutionPath": "/Users/macuser/code/OmniDemo", "Projects": [ { "ProjectGuid": "00000000-0000-0000-0000-000000000000", "Path": "/Users/macuser/code/OmniDemo/OmniDemo.csproj", "AssemblyName": "OmniDemo", "TargetPath": "/Users/macuser/code/OmniDemo/bin/Debug/netcoreapp3.0/OmniDemo.dll", "TargetFramework": ".NETCoreApp,Version=v3.0", "SourceFiles": [ "/Users/macuser/code/OmniDemo/Program.cs", "/var/folders/kb/ghb7g8fx3rqdhbhlwpx_ljdm0000gn/T/.NETCoreApp,Version=v3.0.AssemblyAttributes.cs", "/Users/macuser/code/OmniDemo/obj/Debug/netcoreapp3.0/OmniDemo.AssemblyInfo.cs" ], "TargetFrameworks": [ { "Name": ".NETCoreApp", "FriendlyName": ".NETCoreApp", "ShortName": "netcoreapp3.0" } ], "OutputPath": "bin\\Debug\\netcoreapp3.0\\", "IntermediateOutputPath": "obj\\Debug\\netcoreapp3.0\\", "Configuration": "Debug", "Platform": "AnyCPU", "IsExe": true, "IsUnityProject": false } ] }, "Script": { "Projects": [] } }, "Seq": 39, "Type": "response" } [dbug]: OmniSharp.Stdio.Host ************ Response ************ { "Request_seq": 79, "Command": "/projects", "Running": true, "Success": true, "Message": null, "Body": { "MsBuild": { "SolutionPath": "/Users/macuser/code/OmniDemo", "Projects": [ { "ProjectGuid": "00000000-0000-0000-0000-000000000000", "Path": "/Users/macuser/code/OmniDemo/OmniDemo.csproj", "AssemblyName": "OmniDemo", "TargetPath": "/Users/macuser/code/OmniDemo/bin/Debug/netcoreapp3.0/OmniDemo.dll", "TargetFramework": ".NETCoreApp,Version=v3.0", "SourceFiles": [ "/Users/macuser/code/OmniDemo/Program.cs", "/var/folders/kb/ghb7g8fx3rqdhbhlwpx_ljdm0000gn/T/.NETCoreApp,Version=v3.0.AssemblyAttributes.cs", "/Users/macuser/code/OmniDemo/obj/Debug/netcoreapp3.0/OmniDemo.AssemblyInfo.cs" ], "TargetFrameworks": [ { "Name": ".NETCoreApp", "FriendlyName": ".NETCoreApp", "ShortName": "netcoreapp3.0" } ], "OutputPath": "bin\\Debug\\netcoreapp3.0\\", "IntermediateOutputPath": "obj\\Debug\\netcoreapp3.0\\", "Configuration": "Debug", "Platform": "AnyCPU", "IsExe": true, "IsUnityProject": false } ] }, "Script": { "Projects": [] } }, "Seq": 40, "Type": "response" } [dbug]: OmniSharp.Stdio.Host ************ Request ************ { "Type": "request", "Seq": 81, "Command": "/projects" } [dbug]: OmniSharp.Stdio.Host ************ Response ************ { "Request_seq": 81, "Command": "/projects", "Running": true, "Success": true, "Message": null, "Body": { "MsBuild": { "SolutionPath": "/Users/macuser/code/OmniDemo", "Projects": [ { "ProjectGuid": "00000000-0000-0000-0000-000000000000", "Path": "/Users/macuser/code/OmniDemo/OmniDemo.csproj", "AssemblyName": "OmniDemo", "TargetPath": "/Users/macuser/code/OmniDemo/bin/Debug/netcoreapp3.0/OmniDemo.dll", "TargetFramework": ".NETCoreApp,Version=v3.0", "SourceFiles": [ "/Users/macuser/code/OmniDemo/Program.cs", "/var/folders/kb/ghb7g8fx3rqdhbhlwpx_ljdm0000gn/T/.NETCoreApp,Version=v3.0.AssemblyAttributes.cs", "/Users/macuser/code/OmniDemo/obj/Debug/netcoreapp3.0/OmniDemo.AssemblyInfo.cs" ], "TargetFrameworks": [ { "Name": ".NETCoreApp", "FriendlyName": ".NETCoreApp", "ShortName": "netcoreapp3.0" } ], "OutputPath": "bin\\Debug\\netcoreapp3.0\\", "IntermediateOutputPath": "obj\\Debug\\netcoreapp3.0\\", "Configuration": "Debug", "Platform": "AnyCPU", "IsExe": true, "IsUnityProject": false } ] }, "Script": { "Projects": [] } }, "Seq": 57, "Type": "response" } [dbug]: OmniSharp.Stdio.Host ************ Request ************ { "Type": "request", "Seq": 82, "Command": "/projects" } [dbug]: OmniSharp.Stdio.Host ************ Response ************ { "Request_seq": 82, "Command": "/projects", "Running": true, "Success": true, "Message": null, "Body": { "MsBuild": { "SolutionPath": "/Users/macuser/code/OmniDemo", "Projects": [ { "ProjectGuid": "00000000-0000-0000-0000-000000000000", "Path": "/Users/macuser/code/OmniDemo/OmniDemo.csproj", "AssemblyName": "OmniDemo", "TargetPath": "/Users/macuser/code/OmniDemo/bin/Debug/netcoreapp3.0/OmniDemo.dll", "TargetFramework": ".NETCoreApp,Version=v3.0", "SourceFiles": [ "/Users/macuser/code/OmniDemo/Program.cs", "/var/folders/kb/ghb7g8fx3rqdhbhlwpx_ljdm0000gn/T/.NETCoreApp,Version=v3.0.AssemblyAttributes.cs", "/Users/macuser/code/OmniDemo/obj/Debug/netcoreapp3.0/OmniDemo.AssemblyInfo.cs" ], "TargetFrameworks": [ { "Name": ".NETCoreApp", "FriendlyName": ".NETCoreApp", "ShortName": "netcoreapp3.0" } ], "OutputPath": "bin\\Debug\\netcoreapp3.0\\", "IntermediateOutputPath": "obj\\Debug\\netcoreapp3.0\\", "Configuration": "Debug", "Platform": "AnyCPU", "IsExe": true, "IsUnityProject": false } ] }, "Script": { "Projects": [] } }, "Seq": 60, "Type": "response" } [dbug]: OmniSharp.Stdio.Host ************ Request ************ { "Type": "request", "Seq": 83, "Command": "/codecheck", "Arguments": { "FileName": null } } [dbug]: OmniSharp.Stdio.Host ************ Response ************ { "Request_seq": 83, "Command": "/codecheck", "Running": true, "Success": true, "Message": null, "Body": { "QuickFixes": [ { "LogLevel": "Error", "Id": "CS0246", "Tags": [], "FileName": "/Users/macuser/code/OmniDemo/Program.cs", "Line": 1, "Column": 7, "EndLine": 1, "EndColumn": 13, "Text": "The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?) (CS0246)", "Projects": [ "OmniDemo" ] }, { "LogLevel": "Error", "Id": "CS0518", "Tags": [], "FileName": "/Users/macuser/code/OmniDemo/Program.cs", "Line": 5, "Column": 11, "EndLine": 5, "EndColumn": 18, "Text": "Predefined type 'System.Object' is not defined or imported (CS0518)", "Projects": [ "OmniDemo" ] }, { "LogLevel": "Error", "Id": "CS0518", "Tags": [], "FileName": "/Users/macuser/code/OmniDemo/Program.cs", "Line": 7, "Column": 26, "EndLine": 7, "EndColumn": 32, "Text": "Predefined type 'System.String' is not defined or imported (CS0518)", "Projects": [ "OmniDemo" ] }, { "LogLevel": "Error", "Id": "CS0518", "Tags": [], "FileName": "/Users/macuser/code/OmniDemo/Program.cs", "Line": 7, "Column": 16, "EndLine": 7, "EndColumn": 20, "Text": "Predefined type 'System.Void' is not defined or imported (CS0518)", "Projects": [ "OmniDemo" ] }, { "LogLevel": "Error", "Id": "CS0518", "Tags": [], "FileName": "/Users/macuser/code/OmniDemo/Program.cs", "Line": 9, "Column": 13, "EndLine": 9, "EndColumn": 20, "Text": "Predefined type 'System.Object' is not defined or imported (CS0518)", "Projects": [ "OmniDemo" ] }, { "LogLevel": "Error", "Id": "CS0103", "Tags": [], "FileName": "/Users/macuser/code/OmniDemo/Program.cs", "Line": 9, "Column": 13, "EndLine": 9, "EndColumn": 20, "Text": "The name 'Console' does not exist in the current context (CS0103)", "Projects": [ "OmniDemo" ] }, { "LogLevel": "Error", "Id": "CS0518", "Tags": [], "FileName": "/Users/macuser/code/OmniDemo/Program.cs", "Line": 9, "Column": 31, "EndLine": 9, "EndColumn": 45, "Text": "Predefined type 'System.String' is not defined or imported (CS0518)", "Projects": [ "OmniDemo" ] }, { "LogLevel": "Error", "Id": "CS1729", "Tags": [], "FileName": "/Users/macuser/code/OmniDemo/Program.cs", "Line": 5, "Column": 11, "EndLine": 5, "EndColumn": 18, "Text": "'object' does not contain a constructor that takes 0 arguments (CS1729)", "Projects": [ "OmniDemo" ] }, { "LogLevel": "Hidden", "Id": "CS8019", "Tags": [], "FileName": "/Users/macuser/code/OmniDemo/Program.cs", "Line": 1, "Column": 1, "EndLine": 1, "EndColumn": 14, "Text": "Unnecessary using directive. (CS8019)", "Projects": [ "OmniDemo" ] }, { "LogLevel": "Error", "Id": "CS0400", "Tags": [], "FileName": "/var/folders/kb/ghb7g8fx3rqdhbhlwpx_ljdm0000gn/T/.NETCoreApp,Version=v3.0.AssemblyAttributes.cs", "Line": 4, "Column": 20, "EndLine": 4, "EndColumn": 26, "Text": "The type or namespace name 'System' could not be found in the global namespace (are you missing an assembly reference?) (CS0400)", "Projects": [ "OmniDemo" ] }, { "LogLevel": "Error", "Id": "CS0518", "Tags": [], "FileName": "/var/folders/kb/ghb7g8fx3rqdhbhlwpx_ljdm0000gn/T/.NETCoreApp,Version=v3.0.AssemblyAttributes.cs", "Line": 4, "Column": 71, "EndLine": 4, "EndColumn": 97, "Text": "Predefined type 'System.String' is not defined or imported (CS0518)", "Projects": [ "OmniDemo" ] }, { "LogLevel": "Error", "Id": "CS0246", "Tags": [], "FileName": "/var/folders/kb/ghb7g8fx3rqdhbhlwpx_ljdm0000gn/T/.NETCoreApp,Version=v3.0.AssemblyAttributes.cs", "Line": 4, "Column": 99, "EndLine": 4, "EndColumn": 119, "Text": "The type or namespace name 'FrameworkDisplayName' could not be found (are you missing a using directive or an assembly reference?) (CS0246)", "Projects": [ "OmniDemo" ] }, { "LogLevel": "Error", "Id": "CS0518", "Tags": [], "FileName": "/var/folders/kb/ghb7g8fx3rqdhbhlwpx_ljdm0000gn/T/.NETCoreApp,Version=v3.0.AssemblyAttributes.cs", "Line": 4, "Column": 122, "EndLine": 4, "EndColumn": 124, "Text": "Predefined type 'System.String' is not defined or imported (CS0518)", "Projects": [ "OmniDemo" ] }, { "LogLevel": "Error", "Id": "CS0246", "Tags": [], "FileName": "/Users/macuser/code/OmniDemo/obj/Debug/netcoreapp3.0/OmniDemo.AssemblyInfo.cs", "Line": 10, "Column": 12, "EndLine": 10, "EndColumn": 18, "Text": "The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?) (CS0246)", "Projects": [ "OmniDemo" ] }, { "LogLevel": "Error", "Id": "CS0246", "Tags": [], "FileName": "/Users/macuser/code/OmniDemo/obj/Debug/netcoreapp3.0/OmniDemo.AssemblyInfo.cs", "Line": 11, "Column": 12, "EndLine": 11, "EndColumn": 18, "Text": "The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?) (CS0246)", "Projects": [ "OmniDemo" ] }, { "LogLevel": "Error", "Id": "CS0246", "Tags": [], "FileName": "/Users/macuser/code/OmniDemo/obj/Debug/netcoreapp3.0/OmniDemo.AssemblyInfo.cs", "Line": 12, "Column": 12, "EndLine": 12, "EndColumn": 18, "Text": "The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?) (CS0246)", "Projects": [ "OmniDemo" ] }, { "LogLevel": "Error", "Id": "CS0246", "Tags": [], "FileName": "/Users/macuser/code/OmniDemo/obj/Debug/netcoreapp3.0/OmniDemo.AssemblyInfo.cs", "Line": 13, "Column": 12, "EndLine": 13, "EndColumn": 18, "Text": "The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?) (CS0246)", "Projects": [ "OmniDemo" ] }, { "LogLevel": "Error", "Id": "CS0246", "Tags": [], "FileName": "/Users/macuser/code/OmniDemo/obj/Debug/netcoreapp3.0/OmniDemo.AssemblyInfo.cs", "Line": 14, "Column": 12, "EndLine": 14, "EndColumn": 18, "Text": "The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?) (CS0246)", "Projects": [ "OmniDemo" ] }, { "LogLevel": "Error", "Id": "CS0246", "Tags": [], "FileName": "/Users/macuser/code/OmniDemo/obj/Debug/netcoreapp3.0/OmniDemo.AssemblyInfo.cs", "Line": 15, "Column": 12, "EndLine": 15, "EndColumn": 18, "Text": "The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?) (CS0246)", "Projects": [ "OmniDemo" ] }, { "LogLevel": "Error", "Id": "CS0246", "Tags": [], "FileName": "/Users/macuser/code/OmniDemo/obj/Debug/netcoreapp3.0/OmniDemo.AssemblyInfo.cs", "Line": 16, "Column": 12, "EndLine": 16, "EndColumn": 18, "Text": "The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?) (CS0246)", "Projects": [ "OmniDemo" ] }, { "LogLevel": "Error", "Id": "CS0518", "Tags": [], "FileName": "/Users/macuser/code/OmniDemo/obj/Debug/netcoreapp3.0/OmniDemo.AssemblyInfo.cs", "Line": 10, "Column": 55, "EndLine": 10, "EndColumn": 65, "Text": "Predefined type 'System.String' is not defined or imported (CS0518)", "Projects": [ "OmniDemo" ] }, { "LogLevel": "Error", "Id": "CS0518", "Tags": [], "FileName": "/Users/macuser/code/OmniDemo/obj/Debug/netcoreapp3.0/OmniDemo.AssemblyInfo.cs", "Line": 11, "Column": 61, "EndLine": 11, "EndColumn": 68, "Text": "Predefined type 'System.String' is not defined or imported (CS0518)", "Projects": [ "OmniDemo" ] }, { "LogLevel": "Error", "Id": "CS0518", "Tags": [], "FileName": "/Users/macuser/code/OmniDemo/obj/Debug/netcoreapp3.0/OmniDemo.AssemblyInfo.cs", "Line": 12, "Column": 59, "EndLine": 12, "EndColumn": 68, "Text": "Predefined type 'System.String' is not defined or imported (CS0518)", "Projects": [ "OmniDemo" ] }, { "LogLevel": "Error", "Id": "CS0518", "Tags": [], "FileName": "/Users/macuser/code/OmniDemo/obj/Debug/netcoreapp3.0/OmniDemo.AssemblyInfo.cs", "Line": 13, "Column": 68, "EndLine": 13, "EndColumn": 75, "Text": "Predefined type 'System.String' is not defined or imported (CS0518)", "Projects": [ "OmniDemo" ] }, { "LogLevel": "Error", "Id": "CS0518", "Tags": [], "FileName": "/Users/macuser/code/OmniDemo/obj/Debug/netcoreapp3.0/OmniDemo.AssemblyInfo.cs", "Line": 14, "Column": 55, "EndLine": 14, "EndColumn": 65, "Text": "Predefined type 'System.String' is not defined or imported (CS0518)", "Projects": [ "OmniDemo" ] }, { "LogLevel": "Error", "Id": "CS0518", "Tags": [], "FileName": "/Users/macuser/code/OmniDemo/obj/Debug/netcoreapp3.0/OmniDemo.AssemblyInfo.cs", "Line": 15, "Column": 53, "EndLine": 15, "EndColumn": 63, "Text": "Predefined type 'System.String' is not defined or imported (CS0518)", "Projects": [ "OmniDemo" ] }, { "LogLevel": "Error", "Id": "CS0518", "Tags": [], "FileName": "/Users/macuser/code/OmniDemo/obj/Debug/netcoreapp3.0/OmniDemo.AssemblyInfo.cs", "Line": 16, "Column": 55, "EndLine": 16, "EndColumn": 64, "Text": "Predefined type 'System.String' is not defined or imported (CS0518)", "Projects": [ "OmniDemo" ] }, { "LogLevel": "Hidden", "Id": "CS8019", "Tags": [], "FileName": "/Users/macuser/code/OmniDemo/obj/Debug/netcoreapp3.0/OmniDemo.AssemblyInfo.cs", "Line": 7, "Column": 1, "EndLine": 7, "EndColumn": 14, "Text": "Unnecessary using directive. (CS8019)", "Projects": [ "OmniDemo" ] }, { "LogLevel": "Hidden", "Id": "CS8019", "Tags": [], "FileName": "/Users/macuser/code/OmniDemo/obj/Debug/netcoreapp3.0/OmniDemo.AssemblyInfo.cs", "Line": 8, "Column": 1, "EndLine": 8, "EndColumn": 25, "Text": "Unnecessary using directive. (CS8019)", "Projects": [ "OmniDemo" ] } ] }, "Seq": 63, "Type": "response" }

C# log

NONE

Environment information

VSCode version: 1.38.1 C# Extension: 1.21.3

Mono Information OmniSharp using global mono :5.18.1
Dotnet Information .NET Core SDK (reflecting any global.json): Version: 3.0.100 Commit: 04339c3a26 Runtime Environment: OS Name: Mac OS X OS Version: 10.14 OS Platform: Darwin RID: osx.10.14-x64 Base Path: /usr/local/share/dotnet/sdk/3.0.100/ Host (useful for support): Version: 3.0.0 Commit: 7d57652f33 .NET Core SDKs installed: 1.0.4 [/usr/local/share/dotnet/sdk] 2.0.0 [/usr/local/share/dotnet/sdk] 2.1.4 [/usr/local/share/dotnet/sdk] 2.1.302 [/usr/local/share/dotnet/sdk] 2.1.505 [/usr/local/share/dotnet/sdk] 2.2.402 [/usr/local/share/dotnet/sdk] 3.0.100 [/usr/local/share/dotnet/sdk] .NET Core runtimes installed: Microsoft.AspNetCore.All 2.1.2 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.1.9 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.2.7 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.2 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.1.9 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.2.7 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.0.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 1.0.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 1.1.2 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 2.0.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 2.0.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.2 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.9 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 2.2.7 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 3.0.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] To install additional .NET Core runtimes or SDKs: https://aka.ms/dotnet-download
Visual Studio Code Extensions |Extension|Author|Version| |---|---|---| |angular-console|nrwl|8.1.2| |better-comments|aaron-bond|2.0.5| |cpptools|ms-vscode|0.25.1| |csharp|ms-vscode|1.21.3| |cucumber|stevejpurves|0.12.0| |debugger-for-chrome|msjsdiag|4.11.7| |EditorConfig|EditorConfig|0.13.0| |githistory|donjayamanne|0.4.6| |Go|ms-vscode|0.11.6| |graphql-for-vscode|kumar-harsh|1.15.1| |htmltagwrap|bradgashler|0.0.7| |jshint|dbaeumer|0.10.21| |mono-debug|ms-vscode|0.15.8| |ng-template|Angular|0.802.3| |node-debug2|ms-vscode|1.33.0| |prettier-vscode|esbenp|2.2.2| |prisma|Prisma|0.0.15| |python|ms-python|2019.9.34911| |remote-containers|ms-vscode-remote|0.74.0| |remote-ssh|ms-vscode-remote|0.46.1| |remote-ssh-edit|ms-vscode-remote|0.46.1| |remote-ssh-explorer|ms-vscode-remote|0.46.1| |remote-wsl|ms-vscode-remote|0.39.5| |rest-client|humao|0.22.1| |vimL|fallenwood|0.0.3| |vsc-material-theme|Equinusocio|30.0.0| |vscode-npm-script|eg2|0.3.9| |vscode-react-native|msjsdiag|0.11.1| |vscode-remote-extensionpack|ms-vscode-remote|0.17.0| |vscode-typescript-tslint-plugin|ms-vscode|1.2.2|;
mdx0111 commented 4 years ago

I have the same issue both on Windows 10 Enterprise Edition and Fedora 30. Both environments are updated and the latest versions of VSCode, C# Extension and .Net Core SDK are installed.

Please see below the logs from my Fedora 30 machine:

Logs

OmniSharp log

Starting OmniSharp server at 24/09/2019, 06:01:13 Target: /media/workspace/Projects/Temp/DemoApp OmniSharp server started. Path: /home/masoud/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/run PID: 29126 [info]: OmniSharp.Stdio.Host Starting OmniSharp on fedora 30.0 (x64) [info]: OmniSharp.Services.DotNetCliService DotNetPath set to dotnet [info]: OmniSharp.MSBuild.Discovery.MSBuildLocator Located 1 MSBuild instance(s) 1: StandAlone 16.0 - "/home/masoud/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/omnisharp/.msbuild/Current/Bin" [info]: OmniSharp.MSBuild.Discovery.MSBuildLocator MSBUILD_EXE_PATH environment variable set to '/home/masoud/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/omnisharp/.msbuild/Current/Bin/MSBuild.dll' [info]: OmniSharp.MSBuild.Discovery.MSBuildLocator Registered MSBuild instance: StandAlone 16.0 - "/home/masoud/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/omnisharp/.msbuild/Current/Bin" MSBuildExtensionsPath = /home/masoud/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/omnisharp/.msbuild BypassFrameworkInstallChecks = true CscToolPath = /home/masoud/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/omnisharp/.msbuild/Current/Bin/Roslyn CscToolExe = csc.exe MSBuildToolsPath = /home/masoud/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/omnisharp/.msbuild/Current/Bin [info]: OmniSharp.Cake.CakeProjectSystem Detecting Cake files in '/media/workspace/Projects/Temp/DemoApp'. [info]: OmniSharp.Cake.CakeProjectSystem Could not find any Cake files [info]: OmniSharp.MSBuild.ProjectSystem No solution files found in '/media/workspace/Projects/Temp/DemoApp' [info]: OmniSharp.MSBuild.ProjectManager Queue project update for '/media/workspace/Projects/Temp/DemoApp/DemoApp.csproj' [info]: OmniSharp.Script.ScriptProjectSystem Detecting CSX files in '/media/workspace/Projects/Temp/DemoApp'. [info]: OmniSharp.Script.ScriptProjectSystem Could not find any CSX files [info]: OmniSharp.WorkspaceInitializer Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0 [info]: OmniSharp.MSBuild.ProjectManager Loading project: /media/workspace/Projects/Temp/DemoApp/DemoApp.csproj [info]: OmniSharp.WorkspaceInitializer Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.RenameWorkspaceOptionsProvider, Order: 100 [info]: OmniSharp.WorkspaceInitializer Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.EditorConfigWorkspaceOptionsProvider, Order: 200 [info]: OmniSharp.WorkspaceInitializer Configuration finished. [info]: OmniSharp.Stdio.Host Omnisharp server running using Stdio at location '/media/workspace/Projects/Temp/DemoApp' on host 28981. [info]: OmniSharp.MSBuild.ProjectManager Successfully loaded project file '/media/workspace/Projects/Temp/DemoApp/DemoApp.csproj'. [info]: OmniSharp.MSBuild.ProjectManager Adding project '/media/workspace/Projects/Temp/DemoApp/DemoApp.csproj' [info]: OmniSharp.MSBuild.ProjectManager Update project: DemoApp [warn]: OmniSharp.MSBuild.PackageDependencyChecker DemoApp: Did not find 'Microsoft.NETCore.App' in lock file.

C# log

Task - Build log

> Executing task: dotnet build /media/workspace/Projects/Temp/DemoApp/DemoApp.csproj /property:GenerateFullPaths=true < Microsoft (R) Build Engine version 16.3.0+0f4c62fea for .NET Core Copyright (C) Microsoft Corporation. All rights reserved. Restore completed in 14.38 ms for /media/workspace/Projects/Temp/DemoApp/DemoApp.csproj. DemoApp -> /media/workspace/Projects/Temp/DemoApp/bin/Debug/netcoreapp3.0/DemoApp.dll Build succeeded. 0 Warning(s) 0 Error(s) Time Elapsed 00:00:00.86 Terminal will be reused by tasks, press any key to close it.

Environment information

VSCode version: 1.38.1 C# Extension: 1.21.3

Mono Information OmniSharp using built-in mono
Dotnet Information .NET Core SDK (reflecting any global.json): Version: 3.0.100 Commit: 04339c3a26 Runtime Environment: OS Name: fedora OS Version: 30 OS Platform: Linux RID: fedora.30-x64 Base Path: /usr/share/dotnet/sdk/3.0.100/ Host (useful for support): Version: 3.0.0 Commit: 95a0a61858 .NET Core SDKs installed: 2.2.401 [/usr/share/dotnet/sdk] 3.0.100 [/usr/share/dotnet/sdk] .NET Core runtimes installed: Microsoft.AspNetCore.All 2.2.6 [/usr/share/dotnet/shared/Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.2.6 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.0.0 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.2.6 [/usr/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 3.0.0 [/usr/share/dotnet/shared/Microsoft.NETCore.App] To install additional .NET Core runtimes or SDKs: https://aka.ms/dotnet-download
Visual Studio Code Extensions |Extension|Author|Version| |---|---|---| |Angular2|johnpapa|8.1.1| |beautify|HookyQR|1.5.0| |csharp|ms-vscode|1.21.3| |csharpextensions|jchannon|1.3.0| |debugger-for-chrome|msjsdiag|4.11.7| |docomment|k--kato|0.1.8| |dotnet-test-explorer|formulahendry|0.7.1| |gitlens|eamodio|10.0.1| |html-css-class-completion|Zignd|1.19.0| |material-icon-theme|PKief|3.9.0| |mssql|ms-mssql|1.6.0| |ng-template|Angular|0.802.3| |npm-intellisense|christian-kohler|1.3.0| |path-intellisense|christian-kohler|1.4.2| |vs-keybindings|ms-vscode|0.2.0| |vscode-html-css|ecmel|0.2.3| |vscode-icons|vscode-icons-team|9.4.0| |vscodeintellicode|VisualStudioExptTeam|1.1.9| |vsliveshare|ms-vsliveshare|1.0.828| |vsliveshare-audio|ms-vsliveshare|0.1.66|;

It might help if I add that everytime I open a netcoreapp3.0 application, C# extension keeps showing the following message: "There are unresolved dependencies. Please execute the restore command to continue."

Any help would be highly appreciated.

filipw commented 4 years ago

can you post the content of the csproj file?

This is what I see:

Screenshot 2019-09-24 07 08 18

when using:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp3.0</TargetFramework>
  </PropertyGroup>

</Project>
mdx0111 commented 4 years ago

Please see below as the content of my csproj file:

<Project` Sdk="Microsoft.NET.Sdk.Web">

  <PropertyGroup>
    <TargetFramework>netcoreapp3.0</TargetFramework>
  </PropertyGroup>

</Project>
filipw commented 4 years ago

I would really like to help but I can't reproduce this on any system 😀 We have been supporting .NET Core 3.0 since preview 1 and there have been no special changes from last RC1 to GA version - and any issues reported with NET Core 3.0 over the last months have been continually fixed.

The warning Did not find 'Microsoft.NETCore.App' in lock file. normally only happened when you had Microsoft.NETCore.App in the csproj file (like it was normal in older versions of .NET Core) - in .NET Core 3.0 it's no longer needed (it was removed around preview 6 I think). Also, even if that warning is there, you might see the annoying "There are unresolved dependencies. Please execute the restore command to continue." message but even that should not impact intellisense anyway.

I will continue to look into this but it would be great to get any more info from anyone experiencing this.

mdx0111 commented 4 years ago

I looked in folder "/home/masoud/.vscode/extensions/ms-vscode.csharp-1.21.3/.omnisharp/1.34.3/omnisharp/.msbuild/Current/Bin/" to see if I have MSBuild version 16 there. I checked the MSBuild.dll.config file and the contents of this file looks wrong.

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <section name="msbuildToolsets" type="Microsoft.Build.Evaluation.ToolsetConfigurationSection, Microsoft.Build, Version=15.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
  </configSections>
  <startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6" />
  </startup>
  <runtime>
    <AppContextSwitchOverrides value="Switch.System.IO.UseLegacyPathHandling=false;Switch.System.IO.BlockLongPaths=false" />
    <DisableFXClosureWalk enabled="true" />
    <generatePublisherEvidence enabled="false" />
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.Build.Framework" culture="neutral" publicKeyToken="b03f5f7f11d50a3a" />
        <bindingRedirect oldVersion="0.0.0.0-99.9.9.9" newVersion="15.1.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.Build" culture="neutral" publicKeyToken="b03f5f7f11d50a3a" />
        <bindingRedirect oldVersion="0.0.0.0-99.9.9.9" newVersion="15.1.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.Build.Conversion.Core" culture="neutral" publicKeyToken="b03f5f7f11d50a3a" />
        <bindingRedirect oldVersion="0.0.0.0-99.9.9.9" newVersion="15.1.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.Build.Tasks.Core" culture="neutral" publicKeyToken="b03f5f7f11d50a3a" />
        <bindingRedirect oldVersion="0.0.0.0-99.9.9.9" newVersion="15.1.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.Build.Utilities.Core" culture="neutral" publicKeyToken="b03f5f7f11d50a3a" />
        <bindingRedirect oldVersion="0.0.0.0-99.9.9.9" newVersion="15.1.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.Build.Engine" culture="neutral" publicKeyToken="b03f5f7f11d50a3a" />
        <bindingRedirect oldVersion="0.0.0.0-99.9.9.9" newVersion="15.1.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.Build.Conversion.Core" culture="neutral" publicKeyToken="b03f5f7f11d50a3a" />
        <bindingRedirect oldVersion="0.0.0.0-99.9.9.9" newVersion="15.1.0.0" />
      </dependentAssembly>
      <!-- Redirects for facade assemblies -->
      <dependentAssembly>
        <assemblyIdentity name="System.IO.Compression" culture="neutral" publicKeyToken="b77a5c561934e089" />
        <bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="System.Runtime.InteropServices.RuntimeInformation" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
      </dependentAssembly>
      <!-- Redirects for components dropped by Visual Studio -->
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.Activities.Build" culture="neutral" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="4.0.0.0" newVersion="15.0.0.0" />
        <codeBase version="15.0.0.0" href=".\amd64\Microsoft.Activities.Build.dll" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="XamlBuildTask" culture="neutral" publicKeyToken="31bf3856ad364e35" />
        <bindingRedirect oldVersion="4.0.0.0" newVersion="15.0.0.0" />
        <codeBase version="15.0.0.0" href=".\amd64\XamlBuildTask.dll" />
      </dependentAssembly>
      <!-- Workaround for crash in C++ CodeAnalysis scenarios due to https://github.com/Microsoft/msbuild/issues/1675 -->
      <dependentAssembly>
        <assemblyIdentity name="FxCopTask" culture="neutral" publicKeyToken="b03f5f7f11d50a3a" />
        <codeBase version="15.0.0.0" href="..\..\Microsoft\VisualStudio\v15.0\CodeAnalysis\FxCopTask.dll" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.VisualStudio.CodeAnalysis" culture="neutral" publicKeyToken="b03f5f7f11d50a3a" />
        <codeBase version="15.0.0.0" href="..\..\Microsoft\VisualStudio\v15.0\CodeAnalysis\Microsoft.VisualStudio.CodeAnalysis.dll" />
      </dependentAssembly>
      <dependentAssembly>
        <assemblyIdentity name="Microsoft.VisualStudio.CodeAnalysis.Sdk" culture="neutral" publicKeyToken="b03f5f7f11d50a3a" />
        <codeBase version="15.0.0.0" href="..\..\Microsoft\VisualStudio\v15.0\CodeAnalysis\Microsoft.VisualStudio.CodeAnalysis.Sdk.dll" />
      </dependentAssembly>
    </assemblyBinding>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Data.Common" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" />
      </dependentAssembly>
    </assemblyBinding>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Diagnostics.StackTrace" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" />
      </dependentAssembly>
    </assemblyBinding>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Diagnostics.Tracing" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" />
      </dependentAssembly>
    </assemblyBinding>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Globalization.Extensions" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" />
      </dependentAssembly>
    </assemblyBinding>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" />
      </dependentAssembly>
    </assemblyBinding>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Net.Sockets" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" />
      </dependentAssembly>
    </assemblyBinding>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Runtime.Serialization.Primitives" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.2.0.0" newVersion="4.2.0.0" />
      </dependentAssembly>
    </assemblyBinding>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Security.Cryptography.Algorithms" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.3.0.0" newVersion="4.3.0.0" />
      </dependentAssembly>
    </assemblyBinding>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Security.SecureString" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" />
      </dependentAssembly>
    </assemblyBinding>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Threading.Overlapped" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" />
      </dependentAssembly>
    </assemblyBinding>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <dependentAssembly>
        <assemblyIdentity name="System.Xml.XPath.XDocument" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-4.1.0.0" newVersion="4.1.0.0" />
      </dependentAssembly>
    </assemblyBinding>
  </runtime>
  <!-- To define one or more new toolsets, add an 'msbuildToolsets' element in this file. -->
  <msbuildToolsets default="15.0">
    <toolset toolsVersion="15.0">
      <property name="MSBuildToolsPath" value="$([MSBuild]::GetCurrentToolsDirectory())" />
      <property name="MSBuildToolsPath32" value="$([MSBuild]::GetToolsDirectory32())" />
      <property name="MSBuildToolsPath64" value="$([MSBuild]::GetToolsDirectory64())" />
      <property name="MSBuildSdksPath" value="$([MSBuild]::GetToolsDirectory32())\Sdks" />
      <property name="MSBuildRuntimeVersion" value="4.0.30319" />
      <property name="VisualStudioVersion" value="15.0" />
      <property name="RoslynTargetsPath" value="$([MSBuild]::GetToolsDirectory32())\Roslyn" />
      <projectImportSearchPaths>
        <searchPaths os="windows">
          <property name="MSBuildExtensionsPath" value="$(MSBuildProgramFiles32)\MSBuild" />
          <property name="MSBuildExtensionsPath32" value="$(MSBuildProgramFiles32)\MSBuild" />
          <property name="MSBuildExtensionsPath64" value="$(MSBuildProgramFiles32)\MSBuild" />
          <property name="VSToolsPath" value="$(MSBuildProgramFiles32)\MSBuild\Microsoft\VisualStudio\v$(VisualStudioVersion)" />
        </searchPaths>
        <searchPaths os="osx">
          <property name="MSBuildExtensionsPath" value="/Library/Frameworks/Mono.framework/External/xbuild/" />
          <property name="MSBuildExtensionsPath32" value="/Library/Frameworks/Mono.framework/External/xbuild/" />
          <property name="MSBuildExtensionsPath64" value="/Library/Frameworks/Mono.framework/External/xbuild/" />
          <property name="VSToolsPath" value="/Library/Frameworks/Mono.framework/External/xbuild/Microsoft/VisualStudio/v$(VisualStudioVersion)" />
        </searchPaths>
      </projectImportSearchPaths>
    </toolset>
  </msbuildToolsets>
</configuration>

It looks like the MSBuild located in the path that C# extension is referencing it is version 15 not 16?

Thanks.

filipw commented 4 years ago

It is version 16, however MsBuild 16 has assembly version 15.1.

mdx0111 commented 4 years ago

I see! Thanks :)

filipw commented 4 years ago

If you are on Linux or MacOS you may want to try install Mono 6.0.0 https://www.mono-project.com/download/stable/

MicKramer commented 4 years ago

Thank you. Come to think of it: I also have Visual Studio 2017 installed (version 15.9.14 running in .NET Framework 4.8.03752. Is it "cross contamination in my PATH so MSBuild from VS Studio is impacting?

File contents

OmniDemo.csproj

OmniDemo.csproj.txt

Program.cs

Program.cs.txt

filipw commented 4 years ago

No, the built in MsBuild is given preference over Visual Studio 2017. If you had Visual Studio 2019 installed though, then it would be used over the bundled MsBuild.

MicKramer commented 4 years ago

And I checked: No VS 2019 installed, nor previews. BTW: I'm running straight Windows 10 on MS Surface Laptop i5. Very ordinary personal laptop.

filipw commented 4 years ago

can you also post the contents of the obj/project.assets.json file?

MicKramer commented 4 years ago

Sure, and screenshot of VS Code - coming up in a moment - - -

gl81567405 commented 4 years ago

I have the same issue both on Windows 10. Both environments are updated and the latest versions of VSCode, C# Extension and .Net Core SDK are installed.

VSCode version: 1.38.1

C# Extension: 1.21.3

Net Core: 3.0

MicKramer commented 4 years ago

project.assets.json.txt

Note on screenshot: Taken after I copied .csproj/.cs files for drag-and-drop into this thread. Bug

seanmars commented 4 years ago

I have the same issue on Windows 10. I use the new version .NET Core 3.0 and just create the new console app by dotnet new console . And open the VS Code, then got the error.

OmniSharp log

Starting OmniSharp server at 2019/9/24 下午2:42:34 Target: d:\sandbox\console3 OmniSharp server started. Path: C:\Users\usernmars\.vscode\extensions\ms-vscode.csharp-1.21.3\.omnisharp\1.34.3\OmniSharp.exe PID: 19548 [info]: OmniSharp.Stdio.Host Starting OmniSharp on Windows 6.2.9200.0 (x64) [info]: OmniSharp.Services.DotNetCliService DotNetPath set to dotnet [info]: OmniSharp.MSBuild.Discovery.MSBuildLocator Located 2 MSBuild instance(s) 1: Visual Studio Community 2017 15.9.28307.718 - "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin" 2: StandAlone 16.0 - "C:\Users\usernmars\.vscode\extensions\ms-vscode.csharp-1.21.3\.omnisharp\1.34.3\.msbuild\Current\Bin" [info]: OmniSharp.MSBuild.Discovery.MSBuildLocator MSBUILD_EXE_PATH environment variable set to 'C:\Users\usernmars\.vscode\extensions\ms-vscode.csharp-1.21.3\.omnisharp\1.34.3\.msbuild\Current\Bin\MSBuild.exe' [info]: OmniSharp.MSBuild.Discovery.MSBuildLocator Registered MSBuild instance: StandAlone 16.0 - "C:\Users\usernmars\.vscode\extensions\ms-vscode.csharp-1.21.3\.omnisharp\1.34.3\.msbuild\Current\Bin" CscToolExe = csc.exe CscToolPath = C:\Users\usernmars\.vscode\extensions\ms-vscode.csharp-1.21.3\.omnisharp\1.34.3\.msbuild\Current\Bin\Roslyn MSBuildExtensionsPath = C:\Users\usernmars\.vscode\extensions\ms-vscode.csharp-1.21.3\.omnisharp\1.34.3\.msbuild MSBuildToolsPath = C:\Users\usernmars\.vscode\extensions\ms-vscode.csharp-1.21.3\.omnisharp\1.34.3\.msbuild\Current\Bin [info]: OmniSharp.Cake.CakeProjectSystem Detecting Cake files in 'd:\sandbox\console3'. [info]: OmniSharp.Cake.CakeProjectSystem Could not find any Cake files [info]: OmniSharp.MSBuild.ProjectSystem No solution files found in 'd:\sandbox\console3' [info]: OmniSharp.MSBuild.ProjectManager Queue project update for 'd:\sandbox\console3\console3.csproj' [info]: OmniSharp.Script.ScriptProjectSystem Detecting CSX files in 'd:\sandbox\console3'. [info]: OmniSharp.Script.ScriptProjectSystem Could not find any CSX files [info]: OmniSharp.WorkspaceInitializer Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0 [info]: OmniSharp.MSBuild.ProjectManager Loading project: d:\sandbox\console3\console3.csproj [info]: OmniSharp.WorkspaceInitializer Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.RenameWorkspaceOptionsProvider, Order: 100 [info]: OmniSharp.WorkspaceInitializer Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.EditorConfigWorkspaceOptionsProvider, Order: 200 [info]: OmniSharp.WorkspaceInitializer Configuration finished. [info]: OmniSharp.Stdio.Host Omnisharp server running using Stdio at location 'd:\sandbox\console3' on host 7560. [info]: OmniSharp.MSBuild.ProjectManager Successfully loaded project file 'd:\sandbox\console3\console3.csproj'. [info]: OmniSharp.MSBuild.ProjectManager Adding project 'd:\sandbox\console3\console3.csproj' [info]: OmniSharp.MSBuild.ProjectManager Update project: console3 [warn]: OmniSharp.MSBuild.PackageDependencyChecker console3: Did not find 'Microsoft.NETCore.App' in lock file.

C# log

Post the output from Output-->C# here

Environment information

VSCode version: 1.38.1 C# Extension: 1.21.3

Dotnet Information .NET Core SDK (reflecting any global.json): Version: 3.0.100 Commit: 04339c3a26 Runtime Environment: OS Name: Windows OS Version: 10.0.18362 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\3.0.100\ Host (useful for support): Version: 3.0.0 Commit: 7d57652f33 .NET Core SDKs installed: 2.2.402 [C:\Program Files\dotnet\sdk] 3.0.100 [C:\Program Files\dotnet\sdk] .NET Core runtimes installed: Microsoft.AspNetCore.All 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.2.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.2.7 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.1.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.2.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 3.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] To install additional .NET Core runtimes or SDKs: https://aka.ms/dotnet-download
Visual Studio Code Extensions |Extension|Author|Version| |---|---|---| |aspnet-helper|schneiderpat|0.6.4| |auto-close-tag|formulahendry|0.5.6| |auto-complete-tag|formulahendry|0.1.0| |auto-rename-tag|formulahendry|0.1.0| |auto-using|Fudge|0.7.9| |beautify|HookyQR|1.5.0| |better-comments|aaron-bond|2.0.5| |better-toml|bungcip|0.3.2| |Bookmarks|alefragnani|10.5.0| |bower|donjayamanne|0.0.3| |bracket-pair-colorizer|CoenraadS|1.0.61| |code-settings-sync|Shan|3.4.3| |code-spell-checker|streetsidesoftware|1.7.18| |copy-markdown-as-html|jerriepelser|1.1.0| |csharp|ms-vscode|1.21.3| |Csharp-ASPNETCore|rahulsahay|1.11.0| |csharpextensions|jchannon|1.3.0| |csharpfixformat|Leopotam|0.0.84| |docomment|k--kato|0.1.8| |dotnet|formulahendry|0.0.4| |dotnet-test-explorer|formulahendry|0.7.1| |EditorConfig|EditorConfig|0.13.0| |editorconfiggenerator|nepaul|0.2.1| |fake-img-snippet-collection|yoyoys|1.0.2| |git-file-history|pomber|1.0.1| |githistory|donjayamanne|0.4.6| |gitignore|codezombiech|0.6.0| |gitlens|eamodio|10.0.1| |gremlins|nhoizey|0.14.4| |html-css-class-completion|Zignd|1.19.0| |indent-rainbow|oderwat|7.4.0| |JavaScriptSnippets|xabikos|1.7.2| |LogFileHighlighter|emilast|2.5.0| |markdown-all-in-one|yzhang|2.4.2| |markdown-extended|jebbs|1.0.12| |markdown-preview-github-styles|bierner|0.1.6| |markdown-table-formatter|josa|0.3.0| |markdown-toc|AlanWalk|1.5.6| |material-icon-theme|PKief|3.9.0| |msbuild-project-tools|tintoy|0.2.55| |mysql-syntax|jakebathman|1.3.1| |npm-intellisense|christian-kohler|1.3.0| |nuget-reverse-package-search|jesschadwick|0.1.68| |omnipascal|Wosi|0.17.1| |open-in-browser|techer|2.0.0| |pascal-formatter|alefragnani|2.2.0| |path-intellisense|christian-kohler|1.4.2| |powershell|ms-vscode|2019.9.0| |prettier-vscode|esbenp|2.2.2| |quicktype|quicktype|12.0.46| |razor-plus|austincummings|0.1.4| |razor-snippets-for-asp-net-core|aledev29|0.0.3| |remote-wsl|ms-vscode-remote|0.39.5| |snippetica-csharp|josefpihrt-vscode|0.9.1| |supersharp|craigthomas|0.1.4| |theme-dracula|dracula-theme|2.18.0| |todo-tree|Gruntfuggly|0.0.153| |vsc-material-theme|Equinusocio|30.0.0| |vscode-apielements|vncz|0.6.7| |vscode-cdnjs|JakeWilson|0.18.0| |vscode-csharp-snippets|jorgeserrano|0.3.1| |vscode-css-peek|pranaygp|3.0.2| |vscode-dash|deerawan|2.2.0| |vscode-docker|ms-azuretools|0.8.1| |vscode-eslint|dbaeumer|1.9.1| |vscode-gitignore-generator|piotrpalarz|1.0.1| |vscode-html-css|ecmel|0.2.3| |vscode-markdownlint|DavidAnson|0.30.2| |vscode-nginx|shanoor|0.6.0| |vscode-npm-script|eg2|0.3.9| |vscode-nuget-package-manager|jmrog|1.1.6| |vscode-pandoc|DougFinke|0.0.8| |vscode-solution-explorer|fernandoescolar|0.3.5| |vscode-status-bar-format-toggle|tombonnike|1.5.0| |vscode-todo-highlight|wayou|1.0.4| |vscode-versionlens|pflannery|0.24.0| |vscode-xml-complete|rogalmic|0.2.1| |vscode-yaml|redhat|0.5.3| |vscodeintellicode|VisualStudioExptTeam|1.1.9| |webpack|jeremyrajan|2.1.3| |xml|DotJoshJohnson|2.5.0|;
filipw commented 4 years ago

if you are Windows, I believe the workaround will be to install Visual Studio 2019 (latest - 16.3) https://visualstudio.microsoft.com/vs/ Once full VS is on your machine, OmniSharp will use MsBuild from there to resolve the metadata of your projects.

MicKramer commented 4 years ago

OK, will do. Right now checking MSBuild's in my path. Install VS 2019 may take hours due to my web access speed. Search+compare takes minutes. And since several others have similar problem finding exact point-of-conflict could be helpful.

seanmars commented 4 years ago

if you are Windows, I believe the workaround will be to install Visual Studio 2019 (latest - 16.3) https://visualstudio.microsoft.com/vs/ Once full VS is on your machine, OmniSharp will use MsBuild from there to resolve the metadata of your projects.

Really! I goes to updated my VS 2019, and all problem are fixed. But is there anyway to split VS Code and VS? I don't want update the VS 2019 everytime (take too long time). What can i setting for VS Code(Omnisharp)? Thanks.

filipw commented 4 years ago

Thanks a lot for confirming 👍

If anyone experiences this problem on *nix platforms I believer this should help too https://github.com/OmniSharp/omnisharp-vscode/issues/3289#issuecomment-534396993

OmniSharp ships with an embedded MSBuild which for various reasons is somewhat limited - it should work however for more basic scenarios like shown here. If we find VS2019 (Windows) or Mono 5.18.1+ (Linux, MacOS) on the machine, we use that instead.

We are investigating how we can bring the embedded MSBuild up to speed here and what goes wrong there.

mdx0111 commented 4 years ago

Thanks a lot for confirming 👍

If anyone experiences this problem on *nix platforms I believer this should help too #3289 (comment)

OmniSharp ships with an embedded MSBuild which for various reasons is somewhat limited - it should work however for more basic scenarios like shown here. If we find VS2019 (Windows) or Mono 5.18.1+ (Linux, MacOS) on the machine, we use that instead.

We are investigating how we can bring the embedded MSBuild up to speed here and what goes wrong there.

I'll give this a go once I'm back home.

paulsbond commented 4 years ago

I'm experiencing the same issue on Ubuntu 18.04.

$ dotnet --version
3.0.100
$ dotnet new console -o hello
$ cd hello
$ more hello.csproj
<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp3.0</TargetFramework>
  </PropertyGroup>

</Project>
$ dotnet run
Hello World!

But I open in vscode 1.38.1 with ms-vscode.csharp extension version 1.21.3 I get the same warning as other people in the OmniSharp Log:

[warn]: OmniSharp.MSBuild.PackageDependencyChecker
        hello: Did not find 'Microsoft.NETCore.App' in lock file.

I also get unresolved dependencies asking me to restore and intellisense not working with lots of errors similar to the following one:

The type or namespace name 'System' could not be found (are you missing a using directive or an assembly reference?) (CS0246) [hello]

Installing mono-devel from Mono 6.0.0 Stable (https://www.mono-project.com/download/stable/) fixed the issue, but it needs another 365 MB disk space.

mdx0111 commented 4 years ago

if you are Windows, I believe the workaround will be to install Visual Studio 2019 (latest - 16.3) https://visualstudio.microsoft.com/vs/ Once full VS is on your machine, OmniSharp will use MsBuild from there to resolve the metadata of your projects.

Still not working on my Windows 10 even with VS19 installed. Please see the OmniSharp log below:

Starting OmniSharp server at 24/09/2019, 08:56:08
    Target: e:\Learning Base\Testing Area\Test

OmniSharp server started.
    Path: C:\Users\mdehghani\.vscode\extensions\ms-vscode.csharp-1.21.3\.omnisharp\1.34.3\OmniSharp.exe
    PID: 11036

[info]: OmniSharp.Stdio.Host
        Starting OmniSharp on Windows 6.2.9200.0 (x64)
[info]: OmniSharp.Services.DotNetCliService
        DotNetPath set to dotnet
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Located 4 MSBuild instance(s)
            1: Visual Studio Enterprise 2017 15.9.28307.858 - "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin"
            2: Visual Studio Build Tools 2017 15.9.28307.858 - "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin"
            3: Visual Studio Community 2019 16.2.29306.81 - "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin"
            4: StandAlone 16.0 - "C:\Users\mdehghani\.vscode\extensions\ms-vscode.csharp-1.21.3\.omnisharp\1.34.3\.msbuild\Current\Bin"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Registered MSBuild instance: Visual Studio Community 2019 16.2.29306.81 - "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin"
[info]: OmniSharp.Cake.CakeProjectSystem
        Detecting Cake files in 'e:\Learning Base\Testing Area\Test'.
[info]: OmniSharp.Cake.CakeProjectSystem
        Could not find any Cake files
[info]: OmniSharp.MSBuild.ProjectSystem
        No solution files found in 'e:\Learning Base\Testing Area\Test'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for 'e:\Learning Base\Testing Area\Test\Test.csproj'
[info]: OmniSharp.Script.ScriptProjectSystem
        Detecting CSX files in 'e:\Learning Base\Testing Area\Test'.
[info]: OmniSharp.Script.ScriptProjectSystem
        Could not find any CSX files
[info]: OmniSharp.WorkspaceInitializer
        Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: e:\Learning Base\Testing Area\Test\Test.csproj
[info]: OmniSharp.WorkspaceInitializer
        Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.RenameWorkspaceOptionsProvider, Order: 100
[info]: OmniSharp.WorkspaceInitializer
        Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.EditorConfigWorkspaceOptionsProvider, Order: 200
[info]: OmniSharp.WorkspaceInitializer
        Configuration finished.
[info]: OmniSharp.Stdio.Host
        Omnisharp server running using Stdio at location 'e:\Learning Base\Testing Area\Test' on host 11992.
[info]: OmniSharp.MSBuild.ProjectManager
        Successfully loaded project file 'e:\Learning Base\Testing Area\Test\Test.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
        Adding project 'e:\Learning Base\Testing Area\Test\Test.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Update project: Test
[warn]: OmniSharp.MSBuild.PackageDependencyChecker
        Test: Did not find 'Microsoft.NETCore.App' in lock file.
MicKramer commented 4 years ago

AND - Install VS 2019 Community edition solved issue on my laptop as well. My conclusion: Somewhere this C# Extension (or OmniSharp) has a dependency on installation that sometimes fails. Anyways, off for work … Thx @filipw and others!

paulsbond commented 4 years ago

Just a note that if I uninstalled dotnet-sdk-2.2 (so that I only have dotnet-sdk-3.0 installed) I get a different error in the OmniSharp Log:

The SDK 'Microsoft.NET.Sdk' specified could not be found

I could then fix the issue by making omnisharp use the legacy SDK resolver as mentioned in https://github.com/OmniSharp/omnisharp-vscode/issues/3160#issuecomment-517057835

DanielKOcean commented 4 years ago

I think, that best way to solve the problem is to wait till OmniSharp will roll-out the uppdate for their extension with standalone 16.0+ msbuild package. As for me, I see, that extension uses this one: Registered MSBuild instance: StandAlone 16.0 and I am 100% sure that it is a reason (16.3 is for .NET Core, as I know). I face this problem on corporate laptop where VS2017 is installed, but everything works fine on my PC with VS 2019.3. Try to copy bin folder C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\16.3 from VS 2019.3 version to something like that: .vscode\extensions\ms-vscode.csharp-1.21.3\.omnisharp\1.34.3\.msbuild\Current It can help for now, I think, but I an try this trick only after work.

mdx0111 commented 4 years ago

This is my OmniSharp log after uninstalling all other .net core sdks and only having version 3 installed:

Starting OmniSharp server at 24/09/2019, 09:48:39
    Target: e:\Learning Base\Testing Area\Test

OmniSharp server started.
    Path: C:\Users\mdehghani\.vscode\extensions\ms-vscode.csharp-1.21.3\.omnisharp\1.34.3\OmniSharp.exe
    PID: 12960

[info]: OmniSharp.Stdio.Host
        Starting OmniSharp on Windows 6.2.9200.0 (x64)
[info]: OmniSharp.Services.DotNetCliService
        DotNetPath set to dotnet
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Located 4 MSBuild instance(s)
            1: Visual Studio Enterprise 2017 15.9.28307.858 - "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin"
            2: Visual Studio Build Tools 2017 15.9.28307.858 - "C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin"
            3: Visual Studio Community 2019 16.2.29306.81 - "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin"
            4: StandAlone 16.0 - "c:\Users\mdehghani\.vscode\extensions\ms-vscode.csharp-1.21.3\.omnisharp\1.34.3\.msbuild\Current\Bin"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Registered MSBuild instance: Visual Studio Community 2019 16.2.29306.81 - "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin"
[info]: OmniSharp.Cake.CakeProjectSystem
        Detecting Cake files in 'e:\Learning Base\Testing Area\Test'.
[info]: OmniSharp.Cake.CakeProjectSystem
        Could not find any Cake files
[info]: OmniSharp.MSBuild.ProjectSystem
        No solution files found in 'e:\Learning Base\Testing Area\Test'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for 'e:\Learning Base\Testing Area\Test\Test.csproj'
[info]: OmniSharp.Script.ScriptProjectSystem
        Detecting CSX files in 'e:\Learning Base\Testing Area\Test'.
[info]: OmniSharp.Script.ScriptProjectSystem
        Could not find any CSX files
[info]: OmniSharp.WorkspaceInitializer
        Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: e:\Learning Base\Testing Area\Test\Test.csproj
[info]: OmniSharp.WorkspaceInitializer
        Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.RenameWorkspaceOptionsProvider, Order: 100
[info]: OmniSharp.WorkspaceInitializer
        Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.EditorConfigWorkspaceOptionsProvider, Order: 200
[info]: OmniSharp.WorkspaceInitializer
        Configuration finished.
[info]: OmniSharp.Stdio.Host
        Omnisharp server running using Stdio at location 'e:\Learning Base\Testing Area\Test' on host 15880.
[warn]: OmniSharp.MSBuild.ProjectManager
        Failed to load project file 'e:\Learning Base\Testing Area\Test\Test.csproj'.
e:\Learning Base\Testing Area\Test\Test.csproj(1,1)
Microsoft.Build.Exceptions.InvalidProjectFileException: The SDK 'Microsoft.NET.Sdk' specified could not be found.  e:\Learning Base\Testing Area\Test\Test.csproj
   at Microsoft.Build.Shared.ProjectErrorUtilities.ThrowInvalidProject(String errorSubCategoryResourceName, IElementLocation elementLocation, String resourceName, Object[] args)
   at Microsoft.Build.Evaluation.Evaluator`4.ExpandAndLoadImportsFromUnescapedImportExpressionConditioned(String directoryOfImportingFile, ProjectImportElement importElement, List`1& projects, SdkResult& sdkResult, Boolean throwOnFileNotExistsError)
   at Microsoft.Build.Evaluation.Evaluator`4.ExpandAndLoadImports(String directoryOfImportingFile, ProjectImportElement importElement, SdkResult& sdkResult)
   at Microsoft.Build.Evaluation.Evaluator`4.EvaluateImportElement(String directoryOfImportingFile, ProjectImportElement importElement)
   at Microsoft.Build.Evaluation.Evaluator`4.PerformDepthFirstPass(ProjectRootElement currentProjectOrImport)
   at Microsoft.Build.Evaluation.Evaluator`4.Evaluate(ILoggingService loggingService, BuildEventContext buildEventContext)
   at Microsoft.Build.Evaluation.Project.Reevaluate(ILoggingService loggingServiceForEvaluation, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext)
   at Microsoft.Build.Evaluation.Project.ReevaluateIfNecessary(ILoggingService loggingServiceForEvaluation, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext)
   at Microsoft.Build.Evaluation.Project.Initialize(IDictionary`2 globalProperties, String toolsVersion, String subToolsetVersion, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext)
   at Microsoft.Build.Evaluation.Project..ctor(String projectFile, IDictionary`2 globalProperties, String toolsVersion, String subToolsetVersion, ProjectCollection projectCollection, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext)
   at Microsoft.Build.Evaluation.ProjectCollection.LoadProject(String fileName, IDictionary`2 globalProperties, String toolsVersion)
   at OmniSharp.MSBuild.ProjectLoader.EvaluateProjectFileCore(String filePath) in C:\projects\omnisharp-roslyn\src\OmniSharp.MSBuild\ProjectLoader.cs:line 129
   at OmniSharp.MSBuild.ProjectLoader.BuildProject(String filePath) in C:\projects\omnisharp-roslyn\src\OmniSharp.MSBuild\ProjectLoader.cs:line 72
   at OmniSharp.MSBuild.ProjectFile.ProjectFileInfo.Load(String filePath, ProjectIdInfo projectIdInfo, ProjectLoader loader) in C:\projects\omnisharp-roslyn\src\OmniSharp.MSBuild\ProjectFile\ProjectFileInfo.cs:line 98
   at OmniSharp.MSBuild.ProjectManager.LoadOrReloadProject(String projectFilePath, Func`1 loader) in C:\projects\omnisharp-roslyn\src\OmniSharp.MSBuild\ProjectManager.cs:line 308

[fail]: OmniSharp.MSBuild.ProjectManager
        Attempted to update project that is not loaded: e:\Learning Base\Testing Area\Test\Test.csproj
filipw commented 4 years ago

you could try adding omnisharp.json file:

{
   "MSBuild": {
       "UseLegacySdkResolver": true
   }
}

and see if it helps

mdx0111 commented 4 years ago

you could try adding omnisharp.json file:

{
   "MSBuild": {
       "UseLegacySdkResolver": true
   }
}

and see if it helps

Thanks. It helped! I'm going to try this on my Fedora machine as well. I'm going to uninstall .net core 2 and only have version 3 installed and see if this workaround works there as well.

DanielKOcean commented 4 years ago

Guys, I've got the solution (for those, who don't want to install VS2019).

  1. Go to Microsoft VS downloads.
  2. Download "Build Tools for Visual Studio 2019", then install it.
  3. Go to modify -> Individual components, ccheck ".NET Core 3.0 SDK". Install.
  4. Start your VS Code and have fun.

After it I get this output:

[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Located 3 MSBuild instance(s)
            1: Visual Studio Professional 2017 15.9.28307.858 - "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin"
            2: Visual Studio Build Tools 2019 16.3.29318.209 - "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin"
            3: StandAlone 16.0 - "C:\Users\*********\.vscode\extensions\ms-vscode.csharp-1.21.3\.omnisharp\1.34.3\.msbuild\Current\Bin"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Registered MSBuild instance: Visual Studio Build Tools 2019 16.3.29318.209 - "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin"

So correct version of MSBuild is now used by OmniSharp. But don't forget about step 3, solution need .Net Core 3.0 SDK for VisualStudio.

mdx0111 commented 4 years ago

I got it fixed on Fedora 30 just by removing .net core 2.2 and only having .net core 3 installed.

juandelacruz23 commented 4 years ago

While working with Blazor, adding omnisharp.json wasn't enough, I had to install de 2019 build tools.

Guys, I've got the solution (for those, who don't want to install VS2019).

1. Go to [Microsoft VS downloads](https://visualstudio.microsoft.com/downloads/).

2. Download "Build Tools for Visual Studio 2019", then install it.

3. Go to modify -> Individual components, ccheck ".NET Core 3.0 SDK". Install.

4. Start your VS Code and have fun.

After it I get this output:

[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Located 3 MSBuild instance(s)
            1: Visual Studio Professional 2017 15.9.28307.858 - "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\MSBuild\15.0\Bin"
            2: Visual Studio Build Tools 2019 16.3.29318.209 - "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin"
            3: StandAlone 16.0 - "C:\Users\*********\.vscode\extensions\ms-vscode.csharp-1.21.3\.omnisharp\1.34.3\.msbuild\Current\Bin"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Registered MSBuild instance: Visual Studio Build Tools 2019 16.3.29318.209 - "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\MSBuild\Current\Bin"

So correct version of MSBuild is now used by OmniSharp. But don't forget about step 3, solution need .Net Core 3.0 SDK for VisualStudio.

I'm using Chocolatey, so to do this I installed visualstudio2019buildtools and visualstudio2019-workload-netcorebuildtools. Anyone who uses it probably would just need the to install the last one, because it already has the first as a dependency. :)

atrauzzi commented 4 years ago

Uninstalling all but 3.x and doing the comment by @filipw worked for me on Windows.

markmcgookin commented 4 years ago

For anyone finding this a bit later. I was using VSCode on Mac OS.... I had mono 6.0.0 installed and had the red lines everywhere. Upgraded to 6.4.0 stable (Visual Studio Version) and it's working great. No red lines.