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.

csproj file showing The expression ""Program.cs".GetPathsOfAllDirectoriesAbove()" cannot be evaluated.

See original GitHub issue

Issue Description

In a new Dot Net Core 3 console application, the .csproj file is showing an error The expression ""Program.cs".GetPathsOfAllDirectoriesAbove()" cannot be evaluated.

Steps to Reproduce

Create new .NET 3 console application. Open in VSCode. Open .csproj file

Expected Behavior

No errors

Actual Behavior

Error at end of file: image

Logs

OmniSharp log

Starting OmniSharp server at 11/6/2019, 9:59:26 AM Target: /Users/johntsombakos/Projects/WorkflowStatus/WorkflowStatus.sln

OmniSharp server started with Mono 6.6.0. Path: /Users/johntsombakos/.vscode-insiders/extensions/ms-vscode.csharp-1.21.6/.omnisharp/1.34.6/omnisharp/OmniSharp.exe PID: 99757

    Starting OmniSharp on MacOS 10.15.1 (x64)
    DotNetPath set to dotnet
    Located 2 MSBuild instance(s)
        1: Mono 16.3 - "/Library/Frameworks/Mono.framework/Versions/6.6.0/lib/mono/msbuild/Current/bin"
        2: StandAlone 16.3 - "/Users/johntsombakos/.vscode-insiders/extensions/ms-vscode.csharp-1.21.6/.omnisharp/1.34.6/omnisharp/.msbuild/Current/Bin"
    Registered MSBuild instance: Mono 16.3 - "/Library/Frameworks/Mono.framework/Versions/6.6.0/lib/mono/msbuild/Current/bin"
        CscToolExe = csc.exe
        CscToolPath = /Users/johntsombakos/.vscode-insiders/extensions/ms-vscode.csharp-1.21.6/.omnisharp/1.34.6/omnisharp/.msbuild/Current/Bin/Roslyn
    Detecting Cake files in '/Users/johntsombakos/Projects/WorkflowStatus'.
    Could not find any Cake files
    Detecting projects in '/Users/johntsombakos/Projects/WorkflowStatus/WorkflowStatus.sln'.
    Queue project update for '/Users/johntsombakos/Projects/WorkflowStatus/WorkflowStatus/WorkflowStatus.csproj'
    Detecting CSX files in '/Users/johntsombakos/Projects/WorkflowStatus'.
    Could not find any CSX files
    Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0
    Loading project: /Users/johntsombakos/Projects/WorkflowStatus/WorkflowStatus/WorkflowStatus.csproj
    Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.RenameWorkspaceOptionsProvider, Order: 100
    Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.EditorConfigWorkspaceOptionsProvider, Order: 200
    Configuration finished.
    Omnisharp server running using Stdio at location '/Users/johntsombakos/Projects/WorkflowStatus' on host 99653.
    Successfully loaded project file '/Users/johntsombakos/Projects/WorkflowStatus/WorkflowStatus/WorkflowStatus.csproj'.
    Adding project '/Users/johntsombakos/Projects/WorkflowStatus/WorkflowStatus/WorkflowStatus.csproj'
    Update project: WorkflowStatus
    Solution initialized -> queue all documents for code analysis. Initial document count: 3.

C# log

Empty

Environment information

VSCode version: 1.40.0-insider C# Extension: 1.21.6

Mono Information OmniSharp using global mono :6.6.0
Dotnet Information .NET Core SDK (reflecting any global.json): Version: 3.1.100-preview2-014569 Commit: 4bd5d24d87

Runtime Environment: OS Name: Mac OS X OS Version: 10.15 OS Platform: Darwin RID: osx.10.15-x64 Base Path: /usr/local/share/dotnet/sdk/3.1.100-preview2-014569/

Host (useful for support): Version: 3.1.0-preview2.19525.6 Commit: 5672978d91

.NET Core SDKs installed: 2.2.100 [/usr/local/share/dotnet/sdk] 2.2.101 [/usr/local/share/dotnet/sdk] 2.2.103 [/usr/local/share/dotnet/sdk] 2.2.104 [/usr/local/share/dotnet/sdk] 2.2.105 [/usr/local/share/dotnet/sdk] 2.2.106 [/usr/local/share/dotnet/sdk] 2.2.107 [/usr/local/share/dotnet/sdk] 2.2.203 [/usr/local/share/dotnet/sdk] 2.2.300 [/usr/local/share/dotnet/sdk] 2.2.301 [/usr/local/share/dotnet/sdk] 2.2.401 [/usr/local/share/dotnet/sdk] 2.2.402 [/usr/local/share/dotnet/sdk] 3.0.100 [/usr/local/share/dotnet/sdk] 3.1.100-preview2-014569 [/usr/local/share/dotnet/sdk]

.NET Core runtimes installed: Microsoft.AspNetCore.All 2.2.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.2.1 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.2.2 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.2.3 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.2.4 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.2.5 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.2.6 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.2.7 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.12 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.2.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.2.1 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.2.2 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.2.3 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.2.4 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.2.5 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.2.6 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.2.7 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.0.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 3.1.0-preview2.19528.8 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.1.13 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 2.2.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 2.2.1 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 2.2.2 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 2.2.3 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 2.2.4 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 2.2.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 2.2.6 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 2.2.7 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 3.0.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 3.1.0-preview2.19525.6 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs: https://aka.ms/dotnet-download

Visual Studio Code Extensions
Extension Author Version
Angular2 johnpapa 8.1.1
auto-close-tag formulahendry 0.5.6
azure-account ms-vscode 0.8.7
csharp ms-vscode 1.21.6
debugger-for-chrome msjsdiag 4.12.1
githistory donjayamanne 0.4.6
material-icon-theme PKief 3.9.1
msbuild-project-tools tintoy 0.3.2
ng-template Angular 0.802.3
night-owl sdras 1.1.3
night-wolf MaoSantaella 1.8.1
noctis liviuschera 10.14.0
open-in-browser techer 2.0.0
output-colorizer IBM 0.1.2
path-intellisense christian-kohler 1.4.2
quicktype quicktype 12.0.46
rushnav DevExpress 0.0.5
vetur octref 0.22.6
vscode-azurefunctions ms-azuretools 0.20.0
vscode-docker ms-azuretools 0.8.2
vscode-eslint dbaeumer 1.9.1
vscode-svgviewer cssho 2.0.0
vscode-typescript-tslint-plugin ms-vscode 1.2.2
vscodeintellicode VisualStudioExptTeam 1.2.0
vue-vscode-snippets sdras 1.8.0
winteriscoming johnpapa 1.3.0

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:6
  • Comments:11 (3 by maintainers)

github_iconTop GitHub Comments

5reactions
jtsomcommented, Nov 6, 2019

Seems to be related to having .Net Core 3.1 preview installed. Even thought the .csproj file indicates <TargetFramework>netcoreapp3.0</TargetFrameWork>, the .Net Core 3.1 preview tooling is being referenced. Adding a global.json file to specify .Net Core 3.0:

{
  "sdk": {
    "version": "3.0.100"
  }
}

eliminated the error. Updating to a target framework of netcoreapp3.1 (without the global.json) still shows the error)

2reactions
filipwcommented, Dec 24, 2019

Yes you can disable the extension and you will see the error go away. There is already an open issue there too https://github.com/tintoy/msbuild-project-tools-vscode/issues/59

Read more comments on GitHub >

github_iconTop Results From Across the Web

GetPathsOfAllDirectoriesAbove() cannot be evaluated after ...
Looks like after upgrading your build tool is changed from MSBUILD to Roslyn. Microsoft.Managed.Core.targets is Roslyn target file.
Read more >
Method 'System.String.GetPathsOfAllDirectoriesAbove' not found
GetPathsOfAllDirectoriesAbove() ” cannot be evaluated. Method 'System.String. ... C:\Program Files (x86)\Microsoft Visual ... Show reactions 3.
Read more >
Project load fails when using Microsoft.Net.Compilers.Toolset ...
Project 'EFCore.Proxies.Tests' load failed: The expression ""ApiConsistencyTest.cs".GetPathsOfAllDirectoriesAbove()" cannot be evaluated. Method 'System.
Read more >
Getpathsofalldirectoriesabove() Cannot Be Evaluated After ...
Getpathsofalldirectoriesabove() Cannot Be Evaluated After Updating . ... console application the.csproj file is showing an error The expression Program.cs.
Read more >
MSB4184: The expression 'expression' cannot be evaluated.
This error occurs if MSBuild can't interpret an expression found in a project file.
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