使用msbuild 3.5构建解决方案时跳过项目 [英] Skip a project while building a solution using msbuild 3.5

查看:184
本文介绍了使用msbuild 3.5构建解决方案时跳过项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个在文件夹上有许多图书馆和网站的解决方案.

I have a solution with a number of libraries + web site on folder.

当我使用msbuil对比此解决方案时,它会将网站预编译为新的文件夹名称PrecompiledWeb.我要跳过它,只需构建所有库即可.

When I use msbuil vs. this solution it precompiles web site to a new folder name PrecompiledWeb. I want to skip it, just build all libraries.

我该怎么做?

推荐答案

我会设置一个特殊的目标或一个不同的msbuild文件.

I would setup either a special target or perhaps a different msbuild file.

我使用一个.msbuild文件和几个不同的批处理文件,这样我就可以通过使用不同的批处理文件来构建应用程序的特定部分或整个程序.

I use one .msbuild file and several different batch files, that way I can build specific parts of my application or the entire thing just by using a different batch file.

在您的.msbuild文件中,您可以有两个目标,一个用于完整版本,一个仅用于库:

In your .msbuild file, you could have two targets, one for a full build and one for just the libs:

<Target Name="FullBuild">
  <MSBuild Projects="YourSolution.sln" />
</Target>

<Target Name="LibBuild">
  <MSBuild Projects="YourLibProject1.csproj" />
  <MSBuild Projects="YourLibProject2.csproj" />
  <MSBuild Projects="YourLibProject3.csproj" />
</Target>

因此,您可以使用FullBuild目标(将构建整个解决方案)或使用LibBuild目标(将构建所需的特定项目)调用msbuild.

So, you can call msbuild with either the FullBuild target which will build your entire solution, or with LibBuild which will build the specific projects you want.

批处理文件可能如下所示:

Batch files might look like this:

msbuild.exe /t:LibBuild

msbuild.exe /t:FullBuild

这篇关于使用msbuild 3.5构建解决方案时跳过项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆