Description
What happened?
This is related to issue #4749 but I'm posting a new issue since this is a bit different.
The problem is this:
As in the previous issue the concern is that transient dependencies are getting lost. What's different now is that I'm seeing the problem with multi-nested dependencies forcing to explicitly add references to the WebView control to child dependencies.
Here's the scenario I have:
- A component library that references WebView WPF control - latest SDK reference
- A top level application that references the above library (Works! - it sees WebView references)
- Several addins that have project references to the Top level application (Doesnt work - WebView2 can't resolve)
In order to get this to work I now have to:
- Explicitly add a WebView reference to every one of my Addin projects that uses it
Ok that wouldn't be so bad except:
- I have quite a few addin projects
- Each project ends up with the binaries and runtime native folders
#1 is a hassle as each project now has to be updated with each WebView release. Part of the reason for creating the Westwind.WebView library for me is that it consolidates a single reference to the WebView.
#2 is worse - if I add explicit reference it generates all the compilation artifacts that aren't needed because the main binary already has it. It seems like the various MS Build exclude and build directives meant to restrict output files do not work due to the funky MS Build settings used for the WebView SDK library.
Worst of all this used to work up until 1.0.2600 series. Somewhere in there the change was thrown in and the
1.0.2600 releases no longer work as the old versions did.
Addin Project Setup (project where references don't pass to)
For reference here's how my addin projects reference the top level application:
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Version>3.4</Version>
<TargetFramework>net9.0-windows</TargetFramework>
<UseWPF>true</UseWPF>
<!-- force into addin folder explicitly. don't copy assemblies referenced by parent project -->
<OutDir>$(SolutionDir)MarkdownMonster/bin/$(Configuration)/$(TargetFramework)/Addins/OpenAi</OutDir>
<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>
<!-- Inside of an add - referencing parent application project which refs WebView class library
This project has a reference to Westwind.WebView which in turn as reference to Micrsoft.WebView2.Wpf
* Westwind.WebView
* MarkdownMonster - works here
* OpenAIAddin - WebView not found
-->
<ItemGroup>
<ProjectReference Include="../../MarkdownMonster/MarkdownMonster.csproj">
<Private>false</Private>
<IncludeAssets>compile</IncludeAssets>
</ProjectReference>
</ItemGroup>
Expected
Behavior like all other assemblies that pass through dependencies from any downstream library to the top level application and all addins. It works for all other dependencies,, but not for the WebView DLLS.
Markdown Monster v3.5.0.16
x64 • .NET 9.0.0-rc.2.24473.5
Microsoft Windows 10.0.22631
WebView Runtime:1.0.2849.39
WebView Sdk: 1.0.2849.39
Importance
Important. My app's user experience is significantly compromised.
Runtime Channel
Stable release (WebView2 Runtime)
Runtime Version
1.0.2849.39
SDK Version
1.0.2849.39
Framework
WPF
Operating System
Windows 11
OS Version
10.0.22631
Repro steps
..
Repros in Edge Browser
No, issue does not reproduce in the corresponding Edge version
Regression
Regression in newer SDK
Last working version (if regression)
1.0.2592.51