tags:

views:

165

answers:

2

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

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.

How can I do that?

+1  A: 

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

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.

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>

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

quip
+1  A: 

You should be able to do this by creating a new configuration (LibOnly) and in the Visual Studio Configuration manager only check the projects that you want to build. Then from the command line:

msbuild.exe YourSolution.sln /p:Configuration=LibOnly

As the previous commenter mentioned you can alwyas create your own MSBuild file to specify which projects to build. I think that's a good approach, I don't like building solution files.

Sayed Ibrahim Hashimi