Updates ReactNativeWindowsDir prop in vcxproj to support symlinks properly #2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
If a RNW application set up in a monorepo and its dependencies are symlinked into application's node_modules folder,
MSBuildThisFileDirectory
will point to the original directory of symlynked react-native-windows.However, when the application (and RNW in the node_modules folder) is built, the artifacts somehow not being copied to the original folder and staying only in the symlinked directory, which breaks the build (Visual Studio can't find Microsoft.ReactNative.winmd file), since MSBuildThisFileDirectory pointing to the original directory.
I think this has something to do with how symlinks work on Windows. Anyway, changing MSBuildThisFileDirectory to SolutionDir fixes this, and ReactNativeWindowsDir is poiting to the symlink location, and not the original directory.
My colleagues and I already made a few contributions adding this fix to other projects, such as react-native-device-infp PR #1279, so hopefully we can have the same fix for this fork of react-native-splash-screen, which will eventually get into the original repository.