Skip to content

Unable to create directory "/Debug/". Access to the path "/Debug/" is denied. #2386

@invicticide

Description

@invicticide

I know this has been addressed in a few other issues but none of the advice described in those threads is having any effect for me.

.NET environment

> dotnet --info

.NET Core SDK (reflecting any global.json):
 Version:   2.1.300
 Commit:    adab45bf0c

Runtime Environment:
 OS Name:     Mac OS X
 OS Version:  10.13
 OS Platform: Darwin
 RID:         osx.10.13-x64
 Base Path:   /usr/local/share/dotnet/sdk/2.1.300/

Host (useful for support):
  Version: 2.1.0
  Commit:  caa7b7e2ba

.NET Core SDKs installed:
  1.0.4 [/usr/local/share/dotnet/sdk]
  2.1.4 [/usr/local/share/dotnet/sdk]
  2.1.300 [/usr/local/share/dotnet/sdk]

.NET Core runtimes installed:
  Microsoft.AspNetCore.All 2.1.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.All]
  Microsoft.AspNetCore.App 2.1.0 [/usr/local/share/dotnet/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 1.0.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 1.1.2 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.0.5 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]
  Microsoft.NETCore.App 2.1.0 [/usr/local/share/dotnet/shared/Microsoft.NETCore.App]

Mono environment

> mono --version

Mono JIT compiler version 5.12.0.226 (tarball Thu Jun 14 13:20:28 BST 2018)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
	TLS:           normal
	SIGSEGV:       altstack
	Notification:  kqueue
	Architecture:  amd64
	Disabled:      none
	Misc:          softdebug
	Interpreter:   yes
	LLVM:          supported, not enabled.
	GC:            sgen (concurrent by default)

Additional environment info

VS Code version: 1.24.1
C# Extension version: 1.15.2

Steps to reproduce

Make a new Unity 2018.1.5f1 project. In Unity Preferences > External Tools, set code editor to Visual Studio Code. Go to Assets > Open C# Project to generate the project.

Expected behavior

Project opens and Omnisharp starts successfully.

Actual behavior

OmniSharp error:

[warn]: OmniSharp.MSBuild.ProjectLoader
        Unable to create directory "/Debug/". Access to the path "/Debug/" is denied.

...and no code completion is available.

Full OmniSharp log:

Starting OmniSharp server at 2018-6-20 16:17:32
    Target: /Users/invicticide/Repositories/console/console.sln

OmniSharp server started
    Path: /Users/invicticide/.vscode/extensions/ms-vscode.csharp-1.15.2/.omnisharp/1.30.1/run
    PID: 8482

[info]: OmniSharp.Stdio.Host
        Starting OmniSharp on MacOS 10.13.5 (x64)
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Located 1 MSBuild instance(s)
            1: StandAlone 15.0 - "/Users/invicticide/.vscode/extensions/ms-vscode.csharp-1.15.2/.omnisharp/1.30.1/omnisharp/msbuild/15.0/Bin"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        MSBUILD_EXE_PATH environment variable set to '/Users/invicticide/.vscode/extensions/ms-vscode.csharp-1.15.2/.omnisharp/1.30.1/omnisharp/msbuild/15.0/Bin/MSBuild.dll'
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
        Registered MSBuild instance: StandAlone 15.0 - "/Users/invicticide/.vscode/extensions/ms-vscode.csharp-1.15.2/.omnisharp/1.30.1/omnisharp/msbuild/15.0/Bin"
            MSBuildExtensionsPath = /usr/local/Cellar/mono/5.12.0.226/lib/mono/xbuild
            BypassFrameworkInstallChecks = true
            CscToolPath = /Users/invicticide/.vscode/extensions/ms-vscode.csharp-1.15.2/.omnisharp/1.30.1/omnisharp/msbuild/15.0/Bin/Roslyn
            CscToolExe = csc.exe
            MSBuildToolsPath = /Users/invicticide/.vscode/extensions/ms-vscode.csharp-1.15.2/.omnisharp/1.30.1/omnisharp/msbuild/15.0/Bin
            TargetFrameworkRootPath = /usr/local/Cellar/mono/5.12.0.226/lib/mono/xbuild-frameworks
[info]: OmniSharp.Cake.CakeProjectSystem
        Detecting Cake files in '/Users/invicticide/Repositories/console'.
[info]: OmniSharp.Cake.CakeProjectSystem
        Could not find any Cake files
[info]: OmniSharp.DotNet.DotNetProjectSystem
        Initializing in /Users/invicticide/Repositories/console
[info]: OmniSharp.DotNet.DotNetProjectSystem
        Auto package restore: False
[info]: OmniSharp.DotNet.DotNetProjectSystem
        Update workspace context
[info]: OmniSharp.DotNet.DotNetProjectSystem
        Resolving projects references
[info]: OmniSharp.MSBuild.ProjectSystem
        Detecting projects in '/Users/invicticide/Repositories/console/console.sln'.
[info]: OmniSharp.MSBuild.ProjectManager
        Queue project update for '/Users/invicticide/Repositories/console/Assembly-CSharp.csproj'
[info]: OmniSharp.Script.ScriptProjectSystem
        Detecting CSX files in '/Users/invicticide/Repositories/console'.
[info]: OmniSharp.Script.ScriptProjectSystem
        Could not find any CSX files
[info]: OmniSharp.Stdio.Host
        Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpWorkspaceOptionsProvider
[info]: OmniSharp.Stdio.Host
        Configuration finished.
[info]: OmniSharp.Stdio.Host
        Omnisharp server running using Stdio at location '/Users/invicticide/Repositories/console' on host 8352.
[info]: OmniSharp.MSBuild.ProjectManager
        Loading project: /Users/invicticide/Repositories/console/Assembly-CSharp.csproj
[warn]: OmniSharp.MSBuild.ProjectLoader
        Unable to create directory "/Debug/". Access to the path "/Debug/" is denied.
[warn]: OmniSharp.MSBuild.ProjectLoader
        Could not write state file "/Debug/Assembly-CSharp.csprojResolveAssemblyReference.cache". Could not find a part of the path "/Debug/Assembly-CSharp.csprojResolveAssemblyReference.cache".
[fail]: OmniSharp.MSBuild.ProjectLoader
        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".
[warn]: OmniSharp.MSBuild.ProjectManager
        Failed to load project file '/Users/invicticide/Repositories/console/Assembly-CSharp.csproj'.
/Users/invicticide/Repositories/console/Assembly-CSharp.csproj
/Users/invicticide/.vscode/extensions/ms-vscode.csharp-1.15.2/.omnisharp/1.30.1/omnisharp/msbuild/15.0/Bin/Microsoft.Common.CurrentVersion.targets(1089,5): Error: Unable to create directory "/Debug/". Access to the path "/Debug/" is denied.
/Users/invicticide/.vscode/extensions/ms-vscode.csharp-1.15.2/.omnisharp/1.30.1/omnisharp/msbuild/15.0/Bin/Microsoft.Common.CurrentVersion.targets(2067,5): Error: Could not write state file "/Debug/Assembly-CSharp.csprojResolveAssemblyReference.cache". Could not find a part of the path "/Debug/Assembly-CSharp.csprojResolveAssemblyReference.cache".
/Users/invicticide/.vscode/extensions/ms-vscode.csharp-1.15.2/.omnisharp/1.30.1/omnisharp/msbuild/15.0/Bin/Microsoft.Common.CurrentVersion.targets(3387,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".

Things I've tried

  • Upgrading/reinstalling dotnet and mono
  • Installing mono via brew vs. installing mono via direct download from their website
  • Installing mono-mdk view brew cask, both alongside mono and also exclusively from mono
  • Creating omnisharp.json in the project to set ToolsVersion to 14.0 as noted here

I'm at my wit's end. Every reference I can see to this issue suggests it was fixed/closed, either by an OmniSharp fix or by some end-user change to their environment. None of the fixes work for me, and none of the things I've tried have even changed the presentation of the error in any way.

When I scour the OmniSharp log it looks like it's only finding its internal msbuild and not finding anything in my mono/dotnet system-level installs at all. But mono and dotnet are both available in the CLI. I've tried each possible setting for omnisharp.useGlobalMono and the error presents identically regardless of this setting.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions