受欢迎的博客标签

Build failed:error MSB6006: "csc.dll" exited with code 137

Published

 

I have a vultrl VPS with the Ubuntu 18.04 distribution and I can't build the application, error, error message:

I installed the SDK on /usr/share/dotnet, All operations (including installation and building) are executed as root.

# dotnet publish -c release
MSBuild version 17.5.1+f6fdcf537 for .NET
  Determining projects to restore...
  All projects are up-to-date for restore.
  Nop.Core -> /var/www/matterxiaomi/nopCommerce_4.60.1_Source/src/Libraries/Nop.Core/bin/release/net7.0/Nop.Core.dll
  Nop.Data -> /var/www/matterxiaomi/nopCommerce_4.60.1_Source/src/Libraries/Nop.Data/bin/release/net7.0/Nop.Data.dll
  Nop.Services -> /var/www/matterxiaomi/nopCommerce_4.60.1_Source/src/Libraries/Nop.Services/bin/release/net7.0/Nop.Services.dll
  Nop.Web.Framework -> /var/www/matterxiaomi/nopCommerce_4.60.1_Source/src/Presentation/Nop.Web.Framework/bin/release/net7.0/Nop.Web.Framework.dll

Build FAILED.

error

error MSB6006: "csc.dll" exited with code 137

 

/usr/share/dotnet/sdk/7.0.203/Roslyn/Microsoft.CSharp.Core.targets(80,5): error MSB6006: "csc.dll" exited with code 137. [/var/www/nopCommerce_4.60.1_Source/src/Presentation/Nop.Web/Nop.Web.csproj]

Microsoft.Net.Compilers

Note: This package is deprecated. Please use Microsoft.Net.Compilers.Toolset instead

      .NET Compilers package.
      Referencing this package will cause the project to be built using the C# and Visual Basic compilers contained in the package, as opposed to the version installed with MSBuild.

      The tools in this package require .NET Framework 4.7.2+ 

reason

Out of memory

Exit code 137 typically means that your process is getting killed because it is running out of memory.

 

sourece:https://github.com/dotnet/roslyn/issues/39276

 

解决方案:

nuget卸载  Microsoft.Net.Compilers.2.1.0  ,使用系统自带的CSC.exe 编译

 

Nuget  Microsoft.Net.Compilers.Toolset