MSBuild : Building a project without building it's dependencies

  • Thread starter ramshankaryadav
  • Start date
R

ramshankaryadav

Hi,
I'm facing a problem while building a project through MSBuild, this
project is a part of a solution which has several other projects on
which it depends, but I want to build this project without building
it's dependencies.
We can do this for a solution by unselecting projects through
Configuration Manager under solution properties, but how to achive
same for a project!
 
N

Nicholas Paldino [.NET/C# MVP]

Instead of running MSBUILD on the solution file, have you tried to run
it on just the project file?

Or, you can still run it on the solution file, and target just one
specific project in the solution using the /t switch.
 
R

ramshankaryadav

Hi Nicholas,
The problem is that we are migrating from .NET 1.1 to .NET 2.0, and we
used NAnt to build our solutions, using <solution> tag like this,
<solution configuration="${project.config}" failonerror="true"
outputdir="${output.dir}">
...........

but because of change in the project structure of VS .NET 2005, which
is MSBuild compliant, our previous build file fails to build.
After some diagnosis, we found that we need to invoke MSBuild using
<exec> tag like this
<exec program="MSBuild" commandline="myproject.vcproj /
property:Configuration=${project.config};OutputPath=${path::get-full-
path(output.dir)}" verbose="false"/>

now the problem is ........
when I execute this script, it rebuilds it's dependent projects as
well, which I don't want to do!

I hope this explanation would be useful to you!

Thanks in advance!

Cheers,
Ram
Instead of runningMSBUILDon the solution file, have you tried to run
it on just the project file?

Or, you can still run it on the solution file, and target just one
specific project in the solution using the /t switch.

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)




Hi,
I'm facing a problem while building a project throughMSBuild, this
project is a part of a solution which has several other projects on
which it depends, but I want to build this project without building
it's dependencies.
We can do this for a solution by unselecting projects through
Configuration Manager under solution properties, but how to achive
same for a project!- Hide quoted text -

- Show quoted text -
 
N

Nicholas Paldino [.NET/C# MVP]

Well, why use NANT still and why not use MSBuild directly?

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

Hi Nicholas,
The problem is that we are migrating from .NET 1.1 to .NET 2.0, and we
used NAnt to build our solutions, using <solution> tag like this,
<solution configuration="${project.config}" failonerror="true"
outputdir="${output.dir}">
..........

but because of change in the project structure of VS .NET 2005, which
is MSBuild compliant, our previous build file fails to build.
After some diagnosis, we found that we need to invoke MSBuild using
<exec> tag like this
<exec program="MSBuild" commandline="myproject.vcproj /
property:Configuration=${project.config};OutputPath=${path::get-full-
path(output.dir)}" verbose="false"/>

now the problem is ........
when I execute this script, it rebuilds it's dependent projects as
well, which I don't want to do!

I hope this explanation would be useful to you!

Thanks in advance!

Cheers,
Ram
Instead of runningMSBUILDon the solution file, have you tried to run
it on just the project file?

Or, you can still run it on the solution file, and target just one
specific project in the solution using the /t switch.

--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)




Hi,
I'm facing a problem while building a project throughMSBuild, this
project is a part of a solution which has several other projects on
which it depends, but I want to build this project without building
it's dependencies.
We can do this for a solution by unselecting projects through
Configuration Manager under solution properties, but how to achive
same for a project!- Hide quoted text -

- Show quoted text -
 
A

Arne Vajhøj

Nicholas said:
Well, why use NANT still and why not use MSBuild directly?

Maybe he likes NAnt.

I assume that NAnt still has way more tasks than MSBuild.

Arne
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top