看起來理查德B在Nant.exe.config修改的正確軌道上。我將下面的XML添加到配置文件中,並且能夠將我的主構建文件中的nant.settings.currentframework屬性設置爲silverlight-3.0,並且事情像魅力一樣工作。 (注:我把它放在silverlight-2.0框架定義之後的第775行的配置文件中)。希望這有幫助
<framework
name="silverlight-3.0"
family="silverlight"
version="3.0"
description="Microsoft Silverlight 3.0"
sdkdirectory="${path::combine(sdkInstallRoot, 'bin')}"
frameworkdirectory="${path::combine(installRoot, 'v3.5')}"
frameworkassemblydirectory="${environment::get-folder-path('ProgramFiles')}/Microsoft Silverlight/3.0.40818.0"
clrversion="2.0.50727"
>
<runtime>
<modes>
<strict>
<environment>
<variable name="COMPLUS_VERSION" value="v2.0.50727" />
</environment>
</strict>
</modes>
</runtime>
<reference-assemblies basedir="${environment::get-folder-path('ProgramFiles')}/Microsoft Silverlight/3.0.40818.0">
<include name="agclr.dll" />
<include name="Microsoft.VisualBasic.dll" />
<include name="mscorlib.dll" />
<include name="System.Core.dll" />
<include name="System.dll" />
<include name="System.Silverlight.dll" />
<include name="System.Xml.dll" />
<include name="System.Windows.dll" />
<include name="System.Windows.Browser.dll" />
</reference-assemblies>
<task-assemblies>
<!-- include MS.NET version-neutral assemblies -->
<include name="extensions/net/neutral/**/*.dll" />
<!-- include MS.NET 2.0 specific assemblies -->
<include name="extensions/net/2.0/**/*.dll" />
<!-- include MS.NET specific task assembly -->
<include name="NAnt.MSNetTasks.dll" />
<!-- include MS.NET specific test assembly -->
<include name="NAnt.MSNet.Tests.dll" />
<!-- include .NET 2.0 specific assemblies -->
<include name="extensions/common/2.0/**/*.dll" />
</task-assemblies>
<tool-paths>
<directory name="${path::combine(sdkInstallRoot, 'bin')}"
if="${property::exists('sdkInstallRoot')}" />
<directory name="${path::combine(installRoot, 'v2.0.50727')}" />
<directory name="${environment::get-folder-path('ProgramFiles')}/Microsoft Silverlight/3.0.40818.0" />
</tool-paths>
<project>
<readregistry
property="installRoot"
key="SOFTWARE\Microsoft\.NETFramework\InstallRoot"
hive="LocalMachine" />
<readregistry
property="sdkInstallRoot"
key="SOFTWARE\Microsoft\.NETFramework\sdkInstallRootv2.0"
hive="LocalMachine"
failonerror="false" />
</project>
<tasks>
<task name="csc">
<attribute name="noconfig">true</attribute>
<attribute name="nostdlib">true</attribute>
<attribute name="supportsnowarnlist">true</attribute>
<attribute name="supportswarnaserrorlist">true</attribute>
<attribute name="supportskeycontainer">true</attribute>
<attribute name="supportskeyfile">true</attribute>
<attribute name="supportsdelaysign">true</attribute>
<attribute name="supportsplatform">true</attribute>
<attribute name="supportslangversion">true</attribute>
</task>
<task name="vbc">
<attribute name="nostdlib">true</attribute>
<attribute name="supportsdocgeneration">true</attribute>
<attribute name="supportsnostdlib">true</attribute>
<attribute name="supportsnowarnlist">true</attribute>
<attribute name="supportskeycontainer">true</attribute>
<attribute name="supportskeyfile">true</attribute>
<attribute name="supportsdelaysign">true</attribute>
<attribute name="supportsplatform">true</attribute>
<attribute name="supportswarnaserrorlist">true</attribute>
</task>
<task name="jsc">
<attribute name="supportsplatform">true</attribute>
</task>
<task name="vjc">
<attribute name="supportsnowarnlist">true</attribute>
<attribute name="supportskeycontainer">true</attribute>
<attribute name="supportskeyfile">true</attribute>
<attribute name="supportsdelaysign">true</attribute>
</task>
<task name="resgen">
<attribute name="supportsassemblyreferences">true</attribute>
<attribute name="supportsexternalfilereferences">true</attribute>
</task>
<task name="delay-sign">
<attribute name="exename">sn</attribute>
</task>
<task name="license">
<attribute name="exename">lc</attribute>
<attribute name="supportsassemblyreferences">true</attribute>
</task>
</tasks>
</framework>
Thx @ckramer ...我需要在某個時候嘗試腳本...你能發佈你的nAnt構建文件,以便我們可以看到你的用法(特別是用於創建xap文件嗎?) – 2009-11-30 05:31:52