如何使用VS2010中的MSBuild在解决方案中定位特定的.NET项目?

| 我有一个可以构建整个解决方案的MSBuild命令行。看起来像这样: msbuild SomeSolution.sln / p:Configuration:CustomDebug; Platform = OurPlatform / nodeReuse:false / maxcpucount:4 / t:Build 我知道对于C ++解决方案,可以使用以下语法来定位特定项目: msbuild SomeSolution.sln / p:Configuration:CustomDebug; Platform = OurPlatform / nodeReuse:false / maxcpucount:4 / t:Folder \\ SomeCppProject; Build 我正在尝试在解决方案中为.NET项目实现相同的目的。这不起作用: msbuild SomeSolution.sln / p:Configuration:CustomDebug; Platform = OurPlatform / nodeReuse:false / maxcpucount:4 / t:SomeDotNetProject; Build 有谁知道如何在.NET项目的命令行上使用MSBuild在解决方案中以特定项目为目标?我知道我可以创建一个自定义MSBuild项目来实现我的目标,但是我需要与Visual Studio共享解决方案和项目。 谢谢! -西恩     
已邀请:
        您需要在Visual Studio解决方案文件中指定任何解决方案文件夹,并将项目名称中的所有\“。\”替换为\“ _ \”:
msbuild SomeSolution.sln /p:Configuration:CustomDebug;Platform=OurPlatform /t:Folder\\Project_Name
例如,如果您在解决方案文件夹\“ Deploy \”中有一个名为\“ MyApplication.Deployment.csproj \”的项目,则需要
msbuild SomeSolution.sln /p:Configuration:CustomDebug;Platform=OurPlatform /t:Deploy\\MyApplication_Deployment
偶然地,这是一个解决方案文件夹,如在Visual Studio中显示的那样,而不是文件系统文件夹:这些将被忽略。     
        您可以使用以下命令行从命令行使用msbuild来构建项目
msbuild Solution.sln /p:Configuration=Release;Platform=x86 /t:ProjectName:Rebuild
    
        在项目文件而不是解决方案文件上调用MSBuild(参考
msbuild /?
msbuild SomeDotNetProject\\SomeDotNetProject.csproj /p:Configuration:CustomDebug;Platform=OurPlatform /nodeReuse:false /maxcpucount:4 /t:Build
    

要回复问题请先登录注册