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

Build-Solution: specified solution configuration is invalid #120

Closed
AnthonyMastrean opened this issue Oct 7, 2011 · 1 comment
Closed

Comments

@AnthonyMastrean
Copy link

I'm having problems building and even understanding what's wrong with the build. Maybe it's just my system, maybe it's my PowerShell console (my profile loads the VS tools using vcvars.bat). I cloned the master branch and ran Build-Solution.ps1 from a PowerShell console. I got

the specified solution configuration "Debug|X64" is invalid.

I don't see a Platform defined in NuGetGallery.msbuild. I added ;Platform=Any CPU to the Build task and got the same error. I removed both Platform and Configuration and got the same error.

PS\nuget-gallery [master]> .\Build-Solution.ps1
Microsoft (R) Build Engine Version 4.0.30319.1
[Microsoft .NET Framework, Version 4.0.30319.237]
Copyright (C) Microsoft Corporation 2007. All rights reserved.

Build started 10/7/2011 9:55:09 AM.
Project "PS\nuget-gallery\Scripts\NuGetGallery.msbuild"
on node 1 (FullBuild target(s)).
Project "PS\nuget-gallery\Scripts\NuGetGallery.msbuild"
(1) is building "PS\nuget-gallery\NuGetGallery.sln" (2)
on node 1 (Clean target(s)).
PS\nuget-gallery\NuGetGallery.sln.metaproj : error MSB41
26: The specified solution configuration "Debug|X64" is invalid. Please specify a valid s
olution configuration using the Configuration and Platform properties (e.g. MSBuild.exe S
olution.sln /p:Configuration=Debug /p:Platform="Any CPU") or leave those properties blank
 to use the default solution configuration. [PS\nuget-ga
llery\NuGetGallery.sln]
Done Building Project "PS\nuget-gallery\NuGetGallery.sln
" (Clean target(s)) -- FAILED.

Done Building Project "PS\nuget-gallery\Scripts\NuGetGal
lery.msbuild" (FullBuild target(s)) -- FAILED.


Build FAILED.

"PS\nuget-gallery\Scripts\NuGetGallery.msbuild" (FullBui
ld target) (1) ->
"PS\nuget-gallery\NuGetGallery.sln" (Clean target) (2) -
>
(ValidateSolutionConfiguration target) ->
  PS\nuget-gallery\NuGetGallery.sln.metaproj : error MSB
4126: The specified solution configuration "Debug|X64" 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 bla
nk to use the default solution configuration. [PS\nuget-
gallery\NuGetGallery.sln]

    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:00.04

I inspected the NuGetGallery.sln, Website.csproj, and Facts.csproj for Platform and they all show Debug|AnyCPU and Release|AnyCPU as defaults. So, I ran the command by hand in my PowerShell console, in a way that should have used the defaults, and I got the same error!

PS\nuget-gallery [master]> msbuild .\NuGetGallery.sln

I finally ran with the Platform and Configuration overridden and it succeeded.

PS\nuget-gallery [master]> msbuild .\NuGetGallery.sln /p:Configuration=Debug /p:Platform="Any CPU"

But now I can't get the BuildViews task to complete. I ran that by hand (since invoking the msbuild file won't work).

PS\nuget-gallery [master]> msbuild .\Scripts\NuGetGallery.msbuild /t:BuildViews /p:Configuration=Debug /p:Platform="Any CPU"

Project "PS\nuget-gallery\Scripts\NuGetGallery.msbuild"
(1) is building "PS\nuget-gallery\Website\Website.csproj
" (4:7) on node 1 (MvcBuildViews target(s)).
C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Microsoft.Common.targets(483,9): error :
The OutputPath property is not set for project 'Website.csproj'.  Please check to make su
re that you have specified a valid combination of Configuration and Platform for this pro
ject.  Configuration='Debug'  Platform='Any CPU'.  You may be seeing this message because
 you are trying to build a project without a solution file, and have specified a non-defa
ult Configuration or Platform that doesn't exist for this project. [PS\nuget-gallery\Webs
ite\Website.csproj]

So, I added that in, and I don't know where it's supposed to go (not a web-projects guy), so I made it somewhere that I could simply watch if it output anything.

    PS\nuget-gallery [master]> msbuild .\Scripts\NuGetGallery.msbuild /t:BuildViews /p:Configuration=Debug /p:Platform="Any CPU" /p:OutputPath="$(pwd)\bin"

I got a .\bin_PublishedWebsites\Website and I don't know what do with that.

@AnthonyMastrean
Copy link
Author

When you import vcvars on a 64-bit machine, you get an machine-wide environment variable, Platform=x64. That requires that I use a regular console (one that doesn't import vcvars) or manually pass in the correct Platform.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant