Skip to content

dotnet build doesn't work with multi-level hive feature #8103

@eerhardt

Description

@eerhardt

See dotnet/core-setup#1568 where this feature came in.

Steps to reproduce

Copy an sdk under %USERPROFILE%\.dotnet\x64\sdk\2.0.0-preview1-005755
Set a global.json file to point to that sdk version.
Using a 2.0 host:

$dotnet.exe new
$dotnet.exe build

Expected behavior

Build should succeed.

Actual behavior

C:\Users\eerhardt\.dotnet\x64\sdk\2.0.0-preview1-005755\Roslyn\Microsoft.CSharp.Core.targets(71,5): error MSB6006: "C:\Users\eerhardt\.dotnet\x64\sdk\2.0.0-preview1-005755\Roslyn\RunCsc.cmd" exited with code 1. [F:\DotNetTest\TestHive\TestHive.csproj]
C:\Users\eerhardt\.dotnet\x64\sdk\2.0.0-preview1-005755\Roslyn\RunCsc.cmd /noconfig /unsafe- /checked- /nowarn:1701,1702,1705,1701,1702 /nostdlib+ /errorreport:prompt /warn:4 /define:TRACE;DEBUG;NETCOREAPP2_0 /reference:C:\Users\eerhardt\.nuget\packages\microsoft.netcore.app\2.0.0-preview1-001915-00\ref\netcoreapp2.0\Microsoft.CSharp.dll /reference:C:\Users\eerhardt\.nuget\packages\microsoft.netcore….
'"C:\Users\eerhardt\.dotnet\x64\sdk\2.0.0-preview1-005755\Roslyn\..\..\..\dotnet"' is not recognized as an internal or external command, (TaskId:24)
operable program or batch file. (TaskId:24)

this is because the SDK assumes that there will always be a host 3 levels above the Roslyn folder: https://github.com/dotnet/cli/blob/master/src/tool_roslyn/RunCsc.cmd#L6

Environment data

dotnet --info output:

.NET Command Line Tools (2.0.0-preview1-005755)

Product Information:
 Version:            2.0.0-preview1-005755
 Commit SHA-1 hash:  34f15727dc

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.14393
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Users\eerhardt\.dotnet\x64\sdk\2.0.0-preview1-005755\

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions