Open jesperkristensen opened 3 years ago
One work around is to add a global omnisharp configuration file located in %USERPROFILE%/.omnisharp/
which enables the automatic package restore option (See https://github.com/OmniSharp/omnisharp-roslyn/wiki/Configuration-Options)
{
"msbuild": {
"EnablePackageAutoRestore" : true
}
}
Issue Description
Sometimes VS Code cannot open a solution before it has been restored, and VS Code cannot restore a solution before it has been opened. So I have to navigate to the solution in a terminal and run the
dotnet restore
command from there before I can open it.Steps to Reproduce
Expected Behavior
"OmniSharp: Select Project" should open all projects in the .sln file no matter if they were already restored or not, such that a subsequent ".NET: Restore All Projects" command would include all the projects.
Actual Behavior
Need to open a terminal and run
dotnet restore ****.sln
before using "OmniSharp: Select Project"Logs
OmniSharp log
****.csproj C:\Program Files\dotnet\sdk\5.0.302\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(241,5): Error: Package Microsoft.EntityFrameworkCore.Analyzers, version 3.1.14 was not found. It might have been deleted since NuGet restore. Otherwise, NuGet restore might have only partially completed, which might have been due to maximum path length restrictions.
C# log
Environment information
VSCode version: 1.58.2 C# Extension: 1.23.14
Dotnet Information
.NET SDK (reflecting any global.json): Version: 5.0.302 Commit: c005824e35 Runtime Environment: OS Name: Windows OS Version: 10.0.17763 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\5.0.302\ Host (useful for support): Version: 5.0.8 Commit: 35964c9215 .NET SDKs installed: 3.1.407 [C:\Program Files\dotnet\sdk] 5.0.201 [C:\Program Files\dotnet\sdk] 5.0.302 [C:\Program Files\dotnet\sdk] .NET runtimes installed: Microsoft.AspNetCore.App 3.1.13 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 5.0.4 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 5.0.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 3.1.13 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 5.0.4 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 5.0.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 3.1.13 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 5.0.4 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] Microsoft.WindowsDesktop.App 5.0.8 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App] To install additional .NET runtimes or SDKs: https://aka.ms/dotnet-downloadVisual Studio Code Extensions
|Extension|Author|Version| |---|---|---| |azure-account|ms-vscode|0.9.8| |azure-pipelines|ms-azure-devops|1.188.1| |azurecli|ms-vscode|0.5.0| |azurite|Azurite|3.14.0| |csharp|ms-dotnettools|1.23.14| |docomment|k--kato|0.1.20| |dotnet-interactive-vscode|ms-dotnettools|1.0.2357010| |EditorConfig|EditorConfig|0.16.4| |git-graph|mhutchie|1.30.0| |gitlens|eamodio|11.6.0| |jupyter|ms-toolsai|2021.8.1054968649| |markdown-all-in-one|yzhang|3.4.0| |todo-tree|Gruntfuggly|0.0.213| |user-secrets|adrianwilczynski|2.0.1| |uuid-generator|netcorext|0.0.4| |vscode-azurefunctions|ms-azuretools|1.4.1| |vscode-azureresourcegroups|ms-azuretools|0.4.0| |vscode-azurestorage|ms-azuretools|0.12.1| |vscode-bicep|ms-azuretools|0.4.451| |vscode-dotnet-runtime|ms-dotnettools|1.2.0|;