1
votes

I just started using NAnt today, I followed some of the examples. I am having a hard time with one issue:

Its saying: "Project with GUID '{32845370-6F32-411F-B4C5-383F9C3EDE29}' must be included for the build to work."

Now I was able to track down the project. Here is my directory structure:

c:\dev\stockclockbuild -> this is where the solution and build file is located. So I run the command:

nant -buildfile:c:\dev\stockclockbuild\stocks.build

I have a project that it located in c:\dev\_sharedlibs\mdrlibs called "MDR.StockPlatform" which seems to get included, but within that project file I found the project (dependency) that has the GUID mentioned in the error.

That project is called "MDR.Base" but its located in the same folder as MDR.StockPlatform. Also if I were to open this solution and build it in visual studio it builds without errors.

Here is the complete verbose output:

c:\Dev\_Misc\Tools\nAnt\bin>nant -buildfile:c:\dev\stockclockbuild\stocks.build
NAnt 0.92 (Build 0.92.4543.0; release; 6/9/2012)
Copyright (C) 2001-2012 Gerry Shaw
http://nant.sourceforge.net

Buildfile: file:///c:/dev/stockclockbuild/stocks.build
Target framework: Microsoft .NET Framework 4.0
Target(s) specified: rebuild


clean:


build:


build.stockclock:

 [solution] Starting solution build.
 [solution] Loading projects...
 [solution] Loading project 'c:\dev\stockclockbuild\StockClock.Common\StockClock
.Common.csproj'.
 [solution] Using MSBuild version 4.0.30319.1.
 [solution] Loading referenced project 'c:\dev\_SharedLibs\MDRLibs\MDR.StockPlat
form\MDR.StockPlatform.csproj'.

BUILD FAILED

Project with GUID '{32845370-6F32-411F-B4C5-383F9C3EDE29}' must be included for
the build to work.

Total time: 0.6 seconds.

Here is a copy of the build file:

<project name="Solution Build Example" default="rebuild">
    <property name="configuration" value="release"/>

    <target name="clean" description="Delete all previously compiled binaries.">
        <delete>
            <fileset>
                <include name="**/bin/**" />
                <include name="**/obj/**" />
                <include name="**/*.suo" />
                <include name="**/*.user" />
            </fileset>
        </delete>
    </target>

    <target name="build" description="Build all targets.">
        <call target="build.stockclock"/>
    </target>

    <target name="rebuild" depends="clean, build" />

    <target name="build.stockclock">
        <solution configuration="${configuration}" solutionfile="Stockclock.sln" verbose="true">
        </solution>
    </target>

</project>
1
Wait, and why do you need NAnt for that? MSBuild 4.0 is perfectly capable of everything NAnt is (and quite similar in syntax, to be honest). - skolima
To be honest I started looking at NAnt because it supposedly integrates nicely with NUnit. Although I am currently not using those features I was planning to. We already use NUnit. - TheWebGuy
There's a NUnit task in github.com/loresoft/msbuildtasks MSBuildCommunity. And you can just invoke the console runner, that's what I had to do each time with NAnt anyway (never could get it's NUnit task to work). - skolima

1 Answers

0
votes

I'm assuming you're using a modern IDE, and from the NAnt Documentation:

Note: Right now, only Microsoft Visual Studio .NET 2002 and 2003 solutions and
projects are supported. Support for .NET Compact Framework projects is also not
available at this time.

In my NAnt scripts I use the NauckIT MSBuild task:

<msbuild projectFile="${solution.file}" targets="Build" verbosity="Quiet">
    <property name="Configuration" value="${build.configuration}" />
    <property name="Platform" value="${build.platform}" />
    <arg value="/flp:NoSummary;Verbosity=normal;LogFile=${build.log}" />
    <arg value="/p:SignAssembly=true" if="${isReleaseBuild}" />
    <arg value="/p:AssemblyOriginatorKeyFile=${solution.keyfile}" if="${isReleaseBuild}" />
    <arg value="/p:DelaySign=false" if="${isReleaseBuild}" />
</msbuild>

However that is a personal preference as you could also use the NAnt exec task and call msbuild directly.