Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Omnisharp fails to load project #2151

Closed
snmed opened this issue Mar 31, 2018 · 11 comments

Comments

Projects
None yet
5 participants
@snmed
Copy link

commented Mar 31, 2018

Environment data

dotnet --info output:

.NET Command Line Tools (2.1.101)

Product Information:
 Version:            2.1.101
 Commit SHA-1 hash:  6c22303bf0

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

Microsoft .NET Core Shared Framework Host

  Version  : 2.0.6
  Build    : 74b1c703813c8910df5b96f304b0f2b78cdf194d

VS Code version: 1.21.1 (commit: 79b44aa704ce542d8ca4a3cc44cfca566e7720f1)
C# Extension version: 1.14.0

Steps to reproduce

  1. Create a new Project dotnet new web
  2. Start VSCode and load the new project

Expected behavior

VSCode shows intellisense and codelens

Actual behavior

Omnisharp fails to load a project:

[warn]: OmniSharp.MSBuild.ProjectManager
        Failed to load project file '/home/snmed/Repositories/testdotnet/testdotnet.csproj'.
/home/snmed/Repositories/testdotnet/testdotnet.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.101/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 

Same error ocurrs on my second system with Antergos on it, also a arch based linux.

@rchande

This comment has been minimized.

Copy link
Contributor

commented Apr 3, 2018

@snmed Are you able to dotnet build that project? It might be worth #1998 and verifying what version of mono (if any) you have installed.

@snmed

This comment has been minimized.

Copy link
Author

commented Apr 4, 2018

@rchande Thank you for your reply.dotnet build runs fine and builds flawlessly. Yes i've installed mono months ago, but probably an update has broken the omnisharp plugin lately. I will check it this evening if a downgrade of the mono package is working. I'm getting back to you as soon as I have any news on this topic.

P.S. If a downgrade works, I will close this issue in favor of #1998 due the same reason.

@snmed

This comment has been minimized.

Copy link
Author

commented Apr 4, 2018

@rchande I have downgraded my mono installation from 5.10.0.179-1 to 5.4.1.7-2 and can confirm that the omnisharp plugin works as expected with 5.4.1. So i will close this issue and stick with version 5.4.1 until a fix is available.

Thank you for your help.

@snmed snmed closed this Apr 4, 2018

@codermantx

This comment has been minimized.

Copy link

commented Apr 6, 2018

I had similar issue on Fedora 27. For v15.0, the missing Microsoft.Common.props file was resolved by installing msbuild package and the extension worked flawlessly.

@DustinCampbell

This comment has been minimized.

Copy link
Collaborator

commented Apr 6, 2018

Thanks @codermantx -- that's a strong possibility. On Linux, if you install the mono-devel package, that does not include msbuild. Instead, you have to installed msbuild separately. Alternatively, you can install the mono-complete package, which does include it.

@0xF6

This comment has been minimized.

Copy link

commented Jul 2, 2018

When will it be fixed?

@0xF6

This comment has been minimized.

Copy link

commented Jul 2, 2018

Why should I downgrade the mono version to fix this error?
Why should I put mono for .net core projects at all?

@0xF6

This comment has been minimized.

Copy link

commented Jul 2, 2018

Hmm..
Fixed by installing msbuild-stable

@rchande

This comment has been minimized.

Copy link
Contributor

commented Jul 3, 2018

@0xF6 Glad you got this working. For reference, would you mind sharing the versions of the packages (mono, msbuild-stable) you wound up installing?

@0xF6

This comment has been minimized.

Copy link

commented Jul 4, 2018

@rchande,

image

pacman:

msbuild-stable : 15.6_xamarinxplat.2018.01.17.14.14_0xamarin1_ubuntu1404b1-3
mono : 5.12.0.260-1

@rchande

This comment has been minimized.

Copy link
Contributor

commented Jul 5, 2018

@0xF6 Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.