MSBuild未处理的异常:除非设置了UseShellExecute,否则FileName属性不应是目录

Ian*_*ick 26 c# asp.net docker

版本号

  • dotnet核心SDK:2.1.403
  • 码头工人:18.09.7
  • Linux内核:5.0.0-27
  • Ubuntu的:18.04.3

问题

我正在docker中运行ASP.NET Core项目。当我docker-compose起来时,我得到以下信息:

Unhandled Exception: Microsoft.Build.BackEnd.NodeFailedToLaunchException: The FileName property should not be a directory unless UseShellExecute is set. ---> System.ComponentModel.Win32Exception: The FileName property should not be a directory unless UseShellExecute is set.
   at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start()
   at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
   at Microsoft.Build.BackEnd.NodeProviderOutOfProcBase.LaunchNode(String msbuildLocation, String commandLineArgs)
   --- End of inner exception stack trace ---
   at Microsoft.Build.CommandLine.MSBuildApp.BuildProject(String projectFile, String[] targets, String toolsVersion, Dictionary`2 globalProperties, Dictionary`2 restoreProperties, ILogger[] loggers, LoggerVerbosity verbosity, DistributedLoggerRecord[] distributedLoggerRecords, Int32 cpuCount, Boolean enableNodeReuse, TextWriter preprocessWriter, Boolean detailedSummary, ISet`1 warningsAsErrors, ISet`1 warningsAsMessages, Boolean enableRestore, ProfilerLogger profilerLogger, Boolean enableProfiler)
   at Microsoft.Build.CommandLine.MSBuildApp.Execute(String[] commandLine)
   at Microsoft.Build.CommandLine.MSBuildApp.Main(String[] args)
Run Code Online (Sandbox Code Playgroud)

当它dotnet restore到达dockerfile中的行时,似乎发生了错误。

检查权限后,似乎docker对直接涉及的所有文件/文件夹具有读/写权限

今天早上有一些更新,这篇文章的其他人也说过。他们是否是相同的更新是未知的。但是有一些更新。这是我从早上开始的所有更新日志

我的Dockerfile是这样的:

Unhandled Exception: Microsoft.Build.BackEnd.NodeFailedToLaunchException: The FileName property should not be a directory unless UseShellExecute is set. ---> System.ComponentModel.Win32Exception: The FileName property should not be a directory unless UseShellExecute is set.
   at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
   at System.Diagnostics.Process.Start()
   at System.Diagnostics.Process.Start(ProcessStartInfo startInfo)
   at Microsoft.Build.BackEnd.NodeProviderOutOfProcBase.LaunchNode(String msbuildLocation, String commandLineArgs)
   --- End of inner exception stack trace ---
   at Microsoft.Build.CommandLine.MSBuildApp.BuildProject(String projectFile, String[] targets, String toolsVersion, Dictionary`2 globalProperties, Dictionary`2 restoreProperties, ILogger[] loggers, LoggerVerbosity verbosity, DistributedLoggerRecord[] distributedLoggerRecords, Int32 cpuCount, Boolean enableNodeReuse, TextWriter preprocessWriter, Boolean detailedSummary, ISet`1 warningsAsErrors, ISet`1 warningsAsMessages, Boolean enableRestore, ProfilerLogger profilerLogger, Boolean enableProfiler)
   at Microsoft.Build.CommandLine.MSBuildApp.Execute(String[] commandLine)
   at Microsoft.Build.CommandLine.MSBuildApp.Main(String[] args)
Run Code Online (Sandbox Code Playgroud)

小智 12

我们将Docker托管在Azure上运行Ubuntu 18.04。Azure最近推出了内核版本5.0.0-1018,这在我们的Linux容器中引起了该问题。降级到内核版本4.18.0-1025为我们修复了该问题。

  • 就我而言,从内核5.0.0-27-通用降级到内核5.0.0-25-通用解决了该问题。在运行裸机的Ubuntu 19.04上。 (4认同)
  • 在Ubuntu Launchpad上有一个错误报告:https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1843018。您可以通过单击问题标题下方的“此错误也会影响我”链接来更新错误报告。 (4认同)

Jak*_*ine 6

我遇到了同样的问题,并将linux内核从5.0.0-27-generic 降级为5.0.0.-25-generic对其进行了修复。

降级linux内核的一种简单方法是使用软件包Uku,许可证费用为12美元。

免费的替代描述这里

另一种可能性是增加GRUB超时并在每个系统手动启动的引导菜单中选择所需的内核版本,这在此处进行了介绍。

  • 这工作了!具体来说,我使用Ukuu引导到旧版本后删除了不需要的新内核。请参阅[回滚更改/降级Linux内核](https://itsfoss.com/upgrade-linux-kernel-ubuntu/)。 (2认同)