问题
I build whole Visual Studio solution using msbuild, it worked fine but there is one project not being built when I build whole solution
This is my msbuild script
<MSBuild Condition="'$(debug)' ==''"
Projects="$(MySolution)"
Targets="build"
Properties="Configuration=Release">
<Output TaskParameter="TargetOutputs" ItemName="BuildOutput" />
</MSBuild>
Something I need to check on this specific project in my Visual Studio solution?
回答1:
If this is a new project added to a solution and all other projects are building fine, my guess is that the new project has not been included in the solution configuration build list. In VS Solution Explorer right click on the solution node and open the configuration manager dialog and make sure your new project is checked for build in all relevant configuration (Debug, Release...), I am talking about this dialog:
回答2:
I ran into this same issue, except the accepted answer didn't apply, as all the projects in my solution were set to build across all relevant configurations.
I ended up taking a very close look at my sln file, and noticed a pernicious merge error that was preventing MSBuild from building Project2:
Project("{Guid1}") = "Project1", "Project1\Project1.csproj", "{Guid2}"
Project("{Guid1}") = "Project2", "Project2\Project2.csproj", "{Guid3}"
EndProject
While merging after my last git rebase
, I accidentally chopped off an EndProject
. Adding it back in fixed the issue, like so:
Project("{Guid1}") = "Project1", "Project1\Project1.csproj", "{Guid2}"
EndProject
Project("{Guid1}") = "Project2", "Project2\Project2.csproj", "{Guid3}"
EndProject
(I was using Visual Studio 2015)
来源:https://stackoverflow.com/questions/8495534/visual-studio-project-not-being-built-when-i-build-solution-from-msbuild