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.
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.
Related articles
- All you want to know about Common Language Run Time (CLR)
- How to improve Asp.Net Application Performance - Part 2
- Using UNC path for Storing and Retrieving Files in ASP Net
- Asp Net Interview Questions and Answers - Part 1
- Use of Forever in Nodejs
- HTTP Error 500.22 - Internal Server Error
- PDF Creation in C#
- Git push error: Origin does not appear to be a git repository
- Top 10 frequently asked questions on Git
- Lock Logoff Restart Shutdown Computer using C#
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.
ReplyDeletec:\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"
ReplyDeleteError:
MSBUILD : error MSB1008: Only one project can be specified.
Switch: Files
you may want to try to remove the trailing '\' in your _PackageTempDir param
ReplyDeleteHi sir
ReplyDeletei am getting this error past from many days plz help me ..
i dont know where i am doing Mistakes..trying to solve it past from many days..
C:\Program Files (x86)\Jenkins\workspace\SG-Admin-Dev>exit 0
Path To MSBuild.exe: C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe
Executing the command cmd.exe /C " chcp 1252 & "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe" msbuild ScoreGeniusAdmin /P:VisualStudioVersion=15.0 /p:username=Adminstrator /P:Password=ipr@1234567 /P:AllowUntrustedCertificate=true /P:DeployOnBuild=True "/P:PublishProfile=C: \Website\ScoreGeniusAdmin" /P:MsDeployServiceUrl=http://34.242.99.230:8012 /P:Configuration=Release ScoreGenius.sln " && exit %%ERRORLEVEL%% from C:\Program Files (x86)\Jenkins\workspace\SG-Admin-Dev
[SG-Admin-Dev] $ cmd.exe /C " chcp 1252 & "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\Bin\MSBuild.exe" msbuild ScoreGeniusAdmin /P:VisualStudioVersion=15.0 /p:username=Adminstrator /P:Password=ipr@1234567 /P:AllowUntrustedCertificate=true /P:DeployOnBuild=True "/P:PublishProfile=C: \Website\ScoreGeniusAdmin" /P:MsDeployServiceUrl=http://34.242.99.230:8012 /P:Configuration=Release ScoreGenius.sln " && exit %%ERRORLEVEL%%
Active code page: 1252
Microsoft (R) Build Engine version 15.9.21+g9802d43bc3 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.
MSBUILD : error MSB1008: Only one project can be specified.
Switch: ScoreGeniusAdmin
For switch syntax, type "MSBuild /help"
Build step 'Build a Visual Studio project or solution using MSBuild' marked build as failure
Finished: FAILURE