ApplicationPool.ManagedRuntimeVersion 属性

定义

获取或设置当前应用程序池中用于托管应用程序的.NET Framework的版本。

public:
 property System::String ^ ManagedRuntimeVersion { System::String ^ get(); void set(System::String ^ value); };
public string ManagedRuntimeVersion { get; set; }
member this.ManagedRuntimeVersion : string with get, set
Public Property ManagedRuntimeVersion As String

属性值

应用程序池使用的.NET Framework的版本号。 默认值为“v2.0”。

示例

以下示例列出了 属性的值 ManagedRuntimeVersion 以及其他应用程序池属性的值。 此代码示例是为 ApplicationPool 类提供的一个更大示例的一部分。

// If the applicationPool is stopped, restart it.
if (applicationPool.State == ObjectState.Stopped)
{
    applicationPool.Start();
}

注解

当前有效值为“v2.0”和“v1.1”。 在 IIS 服务器上安装新版本的 .NET Framework 时,将接受其他值。

可以使用此属性来配置当前应用程序池的托管运行时版本。 若要为服务器上的所有应用程序池设置默认值,请使用 ApplicationPoolDefaults 对象。

适用于