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

nant

nant

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。

<configuration>
     ...snip...
  <nant>
        <frameworks>
            <platform name="win32" default="net-1.1">

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

翻译自: https://www.hanselman.com/blog/forcing-nant-to-build-and-run-with-a-specific-version-of-the-net-framework

nant

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值