AppDomainSetup.TargetFrameworkName AppDomainSetup.TargetFrameworkName AppDomainSetup.TargetFrameworkName AppDomainSetup.TargetFrameworkName Property

定义

获取或设置为应用程序域指定目标版本和 .NET Framework 配置文件的字符串,以可由 FrameworkName(String) 构造函数分析的格式。Gets or sets a string that specifies the target version and profile of the .NET Framework for the application domain, in a format that can be parsed by the FrameworkName(String) constructor.

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

属性值

.NET Framework 的目标版本与配置文件。The target version and profile of the .NET Framework.

注解

设置此属性告知当前正在运行的.NET framework 版本,应用程序域将用于加载和运行已编译的目标版本和配置文件的程序集。Set this property to tell the currently running version of the .NET Framework that the application domain will be used to load and run assemblies that have been compiled for the target version and profile. 如果当前正在运行的.NET framework 版本的影响的目标版本编译的代码的兼容性的可选行为,它可以启用或禁用这些行为,根据需要,以提高兼容性。If the currently running version of the .NET Framework has optional behaviors that affect the compatibility of code that was compiled with the target version, it can enable or disable those behaviors, as appropriate, to improve compatibility. 在应用程序支持与多个版本的.NET Framework 编译的在单独的应用程序域中运行它们的加载项,这很有用。This can be useful when an application supports add-ins compiled with multiple versions of the .NET Framework by running them in separate application domains.

对于客户端应用程序,值TargetFrameworkName属性来推断TargetFrameworkAttribute属性。For client applications, the value of the TargetFrameworkName property is inferred from the TargetFrameworkAttribute attribute. 在中Visual Studio 2010Visual Studio 2010和更高版本,此特性添加到自动基于项目的设置的程序集目标框架属性。In Visual Studio 2010Visual Studio 2010 and later, this attribute is added to the assembly automatically based on the setting of the project's Target Framework property.

适用于