我从Windows 10迁移到Ubuntu 19.04,并且过去有一些Unity项目可以进行。我从Microsoft网站,C#和Unity Debugger扩展,.NET SDK 2.2,最新的Mono(6.0.0.319)和Unity 2019.2.0f1安装了VS Code。当我尝试打开项目时,OmniSharp日志显示:
[warn]: OmniSharp.MSBuild.ProjectLoader Unable to create directory "/Debug/". Access to the path "/Debug/" is denied.
以及由此导致的其他一些错误,这些错误会导致无法加载.csproj文件。
首先,我已经搜索了这个问题,但是发现只有一个合适的线程说我需要重新安装msbuild
。但是APT上没有任何msbuild
软件包,所以我去了MSBuild的GitHub,它说msbuild
并不是与.NET SDK分开提供的。
然后我卸载了Mono,但是VSC说我没有“ .NET Framework 4.7.1”,因此我再次安装了Mono。
后来我重新安装了.NET SDK和VS Code,但问题似乎仍然存在。
这是我的dotnet --info
,如果它可以帮助解决:
Пакет SDK для .NET Core (отражающий любой global.json):
Version: 2.2.401
Commit: 729b316c13
Среда выполнения:
OS Name: ubuntu
OS Version: 19.04
OS Platform: Linux
RID: ubuntu.19.04-x64
Base Path: /usr/share/dotnet/sdk/2.2.401/
Host (useful for support):
Version: 2.2.6
Commit: 7dac9b1b51
.NET Core SDKs installed:
2.2.401 [/usr/share/dotnet/sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.All 2.2.6 [/usr/share/dotnet/shared/Microsoft.AspNetCore.All]
Microsoft.AspNetCore.App 2.2.6 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 2.2.6 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
OmniSharp日志本身(从警告开始):
[info]: OmniSharp.Stdio.Host
Omnisharp server running using Stdio at location '/home/alt3r3d/UnityProjects/some random test' on host 14700.
[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.csprojAssemblyReference.cache". Could not find a part of the path "/Debug/Assembly-CSharp.csprojAssemblyReference.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 '/home/alt3r3d/UnityProjects/some random test/Assembly-CSharp.csproj'.
/home/alt3r3d/UnityProjects/some random test/Assembly-CSharp.csproj
/home/alt3r3d/.vscode/extensions/ms-vscode.csharp-1.21.0/.omnisharp/1.34.0/omnisharp/.msbuild/Current/Bin/Microsoft.Common.CurrentVersion.targets(1144,5): Error: Unable to create directory "/Debug/". Access to the path "/Debug/" is denied.
/home/alt3r3d/.vscode/extensions/ms-vscode.csharp-1.21.0/.omnisharp/1.34.0/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/alt3r3d/.vscode/extensions/ms-vscode.csharp-1.21.0/.omnisharp/1.34.0/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".
[fail]: OmniSharp.MSBuild.ProjectManager
Attempted to update project that is not loaded: /home/alt3r3d/UnityProjects/some random test/Assembly-CSharp.csproj