Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Visual Studio Code setup for Unity development on Linux

Discussion in 'Linux' started by gucio12, Dec 11, 2021.

  1. gucio12

    gucio12

    Joined:
    Dec 11, 2021
    Posts:
    9
    Hi everyone!
    I was trying to use `vim` for writing unity C#, but it is rather uneffective method, so I decided to start using Visual Studio Code.
    So first lets note that I'm working on Linux (Fedora 34). After installing vscode, I dwonloaded a couple of extensions (especially Unity Dev Pack) and installed dotnet-sdk and here appears my problem:
    sadly, my instance of Visual Studio Code doesn't want to automatically complete my `using`s on top of c# file and auto-coplete feature doesn't work as expected too.
     
  2. RagexUN

    RagexUN

    Joined:
    Apr 20, 2019
    Posts:
    4
  3. nrader95

    nrader95

    Joined:
    Aug 19, 2019
    Posts:
    23
    Yes, c# extension is a must for any c# project, unity included.

    Also intellisense may not work in vscode on linux when your project has both VS Code integration and Rider integration, which can be a pain if anyone in the team using rider and you cannot just delete the package. Deleting Rider-related DLL from Library folder before opening unit project in VS Code helps in that case.
     
  4. gucio12

    gucio12

    Joined:
    Dec 11, 2021
    Posts:
    9
    > Also intellisense may not work in vscode on linux when your project has both VS Code integration and Rider integration, which can be a pain if anyone in the team using rider and you cannot just delete the package. Deleting Rider-related DLL from Library folder before opening unit project in VS Code helps in that case.

    I don't push Library folder to git at all. They are present in unity-specific .gitignore
     
  5. gucio12

    gucio12

    Joined:
    Dec 11, 2021
    Posts:
    9
    Ok, I was able to make it working for me.
    Here is list of steps to make vscode working with unity on Fedora34:
    - uninstall all dotnet and mono related stuff
    - install the following:
    ```
    sudo dnf install dotnet-sdk-5.0.x86_64 dotnet-sdk-3.1.x86_64
    sudo dnf install mono-complete mono-devel
    ```
    - disable all `Unity Dev Pack` extensions
    - enable C# extension
    - add this to your config:
    ` "omnisharp.useGlobalMono": "always",`
    - restart vscode
    C# features should work at this point fine.
    you can also try to enable some of other unity dev pack components, however they might cause OmniSharp crashes, I haven't identified yet.
     
    RagexUN likes this.
  6. gucio12

    gucio12

    Joined:
    Dec 11, 2021
    Posts:
    9
    oh, @nrader95 I see what you mean XD.
    rider libraries really makes my omnisharp crashes so I removed them and everyghing works now
     
  7. gucio12

    gucio12

    Joined:
    Dec 11, 2021
    Posts:
    9
    meh, does anyone have any idea to prevent unity from creating these files???