Share via


Hosting Policies

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

The in-process side-by-side hosting API consolidates policies by providing a default activation policy, a compatibility policy available through the ICLRMetaHostPolicy interface, and an extension to the configuration file. These features allow greater control over host activation. For information about the configuration file, see the Configuration File Schema for the .NET Framework topic.

Side-by-Side Default Activation Policy

Installing the .NET Framework version 4 Beta 1 side by side with previous versions does not affect the existing runtime environment, and existing application behavior does not change. Because MSCorEE.dll is unconditionally updated each time a new version of the .NET Framework is added, rules were implemented to support the default behavior for assemblies, applications, components, and assemblies loaded by legacy hosts) that were compiled against the common language runtime (CLR) in the .NET Framework versions 1.0, 1.1, and 2.0.

Application Bindings

Applications will bind to the CLR version they were compiled against if that version is installed. Otherwise, an application will bind to the latest CLR version that is installed, up to version 2.0.50727.

The following table lists some common scenarios and the resulting CLR binding.

Note

In the following table, "No effect" indicates that the binding behavior does not change if the specified version of the CLR is installed.

CLR application was compiled against

CLR 1.0 installed?

CLR 1.1 installed?

CLR 2.0 installed?

CLR 4.0 installed?

Result

1.0

Yes

No effect

No effect

Yes

Bind to CLR 1.0

1.1

Yes

Yes

No effect

Yes

Bind to CLR 1.1

2.0

Yes

No effect

No effect

Yes

Bind to CLR 2.0

1.0

No

Yes

No

Yes

Bind to CLR 1.1

1.0

No

No effect

Yes

Yes

Bind to CLR 2.0

1.0

No

No effect

No

Yes

Failure

1.1

No effect

No

Yes

Yes

Bind to CLR 2.0

1.1

No effect

No

No

Yes

Failure

COM Component Bindings

COM components will bind to the latest CLR that is installed on the computer, up to CLR version 2.0.50727.

The following table lists some common scenarios and the resulting CLR binding.

CLR COM component was compiled against

CLR 1.0 installed?

CLR 1.1 installed?

CLR 2.0 installed?

CLR 4.0 installed?

Result

1.0

No effect

No effect

Yes

Yes

Bind to CLR 2.0

1.0

No effect

Yes

No

Yes

Bind to CLR 1.1

1.1

No effect

Yes

No

Yes

Bind to CLR 1.1

1.1

No effect

No effect

Yes

Yes

Bind to CLR 2.0

2.0

No effect

No effect

Yes

Yes

Bind to CLR 2.0

1.0

No effect

No effect

Yes

Yes

Bind to CLR 2.0

1.0

No effect

No effect

No

Yes

Failure

1.1

No effect

No effect

Yes

Yes

Bind to CLR 2.0

1.1

No effect

No effect

No

Yes

Failure

Assemblies Loaded by Legacy Native Hosts

For legacy native hosts, the following functions bind to the latest CLR that is installed on the computer, up to version 2.0.50727:

.NET Framework 4.0-Only Default Activation Policy

Having only the .NET Framework 4 Beta 1 installed does not impact applications and components that were compiled against a previous version of the .NET Framework. Because MSCorEE.dll is unconditionally updated each time a new version of the .NET Framework is added, the following rules were implemented to avoid unpredictable behavior in older applications and components:

  • Application bindings: If the computer has only the .NET Framework 4 Beta 1 installed, and you try to run an application that was compiled against a previous version, a modal dialog box will instruct you to obtain the correct version of the .NET Framework, and the application will not load.

  • COM component bindings: If the computer has only the .NET Framework 4 Beta 1 installed, and the COM component to be activated was compiled against a previous version, the activation will fail with a specific HRESULT.

See Also

Concepts

Hosting Overview

Other Resources

Hosting Changes in the .NET Framework 4

Hosting (Unmanaged API Reference)