Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change lookup path of binaries: wpf-debug.targets #10478

Merged
merged 3 commits into from
Feb 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Documentation/developer-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ Go to the csproj file and append this line at the bottom of it. `<Import Project
<Import Project="$(WpfRepoRoot)\eng\wpf-debug.targets" />
```

The default PlatformTarget of a sample application according the `wpf-debug.targets` is x64 and the default build of wpf repository using `./build.cmd` is x86. This leads to a mismatch in the binaries and may result in local binaries not getting picked up. To avoid this, either build the repo using the command `./build.cmd -plat x64` or specify the `PlatformTarget` of the sample application to x86.

When building the repository, the artifacts' packaging folder does not differentiate between x64 and x86 binaries, causing one build to override the other. To prevent this, clean the repository when switching between x64 and x86 builds using the command `.\build.cmd -clean`.


### Testing Locally built WPF assemblies (excluding PresentationBuildTasks)
This section of guide is intended to discuss the different approaches for ad-hoc testing of WPF assemblies,
Expand Down
8 changes: 6 additions & 2 deletions eng/wpf-debug.targets
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,13 @@
<RuntimeIdentifier Condition="'$(PlatformTarget)' != ''">win-$(PlatformTarget)</RuntimeIdentifier>

<WpfArtifactsPackagesCommonPath>$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)\..\'))\artifacts\packaging</WpfArtifactsPackagesCommonPath>
<WpfPlatformTargetArtifactsDirectory Condition="'$(PlatformTarget)'=='x64'">x64\</WpfPlatformTargetArtifactsDirectory>
<WPFArtifactsPathSuffix Condition="'$(WpfConfig)'=='Debug'">.$(WpfConfig)</WPFArtifactsPathSuffix>
<WPFArtifactsPath>$(WpfArtifactsPackagesCommonPath)\$(WpfConfig)\$(WpfPlatformTargetArtifactsDirectory)Microsoft.DotNet.Wpf.GitHub$(WPFArtifactsPathSuffix)</WPFArtifactsPath>
<!--
Make sure that the build binaries match the platform target.
The default local build using ./build.cmd is x86 and if the platform target in the application is not specified, it takes x64 by default.
So if you are planning to use the default Platform target, consider building wpf using ./build.cmd -plat x64.
-->
<WPFArtifactsPath>$(WpfArtifactsPackagesCommonPath)\$(WpfConfig)\Microsoft.DotNet.Wpf.GitHub$(WPFArtifactsPathSuffix)</WPFArtifactsPath>
</PropertyGroup>

<ItemGroup>
Expand Down