sdk: 'dotnet build' produces no useful error messages

Steps to reproduce

create a new project with dotnet new console break project by making Program.cs unbuildable execute dotnet build

Expected behavior

Useful error message referencing source file names and line numbers.

Actual behavior

error message is basically “it didn’t work”

C:\_prj\a1>dotnet build
Microsoft (R) Build Engine version 15.3.409.57025 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

C:\Program Files\dotnet\sdk\2.0.0\Roslyn\Microsoft.CSharp.Core.targets(84,5): error MSB6006: "C:\Program Files\dotnet\sdk\2.0.0\Roslyn\RunCsc.cmd" exited with code 1. [C:\_prj\a1\a1.csproj]

Build FAILED.

C:\Program Files\dotnet\sdk\2.0.0\Roslyn\Microsoft.CSharp.Core.targets(84,5): error MSB6006: "C:\Program Files\dotnet\sdk\2.0.0\Roslyn\RunCsc.cmd" exited with code 1. [C:\_prj\a1\a1.csproj]
    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:01.46

Environment data

dotnet --info output:

.NET Command Line Tools (2.0.0)

Product Information: Version: 2.0.0 Commit SHA-1 hash: cdcd1928c9

Runtime Environment: OS Name: Windows OS Version: 10.0.15063 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\2.0.0\

Microsoft .NET Core Shared Framework Host

Version : 2.0.0 Build : e8b8861ac7faf042c87a5c2f9f2d04c98b69f28d

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 16 (10 by maintainers)

Most upvoted comments

What is the output of dotnet build /v:n?