dotnet / vscode-csharp

Official C# support for Visual Studio Code
MIT License
2.88k stars 675 forks source link

OmniSharp.MSBuild.ProjectManager Failed to load project file #3122

Closed Chiliyago closed 6 days ago

Chiliyago commented 5 years ago

Environment data

.NET Core SDK (reflecting any global.json): Version: 2.2.300 Commit: 73efd5bd87

Runtime Environment: OS Name: Windows OS Version: 6.1.7601 OS Platform: Windows RID: win7-x64 Base Path: C:\Program Files\dotnet\sdk\2.2.300\

Host (useful for support): Version: 2.2.5 Commit: 0a3c9209c0

.NET Core SDKs installed: 1.1.0 [C:\Program Files\dotnet\sdk] 2.1.104 [C:\Program Files\dotnet\sdk] 2.1.201 [C:\Program Files\dotnet\sdk] 2.2.300 [C:\Program Files\dotnet\sdk]

.NET Core runtimes installed: Microsoft.AspNetCore.All 2.2.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.2.5 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 1.0.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 1.1.2 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.0.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.0.7 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.NETCore.App 2.2.5 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]

VS Code version: Version: 1.35.1 (system setup) Commit: c7d83e57cd18f18026a8162d042843bda1bcf21f Date: 2019-06-12T14:30:02.622Z Electron: 3.1.8 Chrome: 66.0.3359.181 Node.js: 10.2.0 V8: 6.6.346.32 OS: Windows_NT x64 6.1.7601

C# Extension version: 1.20

Steps to reproduce

Create New Project: dotnet new webapp -o RazorPagesMovie --no-https

Open Folder'RazorPagesMovie ' in VSCode.

VS Code Toast Notice: Some Projects have trouble loading. Please review the output for more details. Source: C# (Extension)

Starting OmniSharp server at 6/17/2019, 1:32:44 PM Target: c:_Github\RazorPagesMovie

OmniSharp server started. Path: C:\Users\timothyo.vscode\extensions\ms-vscode.csharp-1.20.0.omnisharp\1.32.20\OmniSharp.exe PID: 48116

    Starting OmniSharp on Windows 6.1.7601.65536 (x64)
    DotNetPath set to dotnet
    Located 2 MSBuild instance(s)
        1: Visual Studio Enterprise 2017 15.7.27703.2035 - "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin"
        2: StandAlone 15.0 - "C:\Users\timothyo\.vscode\extensions\ms-vscode.csharp-1.20.0\.omnisharp\1.32.20\.msbuild\Current\Bin"
    Registered MSBuild instance: Visual Studio Enterprise 2017 15.7.27703.2035 - "C:\Program Files (x86)\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin"
    Detecting Cake files in 'c:\_Github\RazorPagesMovie'.
    Could not find any Cake files
    Project system 'OmniSharp.DotNet.DotNetProjectSystem' is disabled in the configuration.
    No solution files found in 'c:\_Github\RazorPagesMovie'
    Queue project update for 'c:\_Github\RazorPagesMovie\RazorPagesMovie.csproj'
    Detecting CSX files in 'c:\_Github\RazorPagesMovie'.
    Could not find any CSX files
    Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpWorkspaceOptionsProvider
    Loading project: c:\_Github\RazorPagesMovie\RazorPagesMovie.csproj
    Configuration finished.
    Omnisharp server running using Stdio at location 'c:\_Github\RazorPagesMovie' on host 63460.
    Failed to load project file 'c:\_Github\RazorPagesMovie\RazorPagesMovie.csproj'.

c:_Github\RazorPagesMovie\RazorPagesMovie.csproj(1,1) Microsoft.Build.Exceptions.InvalidProjectFileException: The SDK 'Microsoft.NET.Sdk.Web' specified could not be found. c:_Github\RazorPagesMovie\RazorPagesMovie.csproj at Microsoft.Build.Shared.ProjectErrorUtilities.ThrowInvalidProject(String errorSubCategoryResourceName, IElementLocation elementLocation, String resourceName, Object[] args) at Microsoft.Build.Evaluation.Evaluator4.ExpandAndLoadImportsFromUnescapedImportExpressionConditioned(String directoryOfImportingFile, ProjectImportElement importElement, List1& projects, Boolean throwOnFileNotExistsError) at Microsoft.Build.Evaluation.Evaluator4.ExpandAndLoadImports(String directoryOfImportingFile, ProjectImportElement importElement) at Microsoft.Build.Evaluation.Evaluator4.EvaluateImportElement(String directoryOfImportingFile, ProjectImportElement importElement) at Microsoft.Build.Evaluation.Evaluator4.PerformDepthFirstPass(ProjectRootElement currentProjectOrImport) at Microsoft.Build.Evaluation.Evaluator4.Evaluate(ILoggingService loggingService, BuildEventContext buildEventContext) at Microsoft.Build.Evaluation.Project.Reevaluate(ILoggingService loggingServiceForEvaluation, ProjectLoadSettings loadSettings) at Microsoft.Build.Evaluation.Project.ReevaluateIfNecessary(ILoggingService loggingServiceForEvaluation, ProjectLoadSettings loadSettings) at Microsoft.Build.Evaluation.Project.ReevaluateIfNecessary(EvaluationContext evaluationContext) at Microsoft.Build.Evaluation.Project.Initialize(IDictionary2 globalProperties, String toolsVersion, String subToolsetVersion, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext) at Microsoft.Build.Evaluation.Project..ctor(String projectFile, IDictionary2 globalProperties, String toolsVersion, String subToolsetVersion, ProjectCollection projectCollection, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext) at Microsoft.Build.Evaluation.ProjectCollection.LoadProject(String fileName, IDictionary2 globalProperties, String toolsVersion) at OmniSharp.MSBuild.ProjectLoader.EvaluateProjectFileCore(String filePath) in D:\a\1\s\src\OmniSharp.MSBuild\ProjectLoader.cs:line 129 at OmniSharp.MSBuild.ProjectLoader.BuildProject(String filePath) in D:\a\1\s\src\OmniSharp.MSBuild\ProjectLoader.cs:line 72 at OmniSharp.MSBuild.ProjectFile.ProjectFileInfo.Load(String filePath, ProjectIdInfo projectIdInfo, ProjectLoader loader) in D:\a\1\s\src\OmniSharp.MSBuild\ProjectFile\ProjectFileInfo.cs:line 94 at OmniSharp.MSBuild.ProjectManager.<>c__DisplayClass30_0.<LoadProject>b__0() in D:\a\1\s\src\OmniSharp.MSBuild\ProjectManager.cs:line 293 at OmniSharp.MSBuild.ProjectManager.LoadOrReloadProject(String projectFilePath, Func1 loader) in D:\a\1\s\src\OmniSharp.MSBuild\ProjectManager.cs:line 304

    Attempted to update project that is not loaded: c:\_Github\RazorPagesMovie\RazorPagesMovie.csproj

Expected behavior

No error and everything loads as advertised

Actual behavior

JoeRobich commented 6 days ago

A lot has changes with sdk resolution since this issue was opened. If you are still seeing problems, please open a new issue.