OmniSharp.MSBuild.ProjectManager Failed to load project on Linux

后端 未结 3 383
温柔的废话
温柔的废话 2021-01-28 01:22

I am learning C# on my Manjaro Linux Notebook. I tried to install the ms-vscode.csharp extension, but when opening any .NET Core project I get the following Error Message:

相关标签:
3条回答
  • 2021-01-28 02:11

    Part of the reasons why you get this error is, .VsCode is missing in your project. The path where Omnisharp is looking for the .Net SDK version is wrong, this is because Omnisharp looks for the required SDK in the path where Visual Studio saves its resources. to resolve this, update your visual studio so that it has the latest SDK version you are working with. and this should resolve the error and the project you're running on Visual Studio code will have the .VSCode folder.

    To update Visual Studio, Open Visual Studio and select help on the top Menu, look for "check for update" and then update.

    IF you already did all this then, a simple Vs Code restart MAY be the answer.

    Happy Hacking!!

    0 讨论(0)
  • 2021-01-28 02:13

    I solved this by adding a omnisharp.json file with following content:

    {
        "MSBuild": {
            "UseLegacySdkResolver": true
        }
    }
    

    Source

    0 讨论(0)
  • 2021-01-28 02:22

    This seem to have done it for me code -> preferences -> settings -> click this

    ;/ wish i had at least 10 reputation to post a picture here but it's the first icon in the top right looks like a lil piece of paper.

    Then..

    copy pasta this into settings.json

    {
      "explorer.compactFolders": false,
      "update.mode": "none",
      "workbench.iconTheme": "vscode-icons",
      "editor.formatOnSave": true,
      "editor.defaultFormatter": "esbenp.prettier-vscode",
      "omnisharp.path": "latest",
      "omnisharp.monoPath": "auto",
      "csharp.semanticHighlighting.enabled": true,
      "editor.formatOnType": true,
      "[csharp]": {
        "editor.defaultFormatter": "ms-dotnettools.csharp"
      },
      "[xml]": {
        "editor.defaultFormatter": "DotJoshJohnson.xml"
      },
    
      "settingsSync.ignoredExtensions": [],
      "window.zoomLevel": 0
    }
    

    that ^

    "[csharp]": {
        "editor.defaultFormatter": "ms-dotnettools.csharp"
      },
      "[xml]": {
        "editor.defaultFormatter": "DotJoshJohnson.xml"
      },
    

    but i think this is what did the trick for me ^ specifically the [csharp]

    0 讨论(0)
提交回复
热议问题