Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The specified solution configuration "Latest|Any CPU" is invalid

I am getting this error with my MSBuild script running in Jenkins

C:\<path>\<solutionname>.sln.metaproj : error MSB4126: The specified solution
configuration "Latest|Any CPU" 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.

In my Jenkins configuration under Build->Command Line Arguments I have

/t:Deploy /P:Configuration=Latest

I've used this on other projects without any issue before and I've just practically the same build file too but I've never seen this issue happen before. I suspect that since the only thing that is different is the solution file that there may be something different there that needs to be changed.

like image 228
Sachin Kainth Avatar asked Feb 28 '13 10:02

Sachin Kainth


1 Answers

Does the "Latest" configuration exist? By Default Visual Studio creates 2 configurations when you create a new solution. These are "Debug" and "Release" if you want to create a custom configuration you need to use the Configuration Manager in Visual Studio.

Right Click on the Solution in Solution Explorer and select "Configuration Manager" you will then be presented with the following UI. This lists all of the projects in the solution, what type they are (Any CPU, x86 etc) and whether they should be build as part of that configuration.

Visual Studio Configuration Manager UI

You can now create a configuration called "Latest" and decide what needs to be built for that configuration.

like image 122
James Reed Avatar answered Oct 03 '22 22:10

James Reed