dotnet / vscode-csharp

Official C# support for Visual Studio Code
MIT License
2.86k stars 670 forks source link

VSCode Fedora can not create /Debug/ direcory due to permissions #3076

Open JuliusHerrmann opened 5 years ago

JuliusHerrmann commented 5 years ago

I want to have code completion for Unity3d but due to this error my code completion is not working: Unable to create directory "/Debug/". Access to the path "/Debug/" is denied.

Full Log:

Starting OmniSharp server at 5/19/2019, 12:24:08 AM Target: /home/julius/Unity/1234562654/1234562654.sln

OmniSharp server started with Mono 5.18.1. Path: /home/julius/.vscode/extensions/ms-vscode.csharp-1.19.1/.omnisharp/1.32.19/omnisharp/OmniSharp.exe PID: 4974

    Starting OmniSharp on fedora 30.0 (x64)
    DotNetPath set to dotnet
    Located 1 MSBuild instance(s)
        1: StandAlone 15.0 - "/home/julius/.vscode/extensions/ms-vscode.csharp-1.19.1/.omnisharp/1.32.19/omnisharp/.msbuild/Current/Bin"
    MSBUILD_EXE_PATH environment variable set to '/home/julius/.vscode/extensions/ms-vscode.csharp-1.19.1/.omnisharp/1.32.19/omnisharp/.msbuild/Current/Bin/MSBuild.dll'
    Registered MSBuild instance: StandAlone 15.0 - "/home/julius/.vscode/extensions/ms-vscode.csharp-1.19.1/.omnisharp/1.32.19/omnisharp/.msbuild/Current/Bin"
        MSBuildExtensionsPath = /usr/lib/mono/xbuild
        BypassFrameworkInstallChecks = true
        CscToolPath = /home/julius/.vscode/extensions/ms-vscode.csharp-1.19.1/.omnisharp/1.32.19/omnisharp/.msbuild/Current/Bin/Roslyn
        CscToolExe = csc.exe
        MSBuildToolsPath = /home/julius/.vscode/extensions/ms-vscode.csharp-1.19.1/.omnisharp/1.32.19/omnisharp/.msbuild/Current/Bin
        TargetFrameworkRootPath = /usr/lib/mono/xbuild-frameworks
    Detecting Cake files in '/home/julius/Unity/1234562654'.
    Could not find any Cake files
    Project system 'OmniSharp.DotNet.DotNetProjectSystem' is disabled in the configuration.
    Detecting projects in '/home/julius/Unity/1234562654/1234562654.sln'.
    Queue project update for '/home/julius/Unity/1234562654/Assembly-CSharp.csproj'
    Detecting CSX files in '/home/julius/Unity/1234562654'.
    Could not find any CSX files
    Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpWorkspaceOptionsProvider
    Loading project: /home/julius/Unity/1234562654/Assembly-CSharp.csproj
    Configuration finished.
    Omnisharp server running using Stdio at location '/home/julius/Unity/1234562654' on host 4874.
    Unable to create directory "/Debug/". Access to the path "/Debug/" is denied.
    Could not write state file "/Debug/Assembly-CSharp.csprojAssemblyReference.cache". Could not find a part of the path "/Debug/Assembly-CSharp.csprojAssemblyReference.cache".
    Could not write lines to file "/Debug/Assembly-CSharp.csproj.CoreCompileInputs.cache". Could not find a part of the path "/Debug/Assembly-CSharp.csproj.CoreCompileInputs.cache".
    Failed to load project file '/home/julius/Unity/1234562654/Assembly-CSharp.csproj'.

/home/julius/Unity/1234562654/Assembly-CSharp.csproj /home/julius/.vscode/extensions/ms-vscode.csharp-1.19.1/.omnisharp/1.32.19/omnisharp/.msbuild/Current/Bin/Microsoft.Common.CurrentVersion.targets(1144,5): Error: Unable to create directory "/Debug/". Access to the path "/Debug/" is denied. /home/julius/.vscode/extensions/ms-vscode.csharp-1.19.1/.omnisharp/1.32.19/omnisharp/.msbuild/Current/Bin/Microsoft.Common.CurrentVersion.targets(2130,5): Error: Could not write state file "/Debug/Assembly-CSharp.csprojAssemblyReference.cache". Could not find a part of the path "/Debug/Assembly-CSharp.csprojAssemblyReference.cache". /home/julius/.vscode/extensions/ms-vscode.csharp-1.19.1/.omnisharp/1.32.19/omnisharp/.msbuild/Current/Bin/Microsoft.Common.CurrentVersion.targets(3450,5): Error: Could not write lines to file "/Debug/Assembly-CSharp.csproj.CoreCompileInputs.cache". Could not find a part of the path "/Debug/Assembly-CSharp.csproj.CoreCompileInputs.cache".

    Attempted to update project that is not loaded: /home/julius/Unity/1234562654/Assembly-CSharp.csproj

Environment data

.NET Core SDK (reflecting any global.json): Version: 2.2.204 Commit: 8757db13ec

Runtime Environment: OS Name: fedora OS Version: 30 OS Platform: Linux RID: linux-x64 Base Path: /usr/share/dotnet/sdk/2.2.204/

Host (useful for support): Version: 2.2.5 Commit: 0a3c9209c0

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

.NET Core runtimes installed: Microsoft.AspNetCore.All 2.2.5 [/usr/share/dotnet/shared/Microsoft.AspNetCore.All] Microsoft.AspNetCore.App 2.2.5 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App] Microsoft.NETCore.App 2.2.5 [/usr/share/dotnet/shared/Microsoft.NETCore.App]

To install additional .NET Core runtimes or SDKs: https://aka.ms/dotnet-download

VS Code version: 1.34.0 C# Extension version: 1.19.1

Steps to reproduce

Open a c# project created by Unity3d

Expected behavior

Omnisharp server should load and code completions should work

Actual behavior

Omnisharp server does not load and errors out because of missing permissions regarding the /Debug/ folder

What i have done

reinstall everything

Eyap53 commented 5 years ago

I got the same problem on Ubuntu 19.04 (disco dingo).

Omnisharp-vscode version : 1.19.1 dotnet version (installed via snap) : 2.2.300 mono version : Mono JIT compiler version 5.18.0.240 (Debian 5.18.0.240+dfsg-2ubuntu2 Wed Apr 17 23:39:09 UTC 2019)

Eyap53 commented 5 years ago

Upgrading Mono from 5.18 to 5.20 solved this issue for me.

akshita31 commented 5 years ago

@JuliusHerrmann Could you try updating mono as mentioned above and checking if the issue still persists. You could also try setting "omnisharp.useGlobalMono": never and then restarting vscode.

TheAifam5 commented 5 years ago

Same problem with Mono JIT compiler version 6.0.0 (makepkg/f8ea05bddcb Wed 11 Sep 2019 12:21:58 AM CEST)

I use Arch btw.