File nant-useruntime_fix.patch of Package nant
--- nant-0.86-beta1/src/NAnt.Core/Tasks/ExternalProgramBase.cs.orig 2007-12-07 03:50:16.000000000 -0700
+++ nant-0.86-beta1/src/NAnt.Core/Tasks/ExternalProgramBase.cs 2008-02-26 12:15:43.000000000 -0700
@@ -66,6 +66,7 @@
private int _exitCode = UnknownExitCode;
private bool _spawn;
private int _processId = 0;
+ private bool _useRuntimeEngine;
#endregion Private Instance Fields
@@ -202,32 +203,64 @@
/// <see langword="true" /> if the external program should be executed
/// using a runtime engine; otherwise, <see langword="false" />.
/// </value>
+ /// <remarks>
+ /// <para>
+ /// The value of <see cref="UseRuntimeEngine" /> is only used from
+ /// <see cref="Managed" />, and then only if its value is set to
+ /// <see cref="ManagedExecution.Default" />. In which case
+ /// <see cref="Managed" /> returns <see cref="ManagedExecution.Auto" />
+ /// if <see cref="UseRuntimeEngine" /> is <see langword="true" />.
+ /// </para>
+ /// <para>
+ /// In all other cases, the value of <see cref="UseRuntimeEngine" />
+ /// is ignored.
+ /// </para>
+ /// </remarks>
[FrameworkConfigurable("useruntimeengine")]
[Obsolete("Use the managed attribute and Managed property instead.", false)]
public virtual bool UseRuntimeEngine {
- get { return Managed != ManagedExecution.Default; }
- set {
- if (value) {
- Managed = ManagedExecution.Auto;
- } else {
- Managed = ManagedExecution.Default;
- }
- }
+ get { return _useRuntimeEngine; }
+ set { _useRuntimeEngine = value; }
}
/// <summary>
- /// Specifies whether the external program is a managed application
- /// which should be executed using a runtime engine, if configured.
- /// The default is <see langword="false" />.
+ /// Specifies whether the external program should be treated as a managed
+ /// application, possibly forcing it to be executed under the currently
+ /// targeted version of the CLR.
/// </summary>
/// <value>
- /// <see langword="true" /> if the external program should be executed
- /// using a runtime engine; otherwise, <see langword="false" />.
+ /// A <see cref="ManagedExecution" /> indicating how the program should
+ /// be treated.
/// </value>
+ /// <remarks>
+ /// <para>
+ /// If <see cref="Managed" /> is set to <see cref="ManagedExecution.Default" />,
+ /// which is the default value, and <see cref="UseRuntimeEngine" /> is
+ /// <see langword="true" /> then <see cref="ManagedExecution.Auto" />
+ /// is returned.
+ /// </para>
+ /// <para>
+ /// When the changing <see cref="Managed" /> to <see cref="ManagedExecution.Default" />,
+ /// then <see cref="UseRuntimeEngine" /> is set to <see langword="false" />;
+ /// otherwise, it is changed to <see langword="true" />.
+ /// </para>
+ /// </remarks>
+
[FrameworkConfigurable("managed")]
public virtual ManagedExecution Managed {
- get { return _managed; }
- set { _managed = value; }
+ get {
+ // deal with cases where UseRuntimeEngine is overridden to
+ // return true by default
+ if (UseRuntimeEngine && _managed == ManagedExecution.Default) {
+ return ManagedExecution.Auto;
+ }
+
+ return _managed;
+ }
+ set {
+ _managed = value;
+ UseRuntimeEngine = (value != ManagedExecution.Default);
+ }
}
/// <summary>