midlrt : error MIDL1001: [msg]cannot open input file [context]Error opening or processing WinMD d:\Desktop\projects\plenusbusiness\windows\packages\microsoft.ui.xaml.2.3.191129002\lib\uap10.0\microsoft.ui.xaml.winm d. HRESULT 0x80070003. [D:\Desktop\projects\Example\node_modules\react-native-windows\Microsoft.ReactNative\Microsoft.ReactNative.vcxproj] D:\Desktop\projects\Example\node_modules\react-native-windows\ReactUWP\Views\cppwinrt\AccessibilityAction.idl(1): error MIDL5157: [msg]An invalid winmd file was specified for import [context]: D:\Desktop\projects\Example\windows\packages\Microsoft.UI.Xaml.2.3.191129002\lib\uap10.0\Microsoft.UI.Xaml.winmd [D:\Desktop\projects\Example\node_modules\react-native-windows\Microsoft.ReactNative\Microsof t.ReactNative.vcxproj]
You should be able to fix the error by removing any spaces and special characters from your project's path and I think after this you have to use npm install again before building the project. This solution worked for me.
npx react-native run-windows
to start/build a React Native Windows project. I get a similar error.× Build failed with message 5>midlrt : error MIDL1001: [msg]cannot open input file [context]Error opening or processing WinMD c:\my project\windows\packages\microsoft.ui.xaml.2.3.191129002\lib\uap10.0\microsoft.ui.xaml.winmd. HRESULT 0x80070003. [C:\my project\node_modules\react-native-windows\Microsoft.ReactNative\Microsoft.ReactNative.vcxproj]. Check your build configuration.
– user10981072 Oct 4 '20 at 15:02