a blog for those who code

Friday, 10 October 2014

Solved "MSBuild : Error MSB1008: Only one project can be specified"

In this post we will show you how to fix "MSBuild : Error MSB1008: Only one project can be specified".

MSBuild can only build one project. So specify only one project to build. If you have more than one project, build them one by one.

You might also get this error if your MSBuild switches contain space or its surrounded with double quotes. So if any of the switches contain a path that has spces in it, make sure that it should end with double backward slashes.

You will also get this error if you have written something like
C:\example> msbuild example.sln \t:build
You have to change your above script to C:\example> msbuild example.sln /t:build
Whenever you get this error at first check that you have given correct slash (\ or /) or not.

Please Like and Share the Blog, if you find it interesting and helpful.


  1. Hi. This post was really helpful. This solved the problem which i was struggling to resolve since two days. Thank you very much Hemant Joshi.

  2. c:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\MSBuild.exe /t:PipelinePreDeployCopyAllFilesToOneFolder /p:DeployOnBuild=True;_PackageTempDir="\\storage\builds\mine\";Configuration=Release;AssemblyOriginatorKeyFile=c:\prjNET\Common\Key.snk;OutputPath="c:\Development\bin" Code\Proj\Maint.csproj /property:FrameworkPathOverride="C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.5"

    MSBUILD : error MSB1008: Only one project can be specified.
    Switch: Files

  3. you may want to try to remove the trailing '\' in your _PackageTempDir param