When writing an MSBuild file from scratch, is it possible to build .csproj files directly without a reference to the solution they're a member of? Introductory guides like this one often explain how to compile individual .cs files or build a .csproj directly from the command line.
For example, command line MSBuild without a .sln reference:
msbuild helloworld.csproj /t:Build /verbosity:detailed
Or a .csproj given a .sln:
<MSBuild
Projects="mysolution.sln"
Targets="My_Project_File"
Properties="Configuration=$(Configuration);Platform=$(Platform)"
ContinueOnError="false" />
I haven't found any references mentioning building the .csproj within an MSBuild file without a .sln. Is there a way and I'm just missing something?
There is nothing wrong whatsoever with building csproj files without a solution:
<MSBuild Projects="my_project.csproj" Targets="Build" />
moreover, when you build a solution with Visual Studio what it actually does internally is convert the solution file to an msbuild script that contains a line like the above to build the projects.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.