nant_强制NAnt使用.NET Framework的特定版本进行构建和运行



If you're not careful, and you have both versions of the .NET Framework on your box (1.0 and 1.1) NAnt will build your stuff using .NET 1.0.  Whether that's what you want or not, it's important to be explicit.

如果您不小心,并且同时使用了两个版本的.NET Framework(1.0和1.1), NAnt将使用.NET 1.0来构建您的东西。 无论您要的是什么,明确表达都非常重要。

There's two ways:


  • Add <property name="nant.settings.currentframework" value="net-1.1"/> to your .build file(s).

    <property name =“ nant.settings.currentframework” value =“ net-1.1 ” />添加到您的.build文件。

or, to make the change to .NET 1.1 as the default, look in the NAnt.exe.config file in the same directory as NAnt.exe.

或者,要默认更改为.NET 1.1,请在与NAnt.exe相同的目录中查找NAnt.exe.config文件。

In this XML config file, in /configuration/nant/framework/platform[@default] you'll want to set that default attribute to "net-1.1" like this.  Note: The ID "net-1.1" corresponds to a named <framework> section called "net-1.1" further down in the file that gives NAnt all the info it needs to build on that version.  NAnt can also be used to build Mono, at least as of version 0.28 of Mono.

在此XML配置文件的/ configuration / nant / framework / platform [@default]中,您需要将默认属性设置为“ net-1.1”,如下所示。 注意:ID“ net-1.1”对应于文件中更下方的名为“ net-1.1”的<framework>节,该节为NAnt提供了在该版本上构建所需的所有信息。 NAnt也可以至少在Mono 0.28版本中用于构建Mono。

            <platform name="win32" default="net-1.1">

<配置> ...剪... <nant> <框架> <platform name =“ win32” default =“ net-1.1 ”>



已标记关键词 清除标记
评论将由博主筛选后显示,对所有人可见 | 还能输入1000个字符
©️2020 CSDN 皮肤主题: 编程工作室 设计师:CSDN官方博客 返回首页