Visual Studio Online - "The specified solution configuration "Debug|any cpu" is invalid" - visual-studio

I need to build VS solution under Visual Studio Online. But when I run it, I get an error:
C:\a\50009cdf\Mobius-ASG\Prototyping\VCPROJ\SystemAl.sln.metaproj(0,0): Error MSB4126: The specified solution configuration "Debug|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.
I've tried to change 'BuildPlatform' to 'Mixed Platforms' and 'BuildConfiguration' to 'Release'. But it didn't help, I got same error but with new values:
The specified solution configuration "Release|Mixed Platforms" 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
Also I've tried to disable and delete this variables, but still have the same error.
Haw can I fix it?

To set the configuration and platform of the project, please right-click the project in the Solution Explorer and select Configuration Manager.
In the Configuration Manager dialog, choose the configuration and platform value you want. Check in the pending changes into VSO, and re-run the build without any argument. You should now get the build run successfully.

Related

MSBuild ignoring publish profile configuration

I'm trying to publish a bunch of web services and a web site via command line using MSBuild. When I publish, the web services publish successfully but my web site does n't upon checking the logs, I've realized that msbuild is ignoring the build configurations in the specified publish profile and is using the default configurations i.e. Debug|AnyCpu. I've roamed around SO and the internet and found some articles but none worked for me.
Other SO article
I would like to be able to make MSBuild understand that I am trying to publish via the publishprofile. I tested the publish profile and visual studio and was able to execute a publish.
Here is my msbuild command
C:\Windows\Microsoft.NET\Framework\v4.0.30319\MsBuild.exe "PATH_TO_PROJECT\PROJECT.csproj" /nodeReuse:false /nologo /p:PublishProfile="FolderProfile" /p:DeployOnBuild=True
Logs
The target "_ConvertPdbFiles" listed in a BeforeTargets attribute at
"C:\Program Files
(x86)\MSBuild\4.0\Microsoft.Common.targets\ImportAfter\Xamarin.Common.targets
(34,37)" does not exist in the project, and will be ignored. The
target "_CollectPdbFiles" listed in an AfterTargets attribute at
"C:\Program Files
(x86)\MSBuild\4.0\Microsoft.Common.targets\ImportAfter\Xamarin.Common.targets
(34,70)" does not exist in the project, and will be ignored. The
target "_CollectMdbFiles" listed in a BeforeTargets attribute at
"C:\Program Files
(x86)\MSBuild\4.0\Microsoft.Common.targets\ImportAfter\Xamarin.Common.targets
(41,38)" does not exist in the project, and will be ignored. The
target "_CopyMdbFiles" listed in an AfterTargets attribute at
"C:\Program Files
(x86)\MSBuild\4.0\Microsoft.Common.targets\ImportAfter\Xamarin.Common.targets
(41,71)" does not exist in the project, and will be ignored. Project
"C:\Git\DXT\DXT.UI.WEB.APP.DEVICES\Dxt.Web\Dxt.Web.csproj" on node 1
(default targets).
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(609,5):
error : The OutputPath property is not set for project
'Dxt.Web.csproj'. Please check to make sure that you have specified a
valid combination of Configuration and Platform for this project.
Configuration='Debug' Platform='AnyCPU'. You may be seeing this
message because you are trying to build a project without a solution
file, and have specified a non-default Configuration or Platform that
doesn't exist for this project.
[C:\Git\DXT\DXT.UI.WEB.APP.DEVICES\Dxt.Web\Dxt.Web.csproj] Done
Building Project
"C:\Git\DXT\DXT.UI.WEB.APP.DEVICES\Dxt.Web\Dxt.Web.csproj" (default
targets) -- FAILED.
Build FAILED.
"C:\Git\DXT\DXT.UI.WEB.APP.DEVICES\Dxt.Web\Dxt.Web.csproj" (default
target) (1) -> (_CheckForInvalidConfigurationAndPlatform target) ->
C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(609,5):
error : The OutputPath property is not set for project
'Dxt.Web.csproj'. Please check to make sure that you have specified a
valid combination of Configuration and Platform for this project.
Configuration='Debug' Platform='AnyCPU'. You may be seeing this
message because you are trying to build a project without a solution
file, and have specified a non-default Configuration or Platform that
doesn't exist for this project.
[C:\Git\DXT\DXT.UI.WEB.APP.DEVICES\Dxt.Web\Dxt.Web.csproj]
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.09
I tried supplying a specific configuration to avoid the Debug|AnyCpu combo but encountered errors since the website has a custom Configuration called Release.Custom and depends on projects that do not have that configuration.
Any help is much appreciated.
If anyone encounters this, I was able to fix my error by changing the value of the Configuration tag to my custom BuildConfiguration i.e. "Release.Custom". It's very stupid considering I've spent a day on this.

Building InstallShield project with Multiple Product configuration using MSBuild command line

I have created InstallShield Basic MSI project from Visual Studio (IS 2012 Spring, VS 2010). My InstallShield project having 2 product configurations and each configuration having one release.
Product Configuration 1
Release 1
Product Configuration 2
Release 2
For building project in VS IDE, I need to set the corresponding product configuration as 'Default Product Configuration' and build. This is working fine. The Default configuration release is getting build.
But, how can we achieve this in MSBuild command line?
I need to build both configuration separately using MSBuild command line (without changing Default configuration through IDE).
Could anyone please share the proper way to build IS project in MSBuild command line?
Thanks,
Saravanan
how can we achieve this in MSBuild command line?
You can use Properties in the MSBuild command line:
msbuild test.sln /t:project /p:Configuration="Release" /p:Platform="x86" /p:BuildProjectReferences=false
You can also build multiple projects at once:
msbuild test.sln /t:project;project2 /p:Configuration="Release" /p:Platform="x86" /p:BuildProjectReferences=false
Note:
what is assigned to /t is the project name in the solution, it can be different from the project file name.
One important note: if your project has a '.' in the name, you'll need to replace it with a '_' when specifying it with /t

Why does the selected build configuration not get applied to the project file?

This may be a noobish question but here I go anyway.
So in VS I have a project whose build configuration I changed from Debug|AnyCpu to Release|AnyCpu.
Now this all works good and fine and when I build the project via VS this configuration is also used in the build process.
however I am also using the msbuild.exe in order to build the project via command sometimes and the problem is no matter what I do I can not change the
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
element of the project via VS. So setting the build configuration does only seem to work for VS and I bascially have to manually add this in the project file so that the msbuild.exe uses the correct build configuration.
Any Idea how I can change it in VS so the change also alters the project file ?
You don't need to change it explicitly. This string is "default configuration" for msbuild and VS - if no $(Configuration) value specified - set it to Debug.
If you want to build release configuration using msbuild you may want to specify configuration property or platform architecture in command line explicitly:
msbuild.exe myProject.csproj /p:Configuration="Release" /p:Platform="Any CPU"

TFS2010: Build Configuration Issues

I have customized the build configurations in my solution by deleting the Debug and Release configurations and creating "Dev" and "Test". Everything builds fine locally but I get the following error (and others like it) when building one of the new configurations in TFS.
C:\Program Files
(x86)\MSBuild\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets
(177): Unable to copy file
"bin\CommonServiceFactory.dll" to
"C:\MyApp\Binaries_PublishedWebsites\Epsi.Web\bin\CommonServiceFactory.dll".
Could not find a part of the path
'bin\CommonServiceFactory.dll'.
I'm getting this error for both external and project dependencies. From the posts I've read it seems to be related to the build configuration changes I've made. If I set the TFS build to use the "Debug" configuration I do get a warning but it builds successfully.
C:\MyApp\Sources\MyApp.sln.metaproj:
The specified solution configuration
"Debug|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.
Any help would be most appreciated.
MSBuild Command:
MSBuild.exe /nologo /noconsolelogger "C:\Builds\2\MyApp\ci.MyApp.acme.com\Sources\MyApp.sln" /m:1 /fl /flp:"logfile=C:\Builds\2\MyApp\ci.MyApp.acme.com\Sources\MyApp.log;encoding=Unicode;verbosity=diagnostic" /p:SkipInvalidConfigurations=true /p:OutDir="C:\Builds\2\MyApp\ci.MyApp.acme.com\Binaries\" /p:Configuration="Dev" /p:Platform="Any CPU" /p:VCBuildOverride="C:\Builds\2\MyApp\ci.MyApp.acme.com\Sources\MyApp.sln.Any CPU.Dev.vsprops" /dl:WorkflowCentralLogger,"C:\Program Files\Microsoft Team Foundation Server 2010\Tools\Microsoft.TeamFoundation.Build.Server.Logger.dll";"Verbosity=Diagnostic;BuildUri=vstfs:///Build/Build/2603;InformationNodeId=449514;TargetsNotLogged=GetNativeManifest,GetCopyToOutputDirectoryItems,GetTargetPath;TFSUrl=http://tfsServer01:8080/tfs/Core%20Development;"*WorkflowForwardingLogger,"C:\Program Files\Microsoft Team Foundation Server 2010\Tools\Microsoft.TeamFoundation.Build.Server.Logger.dll";"Verbosity=Diagnostic;
The error message indicates that you do not have the dll in the bin\ directory. If you can get on the build machine, can you check to see where the assemblies of your projects were built to? Make sure the path to the assemblies is the one used by the copying/publishing task to copy the assemblies to the Binaries_PublishedWebistes folder.
If this doesn't help, can you post the msbuild command-line from the TFS build details log up?

Devenv deployment parameters

I have a report project that I want to script deploying to a development server. I need to just change the TargetServerUrl in the project properties. Is there a way to do this?
i.e.
&devenv.exe RSReports.sln /project Reports\Reports.rptproj /deploy
maybe => properties:TargetServerUrl=http://myserver/ReportServer
I know nothing about report projects but in almost every VS project you can define multiple "Configuration"s (the defaults are Debug and Release). So you can have one target in debug and another in Release mode, and use the command line
devenv /deploy Release RSReports.sln
Another option is to use the msbuild.exe utility to build your project (instead of devenv), and use it's proprerty replacemnet parameter
"c:\Windows\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe" "Full path to soulution" /t:Build /p:Configuration=Release /p:TargetServerUrl=http://myserver/ReportServer

Resources