Skip to content

omnisharp-roslyn cannot find Microsoft.Common.props #126477

Description

@felschr

Describe the bug
When running omnisharp I get an error that project loading failed due to a missing file:

{"Event":"log","Body":{"LogLevel":"INFORMATION","Name":"OmniSharp.MSBuild.ProjectManager","Message":"Loading project: /home/felschr/dev/work/project/Api/Api.csproj"},"Seq":147,"Type":"event"}
{"Event":"log","Body":{"LogLevel":"WARNING","Name":"OmniSharp.MSBuild.ProjectManager","Message":"Failed to load project file '/home/felschr/dev/work/project/Api/Api.csproj'."},"Seq":148,"Type":"event"}
{"Event":"Error","Body":{"Text":"Microsoft.Build.Exceptions.InvalidProjectFileException: The imported project \"/nix/store/pw1ic8h00a9k2c5j1786ivq7zqrc59cb-omnisharp-roslyn-1.37.8/src/.msbuild/Current/Microsoft.Common.props\" was not found. Confirm that the expression in the Import declaration \"/nix/store/pw1ic8h00a9k2c5j1786ivq7zqrc59cb-omnisharp-roslyn-1.37.8/src/.msbuild/Current/Microsoft.Common.props\" is correct, and that the file exists on disk.  /nix/store/ycw6rph7kyff988mqk56qyf5q7qwidqc-dotnet-core-combined/sdk/5.0.202/Sdks/Microsoft.NET.Sdk/Sdk/Sdk.props\n  at Microsoft.Build.Shared.ProjectErrorUtilities.ThrowInvalidProject (System.String errorSubCategoryResourceName, Microsoft.Build.Shared.IElementLocation elementLocation, System.String resourceName, System.Object[] args) [0x00040] in <9be4d26643704d2e91efa63e9f29e6b0>:0 \n  at Microsoft.Build.Shared.ProjectErrorUtilities.VerifyThrowInvalidProject[T1,T2] (System.Boolean condition, System.String errorSubCategoryResourceName, Microsoft.Build.Shared.IElementLocation elementLocation, System.String resourceName, T1 arg0, T2 arg1) [0x00003] in <9be4d26643704d2e91efa63e9f29e6b0>:0

The path /nix/store/pw1ic8h00a9k2c5j1786ivq7zqrc59cb-omnisharp-roslyn-1.37.8/src/.msbuild/Current/Microsoft.Common.props does not seem to exist on my system.
There is only one folder in /nix/store/pw1ic8h00a9k2c5j1786ivq7zqrc59cb-omnisharp-roslyn-1.37.8/src/.msbuild/Current, which is called Bin.

Expected behavior
omnisharp should not throw an error and work as expected.

Additional context
omnisharp.json:

{
  "MsBuild": {
    "UseLegacySdkResolver": true,
    "EnablePackageAutoRestore": true
  },
  "FormattingOptions": {
    "EnableEditorConfigSupport": true
  },
  "RoslynExtensionsOptions": {
    "EnableAnalyzersSupport": true
  }
}

Additionally, I've set the environment variables DOTNET_ROOT, MSBuildSdksPath & MSBUILD_EXE_PATH to the respective paths of my dotnet installation.

Notify maintainers
@tesq0 @ericdallo @corngood

Metadata

 - system: `"x86_64-linux"`
 - host os: `Linux 5.12.7, NixOS, 21.11.20210606.fbfb794 (Porcupine)`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.4pre20210601_5985b8b`
 - channels(root): `"nixos-21.11pre291991.ea7d4aa9b82"`
 - channels(felschr): `"nixpkgs-unstable-21.11pre291991.ea7d4aa9b82"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`

Maintainer information:

# a list of nixpkgs attributes affected by the problem
attribute: omnisharp-roslyn
# a list of nixos modules affected by the problem
module:

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions