PowerShell/Polaris

Failed to do 'dotnet build'

Closed this issue · 2 comments

Windows 10 1607 - PowerShell Core 6 Beta 8. Failed to before build with 1 warning and 3 errors. This is after installing DotNet SDK 2.0. This was after a successful 'dotnet restore'

PS C:\Program Files\PowerShell\6.0.0-beta.8\Modules\Polaris\PolarisCore> dotnet build
C:\Program Files\PowerShell\6.0.0-beta.8\Modules\Polaris\PolarisCore\Polaris.csproj : warning NU1603: Polaris depends on System.Management.Automation (>= 6.0.0-alpha17) but System.Management.Automation 6.0.0-alpha17 was not found. An approximate best match of System.Management.Automation 6.1.7601.17514 was resolved.
Microsoft (R) Build Engine version 15.4.8.50001 for .NET Core
Copyright (C) Microsoft Corporation. All rights reserved.

C:\Program Files\PowerShell\6.0.0-beta.8\Modules\Polaris\PolarisCore\Polaris.csproj : warning NU1603: Polaris depends on System.Management.Automation (>= 6.0.0-alpha17) but System.Management.Automation 6.0.0-alpha17 was not found. An approximate best match of System.Management.Automation 6.1.7601.17514 was resolved.
Polaris.cs(4,14): error CS0234: The type or namespace name 'Management' does not exist in the namespace 'System' (are you missing an assembly reference?) [C:\Program Files\PowerShell\6.0.0-beta.8\Modules\Polaris\PolarisCore\Polaris.csproj]
Polaris.cs(6,14): error CS0234: The type or namespace name 'Management' does not exist in the namespace 'System' (are you missing an assembly reference?) [C:\Program Files\PowerShell\6.0.0-beta.8\Modules\Polaris\PolarisCore\Polaris.csproj]
Polaris.cs(24,9): error CS0246: The type or namespace name 'RunspacePool' could not be found (are you missing a using directive or an assembly reference?) [C:\Program Files\PowerShell\6.0.0-beta.8\Modules\Polaris\PolarisCore\Polaris.csproj]

Build FAILED.

C:\Program Files\PowerShell\6.0.0-beta.8\Modules\Polaris\PolarisCore\Polaris.csproj : warning NU1603: Polaris depends on System.Management.Automation (>= 6.0.0-alpha17) but System.Management.Automation 6.0.0-alpha17 was not found. An approximate best match of System.Management.Automation 6.1.7601.17514 was resolved.
Polaris.cs(4,14): error CS0234: The type or namespace name 'Management' does not exist in the namespace 'System' (are you missing an assembly reference?) [C:\Program Files\PowerShell\6.0.0-beta.8\Modules\Polaris\PolarisCore\Polaris.csproj]
Polaris.cs(6,14): error CS0234: The type or namespace name 'Management' does not exist in the namespace 'System' (are you missing an assembly reference?) [C:\Program Files\PowerShell\6.0.0-beta.8\Modules\Polaris\PolarisCore\Polaris.csproj]
Polaris.cs(24,9): error CS0246: The type or namespace name 'RunspacePool' could not be found (are you missing a using directive or an assembly reference?) [C:\Program Files\PowerShell\6.0.0-beta.8\Modules\Polaris\PolarisCore\Polaris.csproj]
1 Warning(s)
3 Error(s)

Here's the problem:

C:\Program Files\PowerShell\6.0.0-beta.8\Modules\Polaris\PolarisCore\Polaris.csproj : warning NU1603: Polaris depends on System.Management.Automation (>= 6.0.0-alpha17) but System.Management.Automation 6.0.0-alpha17 was not found. An approximate best match of System.Management.Automation 6.1.7601.17514 was resolved.

To fix this, I added a NuGet.config yesterday that specifies where this nuget package can be found.

Can you confirm you have a NuGet.config in the root of your repo?

I did not. Got a fresh clone, restore and build (and import) worked fine! Thanks!