question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Some projects have trouble loading. Please review the output for more details.

See original GitHub issue

Environment data

dotnet --info output:

.NET Command Line Tools (2.1.105)

Product Information:
 Version:            2.1.105
 Commit SHA-1 hash:  141cc8d976

Runtime Environment:
 OS Name:     arch
 OS Version:  
 OS Platform: Linux
 RID:         linux-x64
 Base Path:   /opt/dotnet/sdk/2.1.105/

Microsoft .NET Core Shared Framework Host

  Version  : 2.0.7
  Build    : 2d61d0b043915bc948ebf98836fefe9ba942be11

VS Code version:

1.23.0
7c7da59c2333a1306c41e6e7b68d7f0caa7b3d45
x64

C# Extension version: 1.14.0

Steps to reproduce

Create a new ASP.NET Core project (ex. with command dotnet new mvc --auth individual -o MyAsp), load the project in Visual Studio Code.

Expected behavior

Project opens and C# extension loads successfully.

Actual behavior

Project opens but message appears in bottom right corner saying Some projects have trouble loading. Please review the output for more details.. Output tab content includes:

Failed to load project file '/home/mwelke/MyAsp/MyAsp.csproj'.
/home/mwelke/MyAsp/MyAsp.csproj(1,1)
Microsoft.Build.Exceptions.InvalidProjectFileException: The imported project "/usr/lib/mono/xbuild/15.0/Microsoft.Common.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.  /opt/dotnet/sdk/2.1.105/Sdks/Microsoft.NET.Sdk/Sdk/Sdk.props
  at Microsoft.Build.Shared.ProjectErrorUtilities.ThrowInvalidProject (System.String errorSubCategoryResourceName, Microsoft.Build.Shared.IElementLocation elementLocation, System.String resourceName, System.Object[] args) [0x00042] in <9ba305957e954df9b0ed46d97ba8f5be>:0 
  at Microsoft.Build.Shared.ProjectErrorUtilities.VerifyThrowInvalidProject[T1] (System.Boolean condition, System.String errorSubCategoryResourceName, Microsoft.Build.Shared.IElementLocation elementLocation, System.String resourceName, T1 arg0) [0x00003] in <9ba305957e954df9b0ed46d97ba8f5be>:0 
  at Microsoft.Build.Shared.ProjectErrorUtilities.ThrowInvalidProject[T1] (Microsoft.Build.Shared.IElementLocation elementLocation, System.String resourceName, T1 arg0) [0x00000] in <9ba305957e954df9b0ed46d97ba8f5be>:0 
  at Microsoft.Build.Evaluation.Evaluator`4[P,I,M,D].ExpandAndLoadImportsFromUnescapedImportExpression (System.String directoryOfImportingFile, Microsoft.Build.Construction.ProjectImportElement importElement, System.String unescapedExpression, System.Boolean throwOnFileNotExistsError, System.Collections.Generic.List`1[Microsoft.Build.Construction.ProjectRootElement]& imports) [0x00517] in <9ba305957e954df9b0ed46d97ba8f5be>:0 
  at Microsoft.Build.Evaluation.Evaluator`4[P,I,M,D].ExpandAndLoadImportsFromUnescapedImportExpressionConditioned (System.String directoryOfImportingFile, Microsoft.Build.Construction.ProjectImportElement importElement, System.Collections.Generic.List`1[Microsoft.Build.Construction.ProjectRootElement]& projects, System.Boolean throwOnFileNotExistsError) [0x001a6] in <9ba305957e954df9b0ed46d97ba8f5be>:0 
  at Microsoft.Build.Evaluation.Evaluator`4[P,I,M,D].ExpandAndLoadImports (System.String directoryOfImportingFile, Microsoft.Build.Construction.ProjectImportElement importElement) [0x00024] in <9ba305957e954df9b0ed46d97ba8f5be>:0 
  at Microsoft.Build.Evaluation.Evaluator`4[P,I,M,D].EvaluateImportElement (System.String directoryOfImportingFile, Microsoft.Build.Construction.ProjectImportElement importElement) [0x00000] in <9ba305957e954df9b0ed46d97ba8f5be>:0 
  at Microsoft.Build.Evaluation.Evaluator`4[P,I,M,D].PerformDepthFirstPass (Microsoft.Build.Construction.ProjectRootElement currentProjectOrImport) [0x001dd] in <9ba305957e954df9b0ed46d97ba8f5be>:0 
  at Microsoft.Build.Evaluation.Evaluator`4[P,I,M,D].EvaluateImportElement (System.String directoryOfImportingFile, Microsoft.Build.Construction.ProjectImportElement importElement) [0x0002d] in <9ba305957e954df9b0ed46d97ba8f5be>:0 
  at Microsoft.Build.Evaluation.Evaluator`4[P,I,M,D].PerformDepthFirstPass (Microsoft.Build.Construction.ProjectRootElement currentProjectOrImport) [0x001dd] in <9ba305957e954df9b0ed46d97ba8f5be>:0 
  at Microsoft.Build.Evaluation.Evaluator`4[P,I,M,D].EvaluateImportElement (System.String directoryOfImportingFile, Microsoft.Build.Construction.ProjectImportElement importElement) [0x0002d] in <9ba305957e954df9b0ed46d97ba8f5be>:0 
  at Microsoft.Build.Evaluation.Evaluator`4[P,I,M,D].PerformDepthFirstPass (Microsoft.Build.Construction.ProjectRootElement currentProjectOrImport) [0x000c8] in <9ba305957e954df9b0ed46d97ba8f5be>:0 
  at Microsoft.Build.Evaluation.Evaluator`4[P,I,M,D].Evaluate (Microsoft.Build.BackEnd.Logging.ILoggingService loggingService, Microsoft.Build.Framework.BuildEventContext buildEventContext) [0x000df] in <9ba305957e954df9b0ed46d97ba8f5be>:0 
  at Microsoft.Build.Evaluation.Evaluator`4[P,I,M,D].Evaluate (Microsoft.Build.Evaluation.IEvaluatorData`4[P,I,M,D] data, Microsoft.Build.Construction.ProjectRootElement root, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings, System.Int32 maxNodeCount, Microsoft.Build.Collections.PropertyDictionary`1[T] environmentProperties, Microsoft.Build.BackEnd.Logging.ILoggingService loggingService, Microsoft.Build.Evaluation.IItemFactory`2[S,T] itemFactory, Microsoft.Build.Evaluation.IToolsetProvider toolsetProvider, Microsoft.Build.Evaluation.ProjectRootElementCache projectRootElementCache, Microsoft.Build.Framework.BuildEventContext buildEventContext, Microsoft.Build.Execution.ProjectInstance projectInstanceIfAnyForDebuggerOnly, Microsoft.Build.BackEnd.SdkResolution sdkResolution) [0x00016] in <9ba305957e954df9b0ed46d97ba8f5be>:0 
  at Microsoft.Build.Evaluation.Project.Reevaluate (Microsoft.Build.BackEnd.Logging.ILoggingService loggingServiceForEvaluation, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings) [0x0004c] in <9ba305957e954df9b0ed46d97ba8f5be>:0 
  at Microsoft.Build.Evaluation.Project.ReevaluateIfNecessary (Microsoft.Build.BackEnd.Logging.ILoggingService loggingServiceForEvaluation, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings) [0x00034] in <9ba305957e954df9b0ed46d97ba8f5be>:0 
  at Microsoft.Build.Evaluation.Project.ReevaluateIfNecessary (Microsoft.Build.BackEnd.Logging.ILoggingService loggingServiceForEvaluation) [0x00000] in <9ba305957e954df9b0ed46d97ba8f5be>:0 
  at Microsoft.Build.Evaluation.Project.ReevaluateIfNecessary () [0x00007] in <9ba305957e954df9b0ed46d97ba8f5be>:0 
  at Microsoft.Build.Evaluation.Project.Initialize (System.Collections.Generic.IDictionary`2[TKey,TValue] globalProperties, System.String toolsVersion, System.String subToolsetVersion, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings) [0x000e9] in <9ba305957e954df9b0ed46d97ba8f5be>:0 
  at Microsoft.Build.Evaluation.Project..ctor (System.String projectFile, System.Collections.Generic.IDictionary`2[TKey,TValue] globalProperties, System.String toolsVersion, System.String subToolsetVersion, Microsoft.Build.Evaluation.ProjectCollection projectCollection, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings) [0x0009c] in <9ba305957e954df9b0ed46d97ba8f5be>:0 
  at Microsoft.Build.Evaluation.Project..ctor (System.String projectFile, System.Collections.Generic.IDictionary`2[TKey,TValue] globalProperties, System.String toolsVersion, Microsoft.Build.Evaluation.ProjectCollection projectCollection, Microsoft.Build.Evaluation.ProjectLoadSettings loadSettings) [0x00000] in <9ba305957e954df9b0ed46d97ba8f5be>:0 
  at Microsoft.Build.Evaluation.Project..ctor (System.String projectFile, System.Collections.Generic.IDictionary`2[TKey,TValue] globalProperties, System.String toolsVersion, Microsoft.Build.Evaluation.ProjectCollection projectCollection) [0x00000] in <9ba305957e954df9b0ed46d97ba8f5be>:0 
  at Microsoft.Build.Evaluation.ProjectCollection.LoadProject (System.String fileName, System.Collections.Generic.IDictionary`2[TKey,TValue] globalProperties, System.String toolsVersion) [0x000f5] in <9ba305957e954df9b0ed46d97ba8f5be>:0 
  at Microsoft.Build.Evaluation.ProjectCollection.LoadProject (System.String fileName, System.String toolsVersion) [0x00000] in <9ba305957e954df9b0ed46d97ba8f5be>:0 
  at OmniSharp.MSBuild.ProjectLoader.EvaluateProjectFileCore (System.String filePath) [0x0003e] in <1fc39bf7e159441685d8a44444c40939>:0 
  at OmniSharp.MSBuild.ProjectLoader.BuildProject (System.String filePath) [0x0000d] in <1fc39bf7e159441685d8a44444c40939>:0 
  at OmniSharp.MSBuild.ProjectFile.ProjectFileInfo.Load (System.String filePath, OmniSharp.MSBuild.ProjectLoader loader) [0x00014] in <1fc39bf7e159441685d8a44444c40939>:0 
  at OmniSharp.MSBuild.ProjectManager+<>c__DisplayClass22_0.<LoadProject>b__0 () [0x00000] in <1fc39bf7e159441685d8a44444c40939>:0 
  at (wrapper delegate-invoke) System.Func`1[System.ValueTuple`2[OmniSharp.MSBuild.ProjectFile.ProjectFileInfo,System.Collections.Immutable.ImmutableArray`1[OmniSharp.MSBuild.Logging.MSBuildDiagnostic]]].invoke_TResult()
  at OmniSharp.MSBuild.ProjectManager.LoadOrReloadProject (System.String projectFilePath, System.Func`1[TResult] loadFunc) [0x0001b] in <1fc39bf7e159441685d8a44444c40939>:0

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
rohitvishwakarma1819commented, Apr 26, 2019

I solved this problem by trying this solution-

  1. Open Visual Studio Community(if you don’t have, install it)

  2. Go to your unity Project folder

  3. There will be a file like – ‘YOUR_PROJECT_NAME.sln’

  4. Double click that file and choose to open in Visual Studio Community

  5. It will load your solution file

  6. Then it will show you a window saying unity is target to .net vsxxx and this is not installed in your computer. With 2 options a. Download that .net framework version b. change target .net framework version

  7. Download the missing .net framework version by clicking the option

  8. Restart Unity and vscode

2reactions
DustinCampbellcommented, May 10, 2018

@welkie: Maybe try a newer msbuild package? https://aur.archlinux.org/packages/msbuild-stable/

Read more comments on GitHub >

github_iconTop Results From Across the Web

VS Code 2017 - C# Error - "Some projects have trouble ...
To fix this set omnisharp.path in vs code settings to latest . Go go settings -> Search for omnisharp.path -> click edit in...
Read more >
Mac VSC & Unity "Some projects have trouble loading. Please ...
Question Mac VSC & Unity "Some projects have trouble loading. Please review the output for more details".
Read more >
C# extension is giving me "Some projects have trouble ...
C# extension is giving me "Some projects have trouble loading. Please review the output for more details." #35051.
Read more >
VSCode Error popup about extension failing - Ask - GameDev.tv
It has a pop up that says “Some projects have trouble loading. Please review the output for details.” So I click on the...
Read more >
Omnisharp having trouble loading C# project file : r/vscode
Please review the output for more details." The output is below. I've been searching around and have come across a few solutions. The...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found