'React Native run-windows error microsoft.ui.xaml.winmd not found
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]
Solution 1:[1]
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.
Solution 2:[2]
The solution for me was to open VS 2019 using the sln inside the /windows folder and rebuild the the project. After that the command "npx react-native run-windows" worked as expected
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | |
Solution 2 | Marco Fernandes |