'VS Code Error Some projects have trouble loading. Please review the output for more details
Issue Description
Error when creating and loading dotnet console application for .NET 5.0
Steps to Reproduce
- Start VS Code under Windows 10
- Create a new dotnet project using C#
dotnet new console --framework net5.0
- Try to use IntelliSense
Expected Behavior
Everything is working fine and C# IntelliSense is working.
Actual Behavior
Error reported from OmniSharp Output Log. You can build and run the project, but IntelliSense is not working.
It was working before and suddenly stopped working.
Logs
OmniSharp log
Environment information
VSCode version: 1.65.2 C# Extension: 1.24.1
See the full output log attached.
Runtime Environment:
OS Name: Windows
OS Version: 10.0.19042
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\6.0.102\
Host (useful for support):
Version: 6.0.2
Commit: 839cdfb0ec
.NET SDKs installed:
5.0.302 [C:\Program Files\dotnet\sdk]
5.0.405 [C:\Program Files\dotnet\sdk]
6.0.102 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 5.0.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 5.0.14 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 6.0.2 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 5.0.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 5.0.14 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 6.0.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 5.0.8 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 5.0.14 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 6.0.2 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Visual Studio Code Extensions
| Extension | Author | Version |
|---|---|---|
| atlascode | atlassian | 2.10.9 |
| Bookmarks | alefragnani | 13.2.4 |
| code-spell-checker | streetsidesoftware | 2.1.7 |
| csharp | ms-dotnettools | 1.24.1 |
| data-workspace-vscode | ms-mssql | 0.1.1 |
| dotnet-test-explorer | formulahendry | 0.7.7 |
| fabric8-analytics | redhat | 0.3.5 |
| java | redhat | 1.4.0 |
| mssql | ms-mssql | 1.13.0 |
| open-lnk | EnkelDigital | 0.0.1 |
| packsharp | elsnoman | 2.3.2 |
| powershell | ms-vscode | 2021.12.0 |
| sql-database-projects-vscode | ms-mssql | 0.14.1 |
| vscode-commons | redhat | 0.0.6 |
| vscode-eslint | dbaeumer | 2.2.2 |
| vscode-fileutils | sleistner | 3.5.0 |
| vscode-html-css | ecmel | 1.11.0 |
| vscode-java-debug | vscjava | 0.38.0 |
| vscode-java-dependency | vscjava | 0.19.0 |
| vscode-java-pack | vscjava | 0.22.0 |
| vscode-java-test | vscjava | 0.34.2 |
| vscode-maven | vscjava | 0.35.1 |
| vscode-nuget-package-manager | jmrog | 1.1.6 |
| vscode-yaml | redhat | 1.5.1 |
| vscodeintellicode | VisualStudioExptTeam | 1.2.17 |
| xml | DotJoshJohnson | 2.5.1 |
Solution 1:[1]
The solution is to remover "omnisharp.path": "latest" setting JSON file.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | tarekahf |
