Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ ms.assetid: 5fca42f3-bdce-4b81-a704-61e42c89d3ba
---
# How to: Enable and Disable Automatic Binding Redirection

When you compile apps in Visual Studio that target the [!INCLUDE[net_v451](../../../includes/net-v451-md.md)] and later versions, binding redirects may be automatically added to the app configuration file to override assembly unification. Binding redirects are added if your app or its components reference more than one version of the same assembly, even if you manually specify binding redirects in the configuration file for your app. The automatic binding redirection feature affects desktop apps and web apps that target the [!INCLUDE[net_v451](../../../includes/net-v451-md.md)] or a later version, although the behavior is slightly different for a web app. You can enable automatic binding redirection if you have existing apps that target previous versions of the .NET Framework, or you can disable this feature if you want to manually author binding redirects.
When you compile apps in Visual Studio that target the .NET Framework 4.5.1 and later versions, binding redirects may be automatically added to the app configuration file to override assembly unification. Binding redirects are added if your app or its components reference more than one version of the same assembly, even if you manually specify binding redirects in the configuration file for your app. The automatic binding redirection feature affects desktop apps and web apps that target the .NET Framework 4.5.1 or a later version, although the behavior is slightly different for a web app. You can enable automatic binding redirection if you have existing apps that target previous versions of the .NET Framework, or you can disable this feature if you want to manually author binding redirects.

## Disable automatic binding redirects in desktop apps

Automatic binding redirects are enabled by default for Windows desktop apps that target the [!INCLUDE[net_v451](../../../includes/net-v451-md.md)] and later versions. The binding redirects are added to the output configuration (**app.config**) file when the app is compiled and override the assembly unification that might otherwise take place. The source **app.config** file is not modified. You can disable this feature by modifying the project file for the app or by deselecting a checkbox in the project's properties in Visual Studio.
Automatic binding redirects are enabled by default for Windows desktop apps that target the .NET Framework 4.5.1 and later versions. The binding redirects are added to the output configuration (**app.config**) file when the app is compiled and override the assembly unification that might otherwise take place. The source **app.config** file is not modified. You can disable this feature by modifying the project file for the app or by deselecting a checkbox in the project's properties in Visual Studio.

### Disable through project properties

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ You can redirect compile-time binding references to .NET Framework assemblies, t

### Relying on automatic binding redirection

When you create a desktop app in Visual Studio that targets the [!INCLUDE[net_v451](../../../includes/net-v451-md.md)] or a later version, the app uses automatic binding redirection. This means that if two components reference different versions of the same strong-named assembly, the runtime automatically adds a binding redirection to the newer version of the assembly in the output app configuration (app.config) file. This redirection overrides the assembly unification that might otherwise take place. The source app.config file is not modified. For example, let's say that your app directly references an out-of-band .NET Framework component but uses a third-party library that targets an older version of the same component. When you compile the app, the output app configuration file is modified to contain a binding redirection to the newer version of the component. If you create a web app, you receive a build warning regarding the binding conflict, which in turn, gives you the option to add the necessary binding redirect to the source web configuration file.
When you create a desktop app in Visual Studio that targets the .NET Framework 4.5.1 or a later version, the app uses automatic binding redirection. This means that if two components reference different versions of the same strong-named assembly, the runtime automatically adds a binding redirection to the newer version of the assembly in the output app configuration (app.config) file. This redirection overrides the assembly unification that might otherwise take place. The source app.config file is not modified. For example, let's say that your app directly references an out-of-band .NET Framework component but uses a third-party library that targets an older version of the same component. When you compile the app, the output app configuration file is modified to contain a binding redirection to the newer version of the component. If you create a web app, you receive a build warning regarding the binding conflict, which in turn, gives you the option to add the necessary binding redirect to the source web configuration file.

If you manually add binding redirects to the source app.config file, at compile time, Visual Studio tries to unify the assemblies based on the binding redirects you added. For example, let's say you insert the following binding redirect for an assembly:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ In this table, 4.5.*x* refers to the .NET Framework 4.5 and its point releases,
|Cannot uninstall the .NET Framework 4.5*.x*/4.6*.x*/4.7*.x*/4.8. Other applications on your computer are dependent on this program.|In general, you shouldn't uninstall any versions of the .NET Framework from your computer, because an application you use may depend on a specific version of the .NET Framework. For more information, see [The .NET Framework for users](../../../docs/framework/get-started/index.md#ForUsers) in the *Getting Started* guide.|
|The .NET Framework 4.5*.x*/4.6*.x*/4.7*.x*/4.8 redistributable does not apply to this operating system. Please download the .NET Framework 4.5*.x*/4.6*.x*/4.7*.x*/4.8 for your operating system from the Microsoft Download Center.|You may be trying to install .NET Framework 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, or 4.8 on a platform that isn't supported, or you have chosen the installation package that does not include the components for all supported operating systems. Run the installation again by using the offline installer ([for 4.5.1](https://go.microsoft.com/fwlink/p/?LinkId=309493), [for 4.5.2](https://go.microsoft.com/fwlink/p/?LinkId=397706), [for 4.6](https://go.microsoft.com/fwlink/p/?LinkId=528233), [for 4.6.1](https://go.microsoft.com/fwlink/p/?LinkId=671744), for [4.6.2](https://go.microsoft.com/fwlink/p/?LinkId=780604), for [4.7](https://go.microsoft.com/fwlink/p/?LinkId=825306)), for [4.7.1](https://go.microsoft.com/fwlink/p/?LinkId=852090), for [4.7.2](https://go.microsoft.com/fwlink/p/?LinkId=863265), or for [4.8](https://go.microsoft.com/fwlink/?linkid=2088631). For more information, see the [installation guide](../../../docs/framework/install/guide-for-developers.md) and [system requirements](../../../docs/framework/get-started/system-requirements.md) for supported operating systems.|
|The update corresponding to KB\<*number*> needs to be installed before you can install this product.|Installation of the .NET Framework requires that a KB update be installed before installing the .NET Framework. Install the update, and then begin the .NET Framework installation again.<br /><br /> For example, installation of updated versions of the .NET Framework on Windows 8.1, Windows RT 8.1, and Windows Server 2012 R2 requires that the update corresponding to [KB 2919355](https://support.microsoft.com/kb/2919355) be installed.|
|Your computer is currently running a Server Core installation of the Windows Server 2008 operating system. The .NET Framework 4.5.*x* requires a later release of the operating system. Please install Windows Server 2008 R2 SP1 or higher and rerun .NET Framework 4.5.*x* setup.|The [!INCLUDE[net_v451](../../../includes/net-v451-md.md)] and 4.5.2 are supported in the Server Core role with Windows Server 2008 R2 SP1 or later. See [System Requirements](../../../docs/framework/get-started/system-requirements.md).|
|Your computer is currently running a Server Core installation of the Windows Server 2008 operating system. The .NET Framework 4.5.*x* requires a later release of the operating system. Please install Windows Server 2008 R2 SP1 or higher and rerun .NET Framework 4.5.*x* setup.|The .NET Framework 4.5.1 and 4.5.2 are supported in the Server Core role with Windows Server 2008 R2 SP1 or later. See [System Requirements](../../../docs/framework/get-started/system-requirements.md).|
|You do not have sufficient privileges to complete this operation for all users of this computer. Log on as an administrator and rerun **Setup**.|You must be an administrator on the computer to install the .NET Framework.|
|Setup cannot continue because a previous installation requires your computer to be restarted. Please restart your computer and rerun Setup.|A restart is sometimes required to fully complete an installation. Follow the instructions to restart your computer and rerun Setup.<br /><br /> In rare cases, you may be asked to restart your system more than once if Windows has detected a number of missing updates and is restarting to install the next update in the queue.|
|.NET Framework Setup cannot be run in Program Compatibility Mode.|See the [Program Compatibility Issues](#compat) section later in this article.|
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ author: "rpetrusha"
ms.author: "ronpet"
---
# Winmdexp.exe (Windows Runtime Metadata Export Tool)
The [!INCLUDE[wrt](../../../includes/wrt-md.md)] Metadata Export Tool (Winmdexp.exe) transforms a .NET Framework module into a file that contains [!INCLUDE[wrt](../../../includes/wrt-md.md)] metadata. Although .NET Framework assemblies and [!INCLUDE[wrt](../../../includes/wrt-md.md)] metadata files use the same physical format, there are differences in the content of the metadata tables, which means that .NET Framework assemblies are not automatically usable as [!INCLUDE[wrt](../../../includes/wrt-md.md)] Components. The process of turning a .NET Framework module into a [!INCLUDE[wrt](../../../includes/wrt-md.md)] component is referred to as *exporting*. In the [!INCLUDE[net_v45](../../../includes/net-v45-md.md)] and [!INCLUDE[net_v451](../../../includes/net-v451-md.md)], the resulting Windows metadata (.winmd) file contains both metadata and implementation.
The [!INCLUDE[wrt](../../../includes/wrt-md.md)] Metadata Export Tool (Winmdexp.exe) transforms a .NET Framework module into a file that contains [!INCLUDE[wrt](../../../includes/wrt-md.md)] metadata. Although .NET Framework assemblies and [!INCLUDE[wrt](../../../includes/wrt-md.md)] metadata files use the same physical format, there are differences in the content of the metadata tables, which means that .NET Framework assemblies are not automatically usable as [!INCLUDE[wrt](../../../includes/wrt-md.md)] Components. The process of turning a .NET Framework module into a [!INCLUDE[wrt](../../../includes/wrt-md.md)] component is referred to as *exporting*. In the [!INCLUDE[net_v45](../../../includes/net-v45-md.md)] and .NET Framework 4.5.1, the resulting Windows metadata (.winmd) file contains both metadata and implementation.

When you use the **[!INCLUDE[wrt](../../../includes/wrt-md.md)] Component** template, which is located under **Windows Store** for C# and Visual Basic in Visual Studio 2013 or Visual Studio 2012, the compiler target is a .winmdobj file, and a subsequent build step calls Winmdexp.exe to export the .winmdobj file to a .winmd file. This is the recommended way to build a [!INCLUDE[wrt](../../../includes/wrt-md.md)] component. Use Winmdexp.exe directly when you want more control over the build process than Visual Studio provides.

Expand Down
2 changes: 1 addition & 1 deletion docs/framework/whats-new/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -1861,7 +1861,7 @@ With Ngen PDBs, NGen can create a PDB that contains the IL-to-native mapping wit

New features and enhancements in the base classes in .NET Framework 4.5.1 include:

- Automatic binding redirection for assemblies. Starting with Visual Studio 2013, when you compile an app that targets the [!INCLUDE[net_v451](../../../includes/net-v451-md.md)], binding redirects may be added to the app configuration file if your app or its components reference multiple versions of the same assembly. You can also enable this feature for projects that target older versions of the .NET Framework. For more information, see [How to: Enable and Disable Automatic Binding Redirection](../configure-apps/how-to-enable-and-disable-automatic-binding-redirection.md).
- Automatic binding redirection for assemblies. Starting with Visual Studio 2013, when you compile an app that targets the .NET Framework 4.5.1, binding redirects may be added to the app configuration file if your app or its components reference multiple versions of the same assembly. You can also enable this feature for projects that target older versions of the .NET Framework. For more information, see [How to: Enable and Disable Automatic Binding Redirection](../configure-apps/how-to-enable-and-disable-automatic-binding-redirection.md).

- Ability to collect diagnostics information to help developers improve the performance of server and cloud applications. For more information, see the <xref:System.Diagnostics.Tracing.EventSource.WriteEventWithRelatedActivityId%2A> and <xref:System.Diagnostics.Tracing.EventSource.WriteEventWithRelatedActivityIdCore%2A> methods in the <xref:System.Diagnostics.Tracing.EventSource> class.

Expand Down
2 changes: 1 addition & 1 deletion docs/standard/garbage-collection/fundamentals.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ ms.author: "ronpet"

Because generation 2 collections can occupy multiple segments, objects that are promoted into generation 2 can be moved into an older segment. Both generation 1 and generation 2 survivors can be moved to a different segment, because they are promoted to generation 2.

Ordinarily, the large object heap is not compacted, because copying large objects imposes a performance penalty. However, starting with the [!INCLUDE[net_v451](../../../includes/net-v451-md.md)], you can use the <xref:System.Runtime.GCSettings.LargeObjectHeapCompactionMode%2A?displayProperty=nameWithType> property to compact the large object heap on demand.
Ordinarily, the large object heap is not compacted, because copying large objects imposes a performance penalty. However, starting with the .NET Framework 4.5.1, you can use the <xref:System.Runtime.GCSettings.LargeObjectHeapCompactionMode%2A?displayProperty=nameWithType> property to compact the large object heap on demand.

The garbage collector uses the following information to determine whether objects are live:

Expand Down