1

今日NAntを使い始めたばかりで、いくつかの例に従いました。私は1つの問題に苦労しています:

「ビルドを機能させるには、GUID '{32845370-6F32-411F-B4C5-383F9C3EDE29}' のプロジェクトを含める必要があります。」

これで、プロジェクトを追跡することができました。これが私のディレクトリ構造です:

c:\dev\stockclockbuild-> これは、ソリューションとビルド ファイルがある場所です。だから私はコマンドを実行します:

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

c:\dev\_sharedlibs\mdrlibs含まれているように見える「MDR.StockPlatform」という名前のプロジェクトがありますが、そのプロジェクトファイル内に、エラーに記載されている GUID を持つプロジェクト (依存関係) が見つかりました。

そのプロジェクトは「MDR.Base」と呼ばれますが、MDR.StockPlatform と同じフォルダーにあります。 また、このソリューションを開いてビジュアル スタジオでビルドすると、エラーなくビルドされます。

完全な詳細出力は次のとおりです。

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.

ビルド ファイルのコピーを次に示します。

<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>
4

1 に答える 1

0

最新の IDE を使用しており、NAnt のドキュメントから:

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.

NAnt スクリプトでは、NauckIT MSBuild タスクを使用します。

<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>

ただし、 NAnt exec タスクを使用して msbuild を直接呼び出すこともできるため、これは個人的な好みです。

于 2012-11-16T03:56:39.427 に答える