> For the complete documentation index, see [llms.txt](https://www.osdeploy.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://www.osdeploy.com/archive/blog/2018/winpe-10-1809-wpf-dramarama.md).

# WinPE 10 1809 WPF DLL Fix

## Workaround: Replace UIAutomationCore.dll

One solution is to replace UIAutomationCore.dll with the one from WinPE 10 1803. While this workaround does get the ball moving, I cannot recommend making this change as there is no way to know what using an older version will break.

So let's see how this came about. [I think Nathan Ziehnert gets credit for finding the issue first. He then detailed the error message on his blog.](https://z-nerd.com/blog/2018/10/08-fix-wpf-in-1809-winpe/)

![https://z-nerd.com/blog/2018/10/08-fix-wpf-in-1809-winpe/](https://3996045416-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LDKRxGiKLYjW1gana2O%2F-LS0s4tpJS21niMi0Rvo%2F-LS0wcgXdAj3-m2_QkUT%2F2018-11-23_13-00-09.png?alt=media\&token=ce381aa1-c7ae-4124-9386-9f9a3a0f3008)

Mohammed Feroze Khan came up with the workaround on Twitter

{% embed url="<https://twitter.com/ferozekhan267oa/status/1049168421198483456>" %}

And the rest is history.

## System.DllNotFoundException

A closer look at Nathan's error shows that there was a DLL not found.

> **System.DllNotFoundException**: Unable to load DLL ‘UIAutomationCore.dll’: The specified module could not be found. (Exception from HRESULT: 0x8007007E)

A quick read would suggest that this is a problem with UIAutomationCore.dll ... but this is not entirely accurate. **UIAutomationCore.dll threw the exception because it could not find a required DLL**

## WinPE Process Monitor

I ran a side by side test of WinPE from the ADK and WinPE from a Windows 10 1809 Boot.wim and added NetFX, PowerShell, ProcMon64.exe, and a simple WPF test.

When executing my WPF test, I immediately notice that it is PowerShell that is crashing as it drops from a PowerShell Prompt to a Command Prompt.

![](https://3996045416-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LDKRxGiKLYjW1gana2O%2F-LS0zPBYwLRytLYmtKVr%2F-LS10o8cGYxjWzsZLQHa%2F2018-11-23_1-12-07.gif?alt=media\&token=1e1e9f07-49fc-487a-a744-bc8b4409deeb)

Since I have an App Crash, I get a Windows Error Report which shows the same **System.DllNotFoundException**

```
Version=1
EventType=PowerShell
EventTime=131874712000407901
ReportType=1
Consent=1
ReportStatus=2097154
ReportIdentifier=0fa42d51-809e-43b4-b7de-4561f6621150
Wow64Host=34404
OriginalFilename=PowerShell.EXE
AppSessionGuid=00000620-0001-0001-bb17-ff015a83d401
TargetAppId=W:0000da39a3ee5e6b4b0d3255bfef95601890afd80709!0000da39a3ee5e6b4b0d3255bfef95601890afd80709!powershell.exe
TargetAppVer=2074//02//28:17:48:58!70a4d!powershell.exe
BootId=4294967295
TargetAsId=43
IsFatal=4294967295
EtwNonCollectReason=4
Response.type=4
Sig[0].Name=NameOfExe
Sig[0].Value=powershell.exe
Sig[1].Name=FileVersionOfSystemManagementAutomation
Sig[1].Value=10.0.17763.134
Sig[2].Name=InnermostExceptionType
Sig[2].Value=System.DllNotFoundException
Sig[3].Name=OutermostExceptionType
Sig[3].Value=System.TypeInitializationException
Sig[4].Name=DeepestPowerShellFrame
Sig[4].Value=unknown
Sig[5].Name=DeepestFrame
Sig[5].Value=.Peers.AutomationPeer.RaiseFocusChangedEventHelper
Sig[6].Name=ThreadName
Sig[6].Value=Pipeli..ution Thread
```

WinPE exported from the Boot.wim does not crash. Process Monitor shows it using the DLL BCP47Langs.dll

![](https://3996045416-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LDKRxGiKLYjW1gana2O%2F-LS0zPBYwLRytLYmtKVr%2F-LS10YGOAc5F0Gh3IsXU%2F2018-11-23_12-08-49.png?alt=media\&token=67e23e62-0961-471f-9c67-bc0290f49d10)

But BCP47Langs.dll does not exist in the ADK WinPE.wim , which explains Dll Not Found crash. This is evident in the Process Monitor results.

![](https://3996045416-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LDKRxGiKLYjW1gana2O%2F-LS0zPBYwLRytLYmtKVr%2F-LS12DlUCBlWaUAJ_LsW%2F2018-11-23_12-08-55.png?alt=media\&token=66d8dfa9-eedf-4ae8-bf89-28d47dc582a0)

## System.DllNotFoundException = Missing BCP47\*.dll

Adding BCP47Langs.dll and BCP47mrm.dll to ADK WinPE makes everything work as expected. **This is the proper solution**

![](https://3996045416-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LDKRxGiKLYjW1gana2O%2F-LS0zPBYwLRytLYmtKVr%2F-LS137hnWt7d6NzJQ_Yf%2F2018-11-23_12-17-19.png?alt=media\&token=3a639111-756a-4619-a0a0-37b1734a3af2)

## Recommendations

Copy BCP47\*.dll from Windows\System32 of a Windows 10 x64 1809 and add them to your WinPE Extra Files to be copied to \<WinPE>:\Windows\System32 or add these files in Offline Servicing.

These files are already in the Boot.wim's WinPE, so that explains why it works. These files are NOT part of WinPE NetFX Package, or the Cumulative Update, so copying from a live OS is the only way to go for now.

Enjoy!

## Technical Notes

#### BPC47\*.dll Files

Files are located in the following locations on Windows 10 x64 1809

```
C:\Windows\System32
C:\Windows\WinSxS\amd64_microsoft-windows-bcp47languages_31bf3856ad364e35_10.0.17763.1_none_8b3037a62efd1f71
```

#### ADK WinPE.wim Packages

```
Microsoft-Windows-WinPE-LanguagePack-Package~31bf3856ad364e35~amd64~en-US~10.0.17763.1
Microsoft-Windows-WinPE-Package~31bf3856ad364e35~amd64~~10.0.17763.1  
```

#### Boot.wim WinPE Packages

```
Microsoft-Windows-WinPE-LanguagePack-Package~31bf3856ad364e35~amd64~en-US~10.0.17763.1
Microsoft-Windows-WinPE-Package~31bf3856ad364e35~amd64~~10.0.17763.1
WinPE-ATBroker-Package~31bf3856ad364e35~amd64~en-US~10.0.17763.1
WinPE-ATBroker-Package~31bf3856ad364e35~amd64~~10.0.17763.1
WinPE-AudioCore-Package~31bf3856ad364e35~amd64~en-US~10.0.17763.1
WinPE-AudioCore-Package~31bf3856ad364e35~amd64~~10.0.17763.1
WinPE-AudioDrivers-Package~31bf3856ad364e35~amd64~en-US~10.0.17763.1
WinPE-AudioDrivers-Package~31bf3856ad364e35~amd64~~10.0.17763.1
WinPE-EnhancedStorage-Package~31bf3856ad364e35~amd64~en-US~10.0.17763.1
WinPE-EnhancedStorage-Package~31bf3856ad364e35~amd64~~10.0.17763.1
WinPE-Narrator-Package~31bf3856ad364e35~amd64~en-US~10.0.17763.1
WinPE-Narrator-Package~31bf3856ad364e35~amd64~~10.0.17763.1
WinPE-SRH-Package~31bf3856ad364e35~amd64~en-US~10.0.17763.1
WinPE-SRH-Package~31bf3856ad364e35~amd64~~10.0.17763.1
WinPE-SRT-Package~31bf3856ad364e35~amd64~en-US~10.0.17763.1
WinPE-SRT-Package~31bf3856ad364e35~amd64~~10.0.17763.1
WinPE-Scripting-Package~31bf3856ad364e35~amd64~en-US~10.0.17763.1
WinPE-Scripting-Package~31bf3856ad364e35~amd64~~10.0.17763.1
WinPE-SecureStartup-Package~31bf3856ad364e35~amd64~en-US~10.0.17763.1
WinPE-SecureStartup-Package~31bf3856ad364e35~amd64~~10.0.17763.1
WinPE-Speech-TTS-Package~31bf3856ad364e35~amd64~en-US~10.0.17763.1
WinPE-Speech-TTS-Package~31bf3856ad364e35~amd64~~10.0.17763.1
WinPE-WDS-Tools-Package~31bf3856ad364e35~amd64~en-US~10.0.17763.1
WinPE-WDS-Tools-Package~31bf3856ad364e35~amd64~~10.0.17763.1
WinPE-WMI-Package~31bf3856ad364e35~amd64~en-US~10.0.17763.1
WinPE-WMI-Package~31bf3856ad364e35~amd64~~10.0.17763.1
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://www.osdeploy.com/archive/blog/2018/winpe-10-1809-wpf-dramarama.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
