linux上的Omnisharp明显启动但无法加载项目并在visual studio代码上输出错误

问题描述

根据输出信息omnisharp启动但无法在ubuntu上加载项目。这是错误信息

[fail]: OmniSharp.MSBuild.ProjectLoader
        The "CreateAppHost" task Failed unexpectedly.
System.UnauthorizedAccessException: Access to the path is denied. ---> System.IO.IOException: Operacija ni dovoljena (Operation not allowed i think for some reason this part shows in my chosen OS langauge)
   --- End of inner exception stack trace ---
  at Interop.ThrowExceptionForIoErrno (Interop+ErrorInfo errorInfo,System.String path,System.Boolean isDirectory,System.Func`2[T,TResult] errorRewriter) [0x00014] in <9f0df102fe6e4cfea29d2e46f585d8a5>:0 
  at Interop.CheckIo (system.int64 result,TResult] errorRewriter) [0x0000a] in <9f0df102fe6e4cfea29d2e46f585d8a5>:0 
  at Interop.CheckIo (system.int32 result,TResult] errorRewriter) [0x00000] in <9f0df102fe6e4cfea29d2e46f585d8a5>:0 
  at System.IO.FileSystem.copyFile (System.String sourceFullPath,System.String destFullPath,System.Boolean overwrite) [0x0005c] in <9f0df102fe6e4cfea29d2e46f585d8a5>:0 
  at System.IO.File.copy (System.String sourceFileName,System.String destFileName,System.Boolean overwrite) [0x00062] in <9f0df102fe6e4cfea29d2e46f585d8a5>:0 
  at Microsoft.NET.HostModel.AppHost.BinaryUtils.copyFile (System.String sourcePath,System.String destinationPath) [0x00020] in <ed3b6b71decf41cb8876c183ba6fdd7e>:0 
  at Microsoft.NET.HostModel.AppHost.HostWriter.CreateAppHost (System.String appHostSourceFilePath,System.String appHostDestinationFilePath,System.String appBinaryFilePath,System.Boolean windowsGraphicalUserInterface,System.String assemblyTocopyResorcesFrom) [0x00043] in <ed3b6b71decf41cb8876c183ba6fdd7e>:0 
  at Microsoft.NET.Build.Tasks.CreateAppHost.ExecuteCore () [0x0009f] in <66b08175c8bd43eda1fda46fdebf1641>:0 
  at Microsoft.NET.Build.Tasks.TaskBase.Execute () [0x0002e] in <66b08175c8bd43eda1fda46fdebf1641>:0 
  at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute () [0x00029] in <f7274894ce154696afba1f0ffcd06434>: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 <f7274894ce154696afba1f0ffcd06434>:0 
[warn]: OmniSharp.MSBuild.ProjectManager
        Failed to load project file 

就在此之前,它还会输出此警告消息:

[warn]: OmniSharp.MSBuild.ProjectManager
        Failed to load project file 'path to projectfile'.
path to projectfile
/usr/share/dotnet/sdk/5.0.102/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(460,5): Error: The "CreateAppHost" task Failed unexpectedly.
System.UnauthorizedAccessException: Access to the path is denied. ---> System.IO.IOException: Operacija ni dovoljena
   --- End of inner exception stack trace ---
  at Interop.ThrowExceptionForIoErrno (Interop+ErrorInfo errorInfo,Microsoft.Build.BackEnd.TaskExecutionMode howToExecuteTask) [0x002fc] in <f7274894ce154696afba1f0ffcd06434>:0 

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)