Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error MSB6006: "csc.dll" exited with code 139 on almost empty project #73401

Closed
waynesayonara opened this issue May 9, 2024 · 1 comment
Closed
Labels
Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead

Comments

@waynesayonara
Copy link

Version Used:
7.0.302
Steps to Reproduce:

  1. Set up the env: use ubuntu 23.04 and install dotnet 7.0.302 SDK (respective Dockerfile for running the repro in this env is provided)
  2. Build the project: dotnet build .
  3. Received the error: /usr/share/dotnet/sdk/7.0.302/Roslyn/Microsoft.CSharp.Core.targets(80,5): error MSB6006: "csc.dll" exited with code 139. [/TestMini/TestMini.csproj]

I suspect that the problem is not reproducible on every environment, so I provided a minimal repro with a Dockerfile, which is based on ubuntu:23.04, it then installs dotnet deps (as listed in the offficial docs), installs dotnet 7.0.302 SDK via dotnet-install.sh script. In this env I was able to reproduce the error by running dotnet build . from container.
Repo: https://github.com/waynesayonara/csc-err-139-repro

Expected Behavior:
Project builds successfully
Actual Behavior:

wayne@wayne-B11:~/t/TestMini$ docker ps
CONTAINER ID   IMAGE          COMMAND               CREATED         STATUS         PORTS     NAMES
c0ca95498796   009f34774294   "tail -f /dev/null"   6 seconds ago   Up 5 seconds             peaceful_goldwasser
wayne@wayne-B11:~/t/TestMini$ docker exec -it c0ca95498796 bash
root@c0ca95498796:/# dotnet build .

Welcome to .NET 7.0!
---------------------
SDK Version: 7.0.302

Telemetry
---------
The .NET tools collect usage data in order to help us improve your experience. It is collected by Microsoft and shared with the community. You can opt-out of telemetry by setting the DOTNET_CLI_TELEMETRY_OPTOUT environment variable to '1' or 'true' using your favorite shell.

Read more about .NET CLI Tools telemetry: https://aka.ms/dotnet-cli-telemetry

----------------
Installed an ASP.NET Core HTTPS development certificate.
To trust the certificate run 'dotnet dev-certs https --trust' (Windows and macOS only).
Learn about HTTPS: https://aka.ms/dotnet-https
----------------
Write your first app: https://aka.ms/dotnet-hello-world
Find out what's new: https://aka.ms/dotnet-whats-new
Explore documentation: https://aka.ms/dotnet-docs
Report issues and find source on GitHub: https://github.com/dotnet/core
Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli
--------------------------------------------------------------------------------------
MSBuild version 17.6.1+8ffc3fe3d for .NET
  Determining projects to restore...
  Restored /TestMini/TestMini.csproj (in 56 ms).
/usr/share/dotnet/sdk/7.0.302/Roslyn/Microsoft.CSharp.Core.targets(80,5): error MSB6006: "csc.dll" exited with code 139. [/TestMini/TestMini.csproj]

Build FAILED.

/usr/share/dotnet/sdk/7.0.302/Roslyn/Microsoft.CSharp.Core.targets(80,5): error MSB6006: "csc.dll" exited with code 139. [/TestMini/TestMini.csproj]
    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:02.71
root@c0ca95498796:/# exit
exit
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead labels May 9, 2024
@waynesayonara
Copy link
Author

Already fixed by dotnet/runtime#95859

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Compilers untriaged Issues and PRs which have not yet been triaged by a lead
Projects
None yet
Development

No branches or pull requests

1 participant