dotnet / wpf

WPF is a .NET Core UI framework for building Windows desktop applications.
MIT License
7.06k stars 1.17k forks source link

How to include/copy Framework dependencies to build. #9992

Open ronak-k-p opened 4 hours ago

ronak-k-p commented 4 hours ago

Referring to issue logged here : https://github.com/dotnet/wpf/issues/7751

I want to include/copy Accessibility.dll to my build folder. I tried several option from MSBuild properties resulting few of the path value being hardcoded. Runtime its referring from

C:/Program Files/dotnet/packs/Microsoft.WindowsDesktop.App.Ref/8.0.8/ref/net8.0/Accessibility.dll

How can change csproj settings so it will copy this dll to build.

I already tried

$(NetCoreRoot)/packs/Microsoft.WindowsDesktop.App.Ref/8.0.8/ref/net8.0/Accessibility.dll (8.0.8 & net8.0 is hardcoded)

h3xds1nz commented 3 hours ago

@ronak-k-p If you just wanna copy the arbitrary file that should be loaded afterwards, this should do it in your csproj:

<ItemGroup>
  <Reference Include="somepath-or-variable\PresentationCore.dll">
      <Private>True</Private>
  </Reference>
</ItemGroup>

If I misunderstood what you're asking about, I'm sorry.