Hi, I want to start with Unity development on my Archlinux machine, but I just can’t get VS Code’s C# extension to work. I get the following error. Any help please?
Starting OmniSharp server at 8/8/2021, 11:03:58 PM
Target: /home/rstasta/Development/Unity/TestProject
OmniSharp server started with Mono 6.12.0.
Path: /home/rstasta/.vscode/extensions/ms-dotnettools.csharp-1.23.14/.omnisharp/1.37.14/omnisharp/OmniSharp.exe
PID: 19514
[info]: OmniSharp.Stdio.Host
Starting OmniSharp on arch 0.0 (x64)
[info]: OmniSharp.Services.DotNetCliService
DotNetPath set to dotnet
[warn]: OmniSharp.MSBuild.Discovery.Providers.MonoInstanceProvider
It looks like you have Mono 6.4.0 or greater installed but MSBuild could not be found.
Try installing MSBuild into Mono (e.g. 'sudo apt-get install msbuild') to enable better MSBuild support, or upgrade to latest Mono: https://www.mono-project.com/download/stable/.
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
Located 1 MSBuild instance(s)
1: StandAlone 17.0.0 - "/home/rstasta/.vscode/extensions/ms-dotnettools.csharp-1.23.14/.omnisharp/1.37.14/omnisharp/.msbuild/Current/Bin"
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
MSBUILD_EXE_PATH environment variable set to '/home/rstasta/.vscode/extensions/ms-dotnettools.csharp-1.23.14/.omnisharp/1.37.14/omnisharp/.msbuild/Current/Bin/MSBuild.exe'
[info]: OmniSharp.MSBuild.Discovery.MSBuildLocator
Registered MSBuild instance: StandAlone 17.0.0 - "/home/rstasta/.vscode/extensions/ms-dotnettools.csharp-1.23.14/.omnisharp/1.37.14/omnisharp/.msbuild/Current/Bin"
CscToolExe = csc.exe
MSBuildToolsPath = /home/rstasta/.vscode/extensions/ms-dotnettools.csharp-1.23.14/.omnisharp/1.37.14/omnisharp/.msbuild/Current/Bin
CscToolPath = /home/rstasta/.vscode/extensions/ms-dotnettools.csharp-1.23.14/.omnisharp/1.37.14/omnisharp/.msbuild/Current/Bin/Roslyn
BypassFrameworkInstallChecks = true
MSBuildExtensionsPath = /home/rstasta/.vscode/extensions/ms-dotnettools.csharp-1.23.14/.omnisharp/1.37.14/omnisharp/.msbuild
[info]: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.CSharpFormattingWorkspaceOptionsProvider, Order: 0
[info]: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.Completion.CompletionOptionsProvider, Order: 0
[info]: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.RenameWorkspaceOptionsProvider, Order: 100
[info]: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.ImplementTypeWorkspaceOptionsProvider, Order: 110
[info]: OmniSharp.WorkspaceInitializer
Invoking Workspace Options Provider: OmniSharp.Roslyn.CSharp.Services.BlockStructureWorkspaceOptionsProvider, Order: 140
[info]: OmniSharp.Cake.CakeProjectSystem
Detecting Cake files in '/home/rstasta/Development/Unity/TestProject'.
[info]: OmniSharp.Cake.CakeProjectSystem
Could not find any Cake files
[info]: OmniSharp.MSBuild.ProjectSystem
Detecting projects in '/home/rstasta/Development/Unity/TestProject/TestProject.sln'.
[info]: OmniSharp.MSBuild.ProjectManager
Queue project update for '/home/rstasta/Development/Unity/TestProject/Assembly-CSharp.csproj'
[info]: OmniSharp.Script.ScriptProjectSystem
Detecting CSX files in '/home/rstasta/Development/Unity/TestProject'.
[info]: OmniSharp.Script.ScriptProjectSystem
Could not find any CSX files
[info]: OmniSharp.WorkspaceInitializer
Configuration finished.
[info]: OmniSharp.Stdio.Host
Omnisharp server running using Stdio at location '/home/rstasta/Development/Unity/TestProject' on host 19350.
[info]: OmniSharp.MSBuild.ProjectManager
Loading project: /home/rstasta/Development/Unity/TestProject/Assembly-CSharp.csproj
Can't find custom attr constructor image: /home/rstasta/Development/Unity/TestProject/Library/ScriptAssemblies/Unity.Rider.Editor.dll mtoken: 0x0a000007 due to: Could not find method '.ctor' due to a type load error: Could not set up parent class, due to: Could not set up parent class, due to: assembly:/home/rstasta/Development/Unity/2020.3.15f2/Editor/Data/NetStandard/ref/2.0.0/netstandard.dll type:Object member:(null) assembly:/home/rstasta/Development/Unity/2020.3.15f2/Editor/Data/NetStandard/ref/2.0.0/netstandard.dll type:Attribute member:(null) assembly:/home/rstasta/Development/Unity/TestProject/Library/ScriptAssemblies/UnityEngine.TestRunner.dll type:TestRunCallbackAttribute member:(null) assembly:/home/rstasta/Development/Unity/TestProject/Library/ScriptAssemblies/UnityEngine.TestRunner.dll type:TestRunCallbackAttribute member:(null)
[fail]: OmniSharp.MSBuild.ProjectLoader
The "ResolveAssemblyReference" task failed unexpectedly.
System.TypeLoadException: Could not find method '.ctor' due to a type load error: Could not set up parent class, due to: Could not set up parent class, due to: assembly:/home/rstasta/Development/Unity/2020.3.15f2/Editor/Data/NetStandard/ref/2.0.0/netstandard.dll type:Object member:(null) assembly:/home/rstasta/Development/Unity/2020.3.15f2/Editor/Data/NetStandard/ref/2.0.0/netstandard.dll type:Attribute member:(null) assembly:/home/rstasta/Development/Unity/TestProject/Library/ScriptAssemblies/UnityEngine.TestRunner.dll type:TestRunCallbackAttribute member:(null)
at (wrapper managed-to-native) System.MonoCustomAttrs.GetCustomAttributesDataInternal(System.Reflection.ICustomAttributeProvider)
at System.MonoCustomAttrs.GetCustomAttributesDataBase (System.Reflection.ICustomAttributeProvider obj, System.Type attributeType, System.Boolean inheritedOnly) [0x00010] in <62b430b945fa49a19a75382ef03e7bed>:0
at System.MonoCustomAttrs.GetCustomAttributesData (System.Reflection.ICustomAttributeProvider obj, System.Boolean inherit) [0x00011] in <62b430b945fa49a19a75382ef03e7bed>:0
at System.Reflection.CustomAttributeData.GetCustomAttributes (System.Reflection.Assembly target) [0x00000] in <62b430b945fa49a19a75382ef03e7bed>:0
at System.Reflection.RuntimeAssembly.GetCustomAttributesData () [0x00000] in <62b430b945fa49a19a75382ef03e7bed>:0
at Microsoft.Build.Tasks.AssemblyInformation.GetFrameworkName () [0x00025] in <38bc079edc834288a038e440bc379c28>:0
at Microsoft.Build.Tasks.AssemblyInformation.get_FrameworkNameAttribute () [0x00028] in <38bc079edc834288a038e440bc379c28>:0
at Microsoft.Build.Tasks.AssemblyDependency.AssemblyMetadata..ctor (System.String path) [0x00019] in <38bc079edc834288a038e440bc379c28>:0
at Microsoft.Build.Tasks.AssemblyInformation+<>c.<GetAssemblyMetadata>b__21_0 (System.String p) [0x00000] in <38bc079edc834288a038e440bc379c28>:0
at System.Collections.Concurrent.ConcurrentDictionary`2[TKey,TValue].GetOrAdd (TKey key, System.Func`2[T,TResult] valueFactory) [0x00034] in <62b430b945fa49a19a75382ef03e7bed>:0
at Microsoft.Build.Tasks.AssemblyInformation.GetAssemblyMetadata (System.String path, System.Collections.Concurrent.ConcurrentDictionary`2[TKey,TValue] assemblyMetadataCache, Microsoft.Build.Shared.AssemblyNameExtension[ ]& dependencies, System.String[ ]& scatterFiles, System.Runtime.Versioning.FrameworkName& frameworkName) [0x00006] in <38bc079edc834288a038e440bc379c28>:0
at (wrapper delegate-invoke) <Module>.invoke_void_string_ConcurrentDictionary`2<string, AssemblyMetadata>_AssemblyNameExtension[ ]&_string[ ]&_FrameworkName&(string,System.Collections.Concurrent.ConcurrentDictionary`2<string, Microsoft.Build.Tasks.AssemblyDependency.AssemblyMetadata>,Microsoft.Build.Shared.AssemblyNameExtension[ ]&,string[ ]&,System.Runtime.Versioning.FrameworkName&)
at Microsoft.Build.Tasks.SystemState.GetAssemblyMetadata (System.String path, System.Collections.Concurrent.ConcurrentDictionary`2[TKey,TValue] assemblyMetadataCache, Microsoft.Build.Shared.AssemblyNameExtension[ ]& dependencies, System.String[ ]& scatterFiles, System.Runtime.Versioning.FrameworkName& frameworkName) [0x00010] in <38bc079edc834288a038e440bc379c28>:0
at Microsoft.Build.Tasks.ReferenceTable.GetUnifiedAssemblyMetadata (Microsoft.Build.Tasks.Reference reference, System.Collections.Generic.IEnumerable`1[Microsoft.Build.Tasks.UnifiedAssemblyName]& unifiedDependencies, System.String[ ]& scatterFiles) [0x00023] in <38bc079edc834288a038e440bc379c28>:0
at Microsoft.Build.Tasks.ReferenceTable.FindDependenciesAndScatterFiles (Microsoft.Build.Tasks.Reference reference, System.Collections.Generic.List`1[T] newEntries) [0x0003a] in <38bc079edc834288a038e440bc379c28>:0
at Microsoft.Build.Tasks.ReferenceTable.FindAssociatedFiles () [0x000ea] in <38bc079edc834288a038e440bc379c28>:0
at Microsoft.Build.Tasks.ReferenceTable.ComputeClosure () [0x0000a] in <38bc079edc834288a038e440bc379c28>:0
at Microsoft.Build.Tasks.ReferenceTable.ComputeClosure (System.Collections.Generic.IEnumerable`1[T] remappedAssembliesValue, Microsoft.Build.Framework.ITaskItem[ ] referenceAssemblyFiles, Microsoft.Build.Framework.ITaskItem[ ] referenceAssemblyNames, System.Collections.Generic.List`1[T] exceptions) [0x00038] in <38bc079edc834288a038e440bc379c28>:0
at Microsoft.Build.Tasks.ResolveAssemblyReference.Execute (Microsoft.Build.Shared.FileExists fileExists, Microsoft.Build.Shared.DirectoryExists directoryExists, Microsoft.Build.Tasks.GetDirectories getDirectories, Microsoft.Build.Tasks.GetAssemblyName getAssemblyName, Microsoft.Build.Tasks.GetAssemblyMetadata getAssemblyMetadata, Microsoft.Build.Shared.GetRegistrySubKeyNames getRegistrySubKeyNames, Microsoft.Build.Shared.GetRegistrySubKeyDefaultValue getRegistrySubKeyDefaultValue, Microsoft.Build.Tasks.GetLastWriteTime getLastWriteTime, Microsoft.Build.Tasks.GetAssemblyRuntimeVersion getRuntimeVersion, Microsoft.Build.Shared.OpenBaseKey openBaseKey, Microsoft.Build.Tasks.GetAssemblyPathInGac getAssemblyPathInGac, Microsoft.Build.Tasks.IsWinMDFile isWinMDFile, Microsoft.Build.Tasks.ReadMachineTypeFromPEHeader readMachineTypeFromPEHeader) [0x00515] in <38bc079edc834288a038e440bc379c28>:0
at Microsoft.Build.Tasks.ResolveAssemblyReference.Execute () [0x00000] in <38bc079edc834288a038e440bc379c28>:0
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute () [0x00029] in <e78286a6f9b047bca66ad86e9b031ef5>:0
at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask (Microsoft.Build.BackEnd.ITaskExecutionHost taskExecutionHost, Microsoft.Build.BackEnd.Logging.TaskLoggingContext taskLoggingContext, Microsoft.Build.BackEnd.TaskHost taskHost, Microsoft.Build.BackEnd.ItemBucket bucket, Microsoft.Build.BackEnd.TaskExecutionMode howToExecuteTask) [0x002fc] in <e78286a6f9b047bca66ad86e9b031ef5>:0
[warn]: OmniSharp.MSBuild.ProjectManager
Failed to load project file '/home/rstasta/Development/Unity/TestProject/Assembly-CSharp.csproj'.
/home/rstasta/Development/Unity/TestProject/Assembly-CSharp.csproj
/home/rstasta/.vscode/extensions/ms-dotnettools.csharp-1.23.14/.omnisharp/1.37.14/omnisharp/.msbuild/Current/Bin/Microsoft.Common.CurrentVersion.targets(2205,5): Error: The "ResolveAssemblyReference" task failed unexpectedly.
System.TypeLoadException: Could not find method '.ctor' due to a type load error: Could not set up parent class, due to: Could not set up parent class, due to: assembly:/home/rstasta/Development/Unity/2020.3.15f2/Editor/Data/NetStandard/ref/2.0.0/netstandard.dll type:Object member:(null) assembly:/home/rstasta/Development/Unity/2020.3.15f2/Editor/Data/NetStandard/ref/2.0.0/netstandard.dll type:Attribute member:(null) assembly:/home/rstasta/Development/Unity/TestProject/Library/ScriptAssemblies/UnityEngine.TestRunner.dll type:TestRunCallbackAttribute member:(null)
at (wrapper managed-to-native) System.MonoCustomAttrs.GetCustomAttributesDataInternal(System.Reflection.ICustomAttributeProvider)
at System.MonoCustomAttrs.GetCustomAttributesDataBase (System.Reflection.ICustomAttributeProvider obj, System.Type attributeType, System.Boolean inheritedOnly) [0x00010] in <62b430b945fa49a19a75382ef03e7bed>:0
at System.MonoCustomAttrs.GetCustomAttributesData (System.Reflection.ICustomAttributeProvider obj, System.Boolean inherit) [0x00011] in <62b430b945fa49a19a75382ef03e7bed>:0
at System.Reflection.CustomAttributeData.GetCustomAttributes (System.Reflection.Assembly target) [0x00000] in <62b430b945fa49a19a75382ef03e7bed>:0
at System.Reflection.RuntimeAssembly.GetCustomAttributesData () [0x00000] in <62b430b945fa49a19a75382ef03e7bed>:0
at Microsoft.Build.Tasks.AssemblyInformation.GetFrameworkName () [0x00025] in <38bc079edc834288a038e440bc379c28>:0
at Microsoft.Build.Tasks.AssemblyInformation.get_FrameworkNameAttribute () [0x00028] in <38bc079edc834288a038e440bc379c28>:0
at Microsoft.Build.Tasks.AssemblyDependency.AssemblyMetadata..ctor (System.String path) [0x00019] in <38bc079edc834288a038e440bc379c28>:0
at Microsoft.Build.Tasks.AssemblyInformation+<>c.<GetAssemblyMetadata>b__21_0 (System.String p) [0x00000] in <38bc079edc834288a038e440bc379c28>:0
at System.Collections.Concurrent.ConcurrentDictionary`2[TKey,TValue].GetOrAdd (TKey key, System.Func`2[T,TResult] valueFactory) [0x00034] in <62b430b945fa49a19a75382ef03e7bed>:0
at Microsoft.Build.Tasks.AssemblyInformation.GetAssemblyMetadata (System.String path, System.Collections.Concurrent.ConcurrentDictionary`2[TKey,TValue] assemblyMetadataCache, Microsoft.Build.Shared.AssemblyNameExtension[ ]& dependencies, System.String[ ]& scatterFiles, System.Runtime.Versioning.FrameworkName& frameworkName) [0x00006] in <38bc079edc834288a038e440bc379c28>:0
at (wrapper delegate-invoke) <Module>.invoke_void_string_ConcurrentDictionary`2<string, AssemblyMetadata>_AssemblyNameExtension[ ]&_string[ ]&_FrameworkName&(string,System.Collections.Concurrent.ConcurrentDictionary`2<string, Microsoft.Build.Tasks.AssemblyDependency.AssemblyMetadata>,Microsoft.Build.Shared.AssemblyNameExtension[ ]&,string[ ]&,System.Runtime.Versioning.FrameworkName&)
at Microsoft.Build.Tasks.SystemState.GetAssemblyMetadata (System.String path, System.Collections.Concurrent.ConcurrentDictionary`2[TKey,TValue] assemblyMetadataCache, Microsoft.Build.Shared.AssemblyNameExtension[ ]& dependencies, System.String[ ]& scatterFiles, System.Runtime.Versioning.FrameworkName& frameworkName) [0x00010] in <38bc079edc834288a038e440bc379c28>:0
at Microsoft.Build.Tasks.ReferenceTable.GetUnifiedAssemblyMetadata (Microsoft.Build.Tasks.Reference reference, System.Collections.Generic.IEnumerable`1[Microsoft.Build.Tasks.UnifiedAssemblyName]& unifiedDependencies, System.String[ ]& scatterFiles) [0x00023] in <38bc079edc834288a038e440bc379c28>:0
at Microsoft.Build.Tasks.ReferenceTable.FindDependenciesAndScatterFiles (Microsoft.Build.Tasks.Reference reference, System.Collections.Generic.List`1[T] newEntries) [0x0003a] in <38bc079edc834288a038e440bc379c28>:0
at Microsoft.Build.Tasks.ReferenceTable.FindAssociatedFiles () [0x000ea] in <38bc079edc834288a038e440bc379c28>:0
at Microsoft.Build.Tasks.ReferenceTable.ComputeClosure () [0x0000a] in <38bc079edc834288a038e440bc379c28>:0
at Microsoft.Build.Tasks.ReferenceTable.ComputeClosure (System.Collections.Generic.IEnumerable`1[T] remappedAssembliesValue, Microsoft.Build.Framework.ITaskItem[ ] referenceAssemblyFiles, Microsoft.Build.Framework.ITaskItem[ ] referenceAssemblyNames, System.Collections.Generic.List`1[T] exceptions) [0x00038] in <38bc079edc834288a038e440bc379c28>:0
at Microsoft.Build.Tasks.ResolveAssemblyReference.Execute (Microsoft.Build.Shared.FileExists fileExists, Microsoft.Build.Shared.DirectoryExists directoryExists, Microsoft.Build.Tasks.GetDirectories getDirectories, Microsoft.Build.Tasks.GetAssemblyName getAssemblyName, Microsoft.Build.Tasks.GetAssemblyMetadata getAssemblyMetadata, Microsoft.Build.Shared.GetRegistrySubKeyNames getRegistrySubKeyNames, Microsoft.Build.Shared.GetRegistrySubKeyDefaultValue getRegistrySubKeyDefaultValue, Microsoft.Build.Tasks.GetLastWriteTime getLastWriteTime, Microsoft.Build.Tasks.GetAssemblyRuntimeVersion getRuntimeVersion, Microsoft.Build.Shared.OpenBaseKey openBaseKey, Microsoft.Build.Tasks.GetAssemblyPathInGac getAssemblyPathInGac, Microsoft.Build.Tasks.IsWinMDFile isWinMDFile, Microsoft.Build.Tasks.ReadMachineTypeFromPEHeader readMachineTypeFromPEHeader) [0x00515] in <38bc079edc834288a038e440bc379c28>:0
at Microsoft.Build.Tasks.ResolveAssemblyReference.Execute () [0x00000] in <38bc079edc834288a038e440bc379c28>:0
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute () [0x00029] in <e78286a6f9b047bca66ad86e9b031ef5>:0
at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask (Microsoft.Build.BackEnd.ITaskExecutionHost taskExecutionHost, Microsoft.Build.BackEnd.Logging.TaskLoggingContext taskLoggingContext, Microsoft.Build.BackEnd.TaskHost taskHost, Microsoft.Build.BackEnd.ItemBucket bucket, Microsoft.Build.BackEnd.TaskExecutionMode howToExecuteTask) [0x002fc] in <e78286a6f9b047bca66ad86e9b031ef5>:0
[fail]: OmniSharp.MSBuild.ProjectManager
Attempted to update project that is not loaded: /home/rstasta/Development/Unity/TestProject/Assembly-CSharp.csproj