WindowsAppSDK icon indicating copy to clipboard operation
WindowsAppSDK copied to clipboard

Build conflicts caused by standalone WebView2 and embedded WebView2 (in Windows App SDK)

Open DJRM2021 opened this issue 1 year ago • 4 comments

Describe the bug

Hi,

Can someone please help me on determining why I am having file conflict issues with WebView2.Core.dll? Below is my csproj file: <Project Sdk="Microsoft.NET.Sdk"> <PropertyGroup> <OutputType>WinExe</OutputType> <TargetFramework>net8.0-windows10.0.22621.0</TargetFramework> <TargetPlatformMinVersion>10.0.22621.0</TargetPlatformMinVersion> <RootNamespace>Schoolr</RootNamespace> <ApplicationManifest>app.manifest</ApplicationManifest> <Platforms>x86;x64;ARM64</Platforms> <RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers> <PublishProfile>win10-$(Platform).pubxml</PublishProfile> <UseWinUI>true</UseWinUI> <EnableMsixTooling>true</EnableMsixTooling> <SupportedOSPlatformVersion>10.0.22621.0</SupportedOSPlatformVersion> <AllowUnsafeBlocks>true</AllowUnsafeBlocks> **<WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained>** <ImplicitUsings>enable</ImplicitUsings> </PropertyGroup> <ItemGroup> <PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.2" /> <PackageReference Include="CommunityToolkit.WinUI.Controls.CameraPreview" Version="8.0.240109" /> <PackageReference Include="CommunityToolkit.WinUI.Controls.Sizers" Version="8.0.240109" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="9.0.0-preview.1.24081.2"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> </PackageReference> <PackageReference Include="Microsoft.EntityFrameworkCore.SqlServer" Version="9.0.0-preview.1.24081.2" /> <PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="9.0.0-preview.1.24081.2"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> </PackageReference> <PackageReference Include="Microsoft.Windows.CsWin32" Version="0.3.49-beta"> <PrivateAssets>all</PrivateAssets> <!--<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>--> </PackageReference> <PackageReference Include="Microsoft.WindowsAppSDK" Version="1.5.240227000" /> <PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.26031-preview" /> <Manifest Include="$(ApplicationManifest)" /> </ItemGroup> image

Steps to reproduce the bug

  1. Create a new project using: image
  2. Modify the csproj file. Add <WindowsAppSDKSelfContained>true</WindowsAppSDKSelfContained>
  3. Modify the project to use .Net 8. Make sure to fix the RIDs.
  4. Update Windows App SDK and Build Tools in NPM.
  5. Install EF Core nuget references: image

Expected behavior

No response

Screenshots

No response

NuGet package version

Windows App SDK 1.5.0: 1.5.240227000

Packaging type

Packaged (MSIX)

Windows version

Windows 11 version 22H2 (22621, 2022 Update)

IDE

Visual Studio 2022

Additional context

No response

DJRM2021 avatar Mar 03 '24 23:03 DJRM2021

@DJRM2021 This is a known incompatibility between EntityFramework and WindowsAppSDK, both of which publish WebView2.Core.dll. There are several workarounds discussed here: https://github.com/microsoft/WindowsAppSDK/issues/1856

Scottj1s avatar Mar 06 '24 00:03 Scottj1s

Maybe we could make a configuration or option in the MSIX tooling to not include WebView2 if the app will not even use it?

DJRM2021 avatar Mar 07 '24 13:03 DJRM2021

Resolving this as a dup of #1856

bpulliam avatar Mar 14 '24 17:03 bpulliam

Reopening, this for tracking WebView2 nuget reference factoring work. Retitled for clarity.

Scottj1s avatar Mar 19 '24 12:03 Scottj1s

The primary issue tracking this is #https://github.com/microsoft/microsoft-ui-xaml/issues/5689 - closing as duplicate. Also, happy to report it is fixed in 1.6.240701003-experimental2.

DmitriyKomin avatar Jul 03 '24 17:07 DmitriyKomin