Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
lliill opened this issue Jul 28, 2019 · 6 comments
Closed

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

lliill opened this issue Jul 28, 2019 · 6 comments
Labels
.Net sdk not found These are a group of issues when the dotnet sdk could not be found

Comments

@lliill
Copy link

lliill commented Jul 28, 2019

Environment data

dotnet --info output:

.NET Core SDK (reflecting any global.json):
Version: 2.2.401
Commit: 729b316c13

Runtime Environment:
OS Name: Windows
OS Version: 10.0.18362
OS Platform: Windows
RID: win10-x64
Base Path: C:\Program Files\dotnet\sdk\2.2.401\

Host (useful for support):
Version: 2.2.6
Commit: 7dac9b1b51

.NET Core SDKs installed:
2.2.401 [C:\Program Files\dotnet\sdk]

.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.2.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.2.6 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.2.6 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]

VS Code version:
1.36.1
C# Extension version:
1.21.0

Steps to reproduce

Press F5 to begin debugging with .NET Core

Expected behavior

As the dotnet run does

Actual behavior

Starting OmniSharp server at 7/28/2019, 4:38:05 PM
Target: c:\Users\limen\myApp\classes

OmniSharp server started.
Path: C:\Users\limen.vscode\extensions\ms-vscode.csharp-1.21.0.omnisharp\1.34.0\OmniSharp.exe
PID: 11920

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 2019 16.2.29123.88 - "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin"
2: StandAlone 16.0 - "c:\Users\limen.vscode\extensions\ms-vscode.csharp-1.21.0.omnisharp\1.34.0.msbuild\Current\Bin"
info: OmniSharp.MSBuild.Discovery.MSBuildLocator
Registered MSBuild instance: Visual Studio Community 2019 16.2.29123.88 - "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Current\Bin"
info: OmniSharp.Cake.CakeProjectSystem
Detecting Cake files in 'c:\Users\limen\myApp\classes'.
info: OmniSharp.Cake.CakeProjectSystem
Could not find any Cake files
info: OmniSharp.MSBuild.ProjectSystem
No solution files found in 'c:\Users\limen\myApp\classes'
info: OmniSharp.MSBuild.ProjectManager
Queue project update for 'c:\Users\limen\myApp\classes\classes.csproj'
info: OmniSharp.Script.ScriptProjectSystem
Detecting CSX files in 'c:\Users\limen\myApp\classes'.
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: c:\Users\limen\myApp\classes\classes.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 'c:\Users\limen\myApp\classes' on host 10016.
[warn]: OmniSharp.MSBuild.ProjectManager
Failed to load project file 'c:\Users\limen\myApp\classes\classes.csproj'.
c:\Users\limen\myApp\classes\classes.csproj(1,1)
Microsoft.Build.Exceptions.InvalidProjectFileException: The SDK 'Microsoft.NET.Sdk' specified could not be found. c:\Users\limen\myApp\classes\classes.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, SdkResult& sdkResult, Boolean throwOnFileNotExistsError)
at Microsoft.Build.Evaluation.Evaluator4.ExpandAndLoadImports(String directoryOfImportingFile, ProjectImportElement importElement, SdkResult& sdkResult) 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, EvaluationContext evaluationContext)
at Microsoft.Build.Evaluation.Project.ReevaluateIfNecessary(ILoggingService loggingServiceForEvaluation, ProjectLoadSettings loadSettings, 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 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 95 at OmniSharp.MSBuild.ProjectManager.LoadOrReloadProject(String projectFilePath, Func1 loader) in C:\projects\omnisharp-roslyn\src\OmniSharp.MSBuild\ProjectManager.cs:line 308

Attempted to update project that is not loaded: c:\Users\limen\myApp\classes\classes.csproj
info: OmniSharp.OmniSharpWorkspace
Miscellaneous file: c:\Users\limen\myApp\classes\BankAccount.cs added to workspace
info: OmniSharp.OmniSharpWorkspace
Miscellaneous file: c:\Users\limen\myApp\classes\Program.cs added to workspace

@rchande
Copy link

rchande commented Jul 29, 2019

@lliill Is it possible for you to share the contents of classes.csproj? Thanks!

@lliill
Copy link
Author

lliill commented Jul 30, 2019

@rchande
it is only the basic class used in MS tutorial.

classes.zip

@akshita31
Copy link
Contributor

@lliill It looks like you might be missing the necessary Build Tools.
Can you try installing .Net Core Build Tools as described here

@akshita31 akshita31 added the .Net sdk not found These are a group of issues when the dotnet sdk could not be found label Aug 2, 2019
@lliill
Copy link
Author

lliill commented Aug 5, 2019

@akshita31 how can I install the .Net Core Build Tools without VS studio? I have only installed the .Net Core SDK and I didn't find the .Net Core Build Tools in the website. How can I verify if it was installed?

@akshita31
Copy link
Contributor

https://visualstudio.microsoft.com/downloads/#build-tools-for-visual-studio-2019

Can you try installing the build tools from the above ?

@lliill
Copy link
Author

lliill commented Aug 7, 2019

In fact, I don't really want to install vs studio....

@lliill lliill closed this as completed Aug 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
.Net sdk not found These are a group of issues when the dotnet sdk could not be found
Projects
None yet
Development

No branches or pull requests

3 participants