## Icon.ToBitmap successfully converts icons with PNG frames into Bitmap objects ### Scope Minor ### Version Introduced 4.6 ### Source Analyzer Status Investigating ### Change Description Starting with the apps that target the .NET Framework 4.6, the method successfully converts icons with PNG frames into Bitmap objects. In apps that target the .NET Framework 4.5.2 and earlier versions, the method throws an exception if the Icon object has PNG frames. This change affects apps that are recompiled to target the .NET Framework 4.6 and that implement special handling for the that is thrown when an Icon object has PNG frames. When running under the .NET Framework 4.6, the conversion is successful, an is no longer thrown, and therefore the exception handler is no longer invoked. - [X] Quirked // Uses some mechanism to turn the feature on or off, usually using runtime targeting, AppContext or config files. Needs to be turned on automatically for some situations. - [ ] Build-time break // Causes a break if attempted to recompile ### Recommended Action If this behavior is undesirable, you can retain the previous behavior by adding the following element to the `` section of your app.config file: ```xml ``` If the app.config file already contains the `AppContextSwitchOverrides` element, the new value should be merged with the value attribute like this: ```xml ``` ### Affected APIs * `M:System.Drawing.Icon.ToBitmap` ### Category Windows Forms