# XBAP applications that target .NET Framework 3.5 select the wrong runtime (v4 CLR) instead of v2.0 CLR ## Symptoms When a XAML Browser Application (XBAP) that targets .NET Framework 3.5 is launched, it is loaded in CLR v4 incorrectly instead of CLR v2.0, as expected. Along with the incorrect CLR, the .NET Framework libraries are also loaded from the latest version of .NET (.NET 4.x), and not .NET 3.5. Many XBAP applications launch and work normally under CLR v4, but some fail. The failure-mode is specific to the individual application and cannot be easily generalized. ## Resolution A fix will be released shortly for .NET Framework 4.7.2 on Windows 10 Spring Creators Update. .NET Framework 4.7.2 on all other OS platforms already has this fix. The fix for this issue must be enabled by customers who have problems running XBAP applications that target .NET Framework 3.5 under CLR v4. The fix can be enabled by setting the following registry keys:
Platform Architecture Registry Key Value Name Value Kind Value Description
32-bit HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\Windows Presentation Foundation\Hosting DoNotLaunchVersion3HostedApplicationInVersion4Runtime REG_DWORD 0, or value does not exist XBAP applications that target .NET Framework 3.5 or.NET Framework 4.x will be both launched under CLR v4
1, or any non-zero value XBAP applications that target .NET Framework 3.5 will be launched under CLR v2, and XBAP applications that target .NET Framework 4.x will be launched under CLR v4
64-bit Both of these keys should be set:

  • HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\.NETFramework\Windows Presentation Foundation\Hosting
  • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\Windows Presentation Foundation\Hosting
DoNotLaunchVersion3HostedApplicationInVersion4Runtime REG_DWORD 0, or value does not exist XBAP applications that target .NET Framework 3.5 or.NET Framework 4.x will be both launched under CLR v4
1, or any non-zero value XBAP applications that target .NET Framework 3.5 will be launched under CLR v2, and XBAP applications that target .NET Framework 4.x will be launched under CLR v4
## More information .NET Framework 4.6.2, .NET Framework 4.7, and .NET Framework 4.7.1 are also affected by this issue. A fix for these versions of .NET Frameworks will be released shortly.