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.

Referencing a package with X.Y.* version in .csproj results in Omnisharp not loading.

See original GitHub issue

Issue Description

Referencing a package with a “starred” version (i.e. : 12.0.*) in the .csproj file results in Omnisharp failing to load.
A colleague of mine had the same issues on another project in another environment (Windows 10) and we fixed it in the same way by replacing the * by an actual version. All of this was done in .Net projects, I could not test it in another framework.

Steps to Reproduce

  • dotnet new console test
  • Open project.csproj file
  • Add <ItemGroup> <PackageReference Include="Newtonsoft.Json" Version="12.0.*" /> </ItemGroup>
  • Reload Omnisharp

Expected Behavior

Omnisharp normally loading and being functioning.

Actual Behavior

Omnisharp is not available anywhere in the project.

Logs

OmniSharp log

    Target: /home/sylvainhazard/workspace/testomni

OmniSharp server started.
    Path: /home/sylvainhazard/.vscode/extensions/ms-vscode.csharp-1.19.0/.omnisharp/1.32.18/run
    PID: 23870

[info]: OmniSharp.Stdio.Host
        Starting OmniSharp on ubuntu 18.10 (x64)
[info]: OmniSharp.Services.DotNetCliService
        DotNetPath set to dotnet
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Located 1 MSBuild instance(s)
            1: StandAlone 15.0 - "/home/sylvainhazard/.vscode/extensions/ms-vscode.csharp-1.19.0/.omnisharp/1.32.18/omnisharp/.msbuild/Current/Bin"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        MSBUILD_EXE_PATH environment variable set to '/home/sylvainhazard/.vscode/extensions/ms-vscode.csharp-1.19.0/.omnisharp/1.32.18/omnisharp/.msbuild/Current/Bin/MSBuild.dll'
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Registered MSBuild instance: StandAlone 15.0 - "/home/sylvainhazard/.vscode/extensions/ms-vscode.csharp-1.19.0/.omnisharp/1.32.18/omnisharp/.msbuild/Current/Bin"
            MSBuildExtensionsPath = /home/sylvainhazard/.vscode/extensions/ms-vscode.csharp-1.19.0/.omnisharp/1.32.18/omnisharp/.msbuild
            BypassFrameworkInstallChecks = true
            CscToolPath = /home/sylvainhazard/.vscode/extensions/ms-vscode.csharp-1.19.0/.omnisharp/1.32.18/omnisharp/.msbuild/Current/Bin/Roslyn
            CscToolExe = csc.exe
            MSBuildToolsPath = /home/sylvainhazard/.vscode/extensions/ms-vscode.csharp-1.19.0/.omnisharp/1.32.18/omnisharp/.msbuild/Current/Bin
            TargetFrameworkRootPath = /usr/lib/mono/xbuild-frameworks
[info]: OmniSharp.Cake.CakeProjectSystem
        Detecting Cake files in '/home/sylvainhazard/workspace/testomni'.
[info]: OmniSharp.Cake.CakeProjectSystem
        Could not find any Cake files
[info]: OmniSharp.WorkspaceInitializer
        Project system 'OmniSharp.DotNet.DotNetProjectSystem' is disabled in the configuration.
[info]: OmniSharp.MSBuild.ProjectSystem
        No solution files found in '/home/sylvainhazard/workspace/testomni'
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/home/sylvainhazard/workspace/testomni/testomni.csproj'
[info]: OmniSharp.Script.ScriptProjectSystem
        Detecting CSX files in '/home/sylvainhazard/workspace/testomni'.
[info]: OmniSharp.Script.ScriptProjectSystem
        Could not find any CSX files
[info]: OmniSharp.WorkspaceInitializer
        Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpWorkspaceOptionsProvider
[info]: OmniSharp.WorkspaceInitializer
        Configuration finished.
[info]: OmniSharp.Stdio.Host
        Omnisharp server running using Stdio at location '/home/sylvainhazard/workspace/testomni' on host 21608.
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: /home/sylvainhazard/workspace/testomni/testomni.csproj
[info]: OmniSharp.MSBuild.ProjectManager
        Successfully loaded project file '/home/sylvainhazard/workspace/testomni/testomni.csproj'.
[info]: OmniSharp.MSBuild.ProjectManager
        Adding project '/home/sylvainhazard/workspace/testomni/testomni.csproj'

Environment information

VSCode version: 1.33.1 C# Extension: 1.19.0

Mono Information OmniSharp using built-in mono
Dotnet Information .NET Core SDK (reflecting any global.json): Version: 2.2.203 Commit: e5bab63eca

Runtime Environment: OS Name: ubuntu OS Version: 18.10 OS Platform: Linux RID: ubuntu.18.10-x64 Base Path: /usr/share/dotnet/sdk/2.2.203/

Host (useful for support): Version: 2.2.4 Commit: f95848e524

.NET Core SDKs installed: 2.2.203 [/usr/share/dotnet/sdk]

.NET Core runtimes installed: Microsoft.AspNetCore.All 2.2.4 [/usr/share/dotnet/shared/Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.2.4 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.2.4 [/usr/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
csharp ms-vscode 1.19.0
docomment k–kato 0.1.6
dotnet-test-explorer formulahendry 0.6.6
githistory donjayamanne 0.4.6
gitlens eamodio 9.6.2
positions Silvenga 0.1.0
prettify-json mohsen1 0.0.3
python ms-python 2019.3.6558
rest-client humao 0.21.2
vscode-docker PeterJausovec 0.6.1
vscode-icons vscode-icons-team 8.5.0
vscode-markdownlint DavidAnson 0.26.0
vscode-position jtr 1.0.1
vscode-versionlens pflannery 0.22.0

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:5
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

8reactions
filipwcommented, Apr 19, 2019

Thanks for reporting the problem. There is a new build since yesterday that should fix this. Could you try setting "omnisharp.path": "1.32.19-beta.25" in your VS Code settings and confirm? This will download the new OmniSharp from the master branch. Thanks.

1reaction
duduferreiracommented, Apr 26, 2019

@filipw thanks for your advice. Changing (for me, INCLUDING) “omnisharp.path”: “1.32.19-beta.25” on setting.json solved the problem!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Intellisense not working in VSCode - OmniSharp Error
Go into VS code Preferences · Search for omnisharp. · Add/edit line "omnisharp. · Go back into settings and search omnisharp, scroll down...
Read more >
Cannot get code completion to work in Visual Studio Code ...
Code completion does not work (see first image). This is caused I think by OmniSharp not understanding the project (?) and crashing.
Read more >
omnisharp-vscode - Discover .NET
.NET Framework builds of OmniSharp no longer ship with Mono or the MSBuild tooling (See announcement omnisharp-roslyn#2339). To ensure that the C# extension ......
Read more >
EntityFrameworkCore does not exist in the namespace Microsoft
(3) Click edit the .csproj and check if there is a Package Reference to EF. (4) Right clicking the project again in the...
Read more >
Bonus Content | Packt
In other words, it returns a LINQ query, not yet the results. We decorated the Get action method ... gRPC.csproj file, and note...
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