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.

Did not find 'Microsoft.NETCore.App' in lock file.

See original GitHub issue

Issue Description

After installing the latest version of Omnisharp (1.34.4) I’m still experiencing issues running VSCode similar to those described in https://github.com/OmniSharp/omnisharp-vscode/issues/3290.

I don’t have much experience diagnosing Omnisharp issues but my guess is that it’s something to do with the missing reference to Microsoft.NETCore.App. I can see from the log that I have 2 MSBuild instances installed and it appears to be using the Mono 6.4 one rather than the Standalone.

Steps to Reproduce

  • dotnet new console
  • dotnet build/run - works as expected
  • Open VSCode

Expected Behavior

C# extension features to work as expected.

Actual Behavior

Lots of “errors”, due to missing references:

image

Logs

OmniSharp log

Starting OmniSharp server at 03/10/2019, 21:56:18
    Target: /Users/ben.foster/source/checkout-bootstrap-dotnet/SqsConsumer

OmniSharp server started with Mono 6.4.0.
    Path: /Users/ben.foster/.vscode/extensions/ms-vscode.csharp-1.21.4/.omnisharp/1.34.4/omnisharp/OmniSharp.exe
    PID: 51738

[info]: OmniSharp.Stdio.Host
        Starting OmniSharp on MacOS 10.13.4 (x64)
[info]: OmniSharp.Services.DotNetCliService
        DotNetPath set to dotnet
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Located 2 MSBuild instance(s)
            1: Mono 16.0 - "/usr/local/Cellar/mono/6.4.0.198/lib/mono/msbuild/Current/bin"
            2: StandAlone 16.0 - "/Users/ben.foster/.vscode/extensions/ms-vscode.csharp-1.21.4/.omnisharp/1.34.4/omnisharp/.msbuild/Current/Bin"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Registered MSBuild instance: Mono 16.0 - "/usr/local/Cellar/mono/6.4.0.198/lib/mono/msbuild/Current/bin"
            CscToolExe = csc.exe
            CscToolPath = /Users/ben.foster/.vscode/extensions/ms-vscode.csharp-1.21.4/.omnisharp/1.34.4/omnisharp/.msbuild/Current/Bin/Roslyn
[info]: OmniSharp.Cake.CakeProjectSystem
        Detecting Cake files in '/Users/ben.foster/source/checkout-bootstrap-dotnet/SqsConsumer'.
[info]: OmniSharp.Cake.CakeProjectSystem
        Could not find any Cake files
[info]: OmniSharp.MSBuild.ProjectSystem
        No solution files found in '/Users/ben.foster/source/checkout-bootstrap-dotnet/SqsConsumer'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/Users/ben.foster/source/checkout-bootstrap-dotnet/SqsConsumer/SqsConsumer.csproj'
[info]: OmniSharp.Script.ScriptProjectSystem
        Detecting CSX files in '/Users/ben.foster/source/checkout-bootstrap-dotnet/SqsConsumer'.
[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: /Users/ben.foster/source/checkout-bootstrap-dotnet/SqsConsumer/SqsConsumer.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 '/Users/ben.foster/source/checkout-bootstrap-dotnet/SqsConsumer' on host 51191.
[info]: OmniSharp.MSBuild.ProjectManager
        Successfully loaded project file '/Users/ben.foster/source/checkout-bootstrap-dotnet/SqsConsumer/SqsConsumer.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
        Adding project '/Users/ben.foster/source/checkout-bootstrap-dotnet/SqsConsumer/SqsConsumer.csproj'
[info]: OmniSharp.MSBuild.ProjectManager
        Update project: SqsConsumer
[warn]: OmniSharp.MSBuild.PackageDependencyChecker
        SqsConsumer: Did not find 'Microsoft.NETCore.App' in lock file.

C# log

Post the output from Output-->C# here

Environment information

VSCode version: 1.38.1 C# Extension: 1.21.4

Mono Information OmniSharp using global mono :6.4.0
Dotnet Information .NET Core SDK (reflecting any global.json): Version: 3.0.100 Commit: 04339c3a26

Runtime Environment: OS Name: Mac OS X OS Version: 10.13 OS Platform: Darwin RID: osx.10.13-x64 Base Path: /usr/local/share/dotnet/sdk/3.0.100/

Host (useful for support): Version: 3.0.0 Commit: 7d57652f33

.NET Core SDKs installed: 2.1.302 [/usr/local/share/dotnet/sdk] 2.1.500 [/usr/local/share/dotnet/sdk] 2.2.104 [/usr/local/share/dotnet/sdk] 3.0.100 [/usr/local/share/dotnet/sdk]

.NET Core runtimes installed: Microsoft.AspNetCore.All 2.1.2 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.1.6 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All] Microsoft.AspNetCore.All 2.2.2 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.1.2 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.AspNetCore.App 2.1.6 [/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 3.0.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.1.2 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App] Microsoft.NETCore.App 2.1.6 [/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 3.0.0 [/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
bower donjayamanne 0.0.3
cake-vscode cake-build 0.12.0
csharp ms-vscode 1.21.4
csharpextensions jchannon 1.3.0
css-compressor bestvow 0.0.2
docomment k–kato 0.1.8
dotnet-test-explorer formulahendry 0.7.1
EditorConfig EditorConfig 0.13.0
gitlens eamodio 10.0.1
Lua keyring 0.0.9
markdown-pdf yzane 1.3.1
mssql ms-mssql 1.6.0
openapi-lint mermade 1.0.4
plantuml jebbs 2.12.1
vscode-css-formatter aeschli 1.0.1
vscode-docker ms-azuretools 0.8.1
vscode-mocha-test-adapter hbenl 2.1.2
vscode-mysql formulahendry 0.4.0
vscode-nuget-package-manager jmrog 1.1.6
vscode-proto3 zxh404 0.3.0
vscode-pull-request-github GitHub 0.11.2
vscode-test-explorer hbenl 2.14.6
vscode-yaml redhat 0.5.3
vsliveshare ms-vsliveshare 1.0.905

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:5
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

16reactions
filipwcommented, Oct 3, 2019

Mono here https://www.mono-project.com/download/stable/ comes with everything correctly configured, you may want to prefer it over the homebrew distro.

6reactions
filipwcommented, Oct 3, 2019

looks like you have a global mono without msbuild with an older msbuild (not 16.3) Either install global Mono with msbuild 16.3 or try setting "omnisharp.useGlobalMono": "never"

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why am I getting 'Unable to find package Microsoft ...
I am running Visual Studio 2019 and trying to develop a .NET Core 3,1 ASP MVC application. I was working just fine yesterday...
Read more >
Omnisharp not properly handling default dot net core 3 app in ...
I've installed the dot net core 3 SDK. ... PackageDependencyChecker 30temp: Did not find 'Microsoft.NETCore.App' in lock file. Any ideas?
Read more >
A brand new website interface for an even better experience!
Did not find 'Microsoft.NETCore.App' in lock file.
Read more >
How to fix .NET Core's 'Unable to obtain lock file access' error ...
After a lot of web searching and a discussion with a Red Hat .NET Core engineer, I discovered the underlying problem. It turns...
Read more >
The file is locked by: .NET Core Host - Visual Studio Feedback
It is not a solution, but just a workaround to deal with it easier. You can go to the task manager and end...
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