Home: dotnet restore: The specified solution configuration "Debug|WINDOWS" is invalid

Created on 23 Mar 2017  路  8Comments  路  Source: NuGet/Home

_From @epignosisx on March 23, 2017 21:33_

Steps to reproduce

1- Create new Console App (.NET Core) through VS2017
2- Run dotnet restore in the solution directory.

Expected behavior

Restore to complete successfully.

Actual behavior

Getting the following error:

C:\Users\alejandroh\Documents\Visual Studio 2017\Projects\ConsoleApp2\ConsoleApp2.sln.metaproj : error MSB4126: The specified solution configuration "Debug|WINDOWS" is invalid. Please specify a valid solution configuration using the Configuration and Platform properties (e.g. MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU") or leave those properties blank to use the default solution configuration. [C:\Users\alejandroh\Documents\Visual Studio 2017\Projects\ConsoleApp2\ConsoleApp2.sln]

Environment data

dotnet --info output:

.NET Command Line Tools (1.0.1)

Product Information:
Version: 1.0.1
Commit SHA-1 hash: 005db40cd1

Runtime Environment:
OS Name: Windows
OS Version: 6.1.7601
OS Platform: Windows
RID: win7-x64
Base Path: C:\Program Files\dotnet\sdk\1.0.1

Visual Studio Enterprise 2017

VisualStudio/15.0.0+26228.9

ConsoleApp2.sln:

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26228.9
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConsoleApp2", "ConsoleApp2\ConsoleApp2.csproj", "{9718499E-F274-4407-97F5-DCA08166EE68}"
EndProject
Global
    GlobalSection(SolutionConfigurationPlatforms) = preSolution
        Debug|Any CPU = Debug|Any CPU
        Release|Any CPU = Release|Any CPU
    EndGlobalSection
    GlobalSection(ProjectConfigurationPlatforms) = postSolution
        {9718499E-F274-4407-97F5-DCA08166EE68}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
        {9718499E-F274-4407-97F5-DCA08166EE68}.Debug|Any CPU.Build.0 = Debug|Any CPU
        {9718499E-F274-4407-97F5-DCA08166EE68}.Release|Any CPU.ActiveCfg = Release|Any CPU
        {9718499E-F274-4407-97F5-DCA08166EE68}.Release|Any CPU.Build.0 = Release|Any CPU
    EndGlobalSection
    GlobalSection(SolutionProperties) = preSolution
        HideSolutionNode = FALSE
    EndGlobalSection
EndGlobal

ConsoleApp2.csproj:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <OutputType>Exe</OutputType>
    <TargetFramework>netcoreapp1.1</TargetFramework>
  </PropertyGroup>

</Project>

_Copied from original issue: dotnet/cli#6133_

Question

Most helpful comment

Figured it out thanks to this issue:

https://github.com/fsharp/FAKE/issues/1312

There was a PLATFORM environment variable with the value of WINDOWS. Turns out MSBuild will pick it up.

Looks like HP machines set it up.

Thanks for the help!

All 8 comments

@epignosisx any ideas on where it is getting WINDOWS from here? Are you passing any extra parameters when restoring?

Can you also try dotnet msbuild /t:Clean <path to your solution> and let me know if you get the same result.

I have no idea where the WINDOWS is coming from.

Ran the following:

dotnet msbuild /t:Clean WebApplication1.sln

and received the same error:

Microsoft (R) Build Engine version 15.1.548.43366
Copyright (C) Microsoft Corporation. All rights reserved.

C:\Users\alejandroh\Documents\Visual Studio 2017\Projects\WebApplication1\WebApplication1.sln.metaproj : error MSB4126: The specified solution configuration "Debug|WINDOWS" is invalid. Please specify a valid solution configuration using the Configuration and Platform properties (e.g. MSBuild.exe Solution.sln /p:Configuration=Debug /p:Platform="Any CPU") or leave those properties blank to use the default solution configuration. [C:\Users\alejandroh\Documents\Visual Studio 2017\Projects\WebApplication1\WebApplication1.sln]

I guess that tells you it is not a nuget issue, right?

I guess that tells you it is not a nuget issue, right?

Right, looks like there is a general issue with the project that is causing this error.

Would you share a zip of the repro? Does this happen on other machines for you, or is it something else in your environment bringing in the platform?

I tried the same steps from my home computer and it worked just fine, although I have Win10 at home.

I'm going to ask some of my coworkers to repro to see what they get. At work we have a few things that have given us trouble in the past like an authenticated corporate proxy and Artifactory for our private libraries.

Figured it out thanks to this issue:

https://github.com/fsharp/FAKE/issues/1312

There was a PLATFORM environment variable with the value of WINDOWS. Turns out MSBuild will pick it up.

Looks like HP machines set it up.

Thanks for the help!

Glad you found it! I'm going to close this issue, let me know if you hit any other restore problems.

How did you fix it? What did you change it to?? I am having the same issue argh.

Check if you have an environment variable called Platform:
In a cmd session run set | findstr "Platform"

If you found it, try to delete it or run visual studio setting the environment variable Platform to empty.

Was this page helpful?
0 / 5 - 0 ratings