Fix unit tests native dependencies #10338
Merged
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.
This is a workaround for dotnet/runtime#111825
Description
Fixes errors in unit tests when trying to load wpfgfx_cor3.dll which depends on D3DCompiler_47_cor3.dll which can't be found at runtime which seems to be caused by a bug in the runtime when using
DllImportSearchPath.AssemblyDirectory | DllImportSearchPath.System32
as the search path.This search path is the default search path used by all projects in this repo and it's configured here:
wpf/eng/WpfArcadeSdk/tools/ExtendedAssemblyInfo.props
Lines 16 to 20 in 81019fc
We can't just set
IncludeDllSafeSearchPathAttribute
to false in the test projects since the attribute is used to configure the search path used by default for each assembly. We would need to set it to false for all assemblies trying to load wpfgfx_cor3.dll.This problem does not occur for apps using WPF, see the issue for more info
Customer Impact
None, test only.
Regression
No.
Testing
Local build + CI + local test.
Risk
None, test only.
Microsoft Reviewers: Open in CodeFlow