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

[Problem/Bug]: The excess projection.dll is copied to the output directory #4795

Open
Gaoyifei1011 opened this issue Sep 6, 2024 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@Gaoyifei1011
Copy link

Gaoyifei1011 commented Sep 6, 2024

What happened?

The excess projection.dll is copied to the output directory
多余的 projection.dll 被复制到输出目录

When I upgraded to the local Microsoft.web.WebView2 package provided by you and packaged the application in Native AOT mode, I found that output directory of the emergence of a repeat. Microsoft.Web.WebView2.Core.Projection.Dll file
当我升级到你们提供的本地 Microsoft.Web.WebView2 包,并以 Native AOT 方式打包应用后发现,输出目录意外的出现了一个重复的 Microsoft.Web.WebView2.Core.Projection.dll 文件

Importance

Low. My app is not very affected, or this only affects development.

Runtime Channel

Stable release (WebView2 Runtime), Prerelease (Edge Canary/Dev/Beta)

Runtime Version

stable version

SDK Version

1.0.2817-prerelease

Framework

WinUI2/UWP

Operating ### System

Windows 11

OS Version

26100

Repro steps

see describe

Repros in Edge Browser

No, issue does not reproduce in the corresponding Edge version

Regression

No, this never worked

Last working version (if regression)

364638178-64799efe-f6eb-48d0-af8a-fc29252acee2

@Gaoyifei1011 Gaoyifei1011 added the bug Something isn't working label Sep 6, 2024
@oggy22
Copy link
Member

oggy22 commented Sep 11, 2024

Thank you for reporting it @Gaoyifei1011 . Can you please double check that when you delete Microsoft.Web.WebView2.Core.Projection.Dll your app still works fine? In other words let's make sure that the file is not needed for sure.

Also, if the file happens to be not needed as you suspect, can you please provde your csproj file, possibly min-repro version would be great! I would also like to know how you create your MSIX file?

@Gaoyifei1011
Copy link
Author

Gaoyifei1011 commented Sep 12, 2024

Thank you for reporting it @Gaoyifei1011 . Can you please double check that when you delete Microsoft.Web.WebView2.Core.Projection.Dll your app still works fine? In other words let's make sure that the file is not needed for sure.

Also, if the file happens to be not needed as you suspect, can you please provde your csproj file, possibly min-repro version would be great! I would also like to know how you create your MSIX file?

After I force the removal of Microsoft.Web.WebView2.Core.Projection.Dll in Wapproj, the application works fine. After all, Native AOT compiles applications to machine code and doesn't rely on any managed assemblies.
当我强制在 Wapproj 中移除 Microsoft.Web.WebView2.Core.Projection.Dll 后,应用程序正常工作。毕竟 Native AOT 是将应用编译为机器码,不依赖任何托管程序集。

<!--
    Workaround for bug https://devdiv.visualstudio.com/DevDiv/_workitems/edit/1149545

    The appx packaging tasks default to including the .xr.xml file (which is for using reflection in .NET Native) when consuming nuget packages. Since
    we aren't using .NET Native, we don't need these anymore.
  -->
  <Target Name="_RemoveFilesFromPayload" AfterTargets="_CalculateInputsForGenerateAppxPackageRecipe" Condition="'$(MSBuildProjectExtension)' == '.wapproj' and '$(_IsGeneratingAppxPackage)' == 'true'">
    <ItemGroup>
      <AppxPackagePayload Remove="@(AppxPackagePayload)" Condition="'%(FileName)%(Extension)'=='Microsoft.Web.WebView2.Core.Projection.dll'" />
      <AppxPackagePayload Remove="@(AppxPackagePayload)" Condition="$([System.String]::new('%(Identity)').EndsWith('.xr.xml'))" />
    </ItemGroup>
  </Target>

wapproj removes code for the Microsoft.Web.WebView2.Core.Projection.Dll assembly
wapproj 移除 Microsoft.Web.WebView2.Core.Projection.Dll 程序集的代码

GetStoreApp.CsProj project file
GetStoreApp.CsProj 项目文件

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
    <AnalysisLevel>latest</AnalysisLevel>
    <AssemblyName>GetStoreApp</AssemblyName>
    <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
    <CsWinRTEnableDynamicObjectsSupport>false</CsWinRTEnableDynamicObjectsSupport>
    <DebugType>portable</DebugType>
    <DefineConstants>DISABLE_XAML_GENERATED_MAIN</DefineConstants>
    <Deterministic>true</Deterministic>
    <DesktopCompatible>true</DesktopCompatible>
    <DisableXbfLineInfo>false</DisableXbfLineInfo>
    <EnableMsixTooling>false</EnableMsixTooling>
    <FileAlignment>512</FileAlignment>
    <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
    <ImplicitUsings>disable</ImplicitUsings>
    <IncludeAllContentForSelfExtract>false</IncludeAllContentForSelfExtract>
    <IncludeSymbols>false</IncludeSymbols>
    <IsAotCompatible>true</IsAotCompatible>
    <LangVersion>preview</LangVersion>
    <OptimizationPreference>Size</OptimizationPreference>
    <Optimize>false</Optimize>
    <OutputType>WinExe</OutputType>
    <Platforms>x86;x64;ARM64</Platforms>
    <PublishAot>true</PublishAot>
    <PublishProtocol>FileSystem</PublishProtocol>
    <PublishReadyToRun>false</PublishReadyToRun>
    <PublishSelfContained>true</PublishSelfContained>
    <PublishSingleFile>true</PublishSingleFile>
    <RestoreProjectStyle>PackageReference</RestoreProjectStyle>
    <RootNamespace>GetStoreApp</RootNamespace>
    <RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>
    <StartupObject>GetStoreApp.Program</StartupObject>
    <TargetFramework>net9.0-windows10.0.26100.0</TargetFramework>
    <TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
    <TrimmerRemoveSymbols>true</TrimmerRemoveSymbols>
    <UseRidGraph>true</UseRidGraph>
    <WebView2NeverCopyLoaderDllToOutputDirectory>true</WebView2NeverCopyLoaderDllToOutputDirectory>
    <Win32Resource>GetStoreApp.res</Win32Resource>
    <WindowsAppSDKDeploymentManagerInitialize>false</WindowsAppSDKDeploymentManagerInitialize>
    <WindowsAppSDKSelfContained>false</WindowsAppSDKSelfContained>
    <WindowsAppSDKSingleFileVerifyConfiguration>false</WindowsAppSDKSingleFileVerifyConfiguration>
    <WindowsPackageType>MSIX</WindowsPackageType>
    <WindowsSdkPackageVersion>10.0.26100.45</WindowsSdkPackageVersion>
  </PropertyGroup>

  <PropertyGroup Condition="'$(Platform)'=='x86'">
    <RuntimeIdentifier>win-x86</RuntimeIdentifier>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Platform)'=='x64'">
    <RuntimeIdentifier>win-x64</RuntimeIdentifier>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Platform)'=='ARM64'">
    <RuntimeIdentifier>win-arm64</RuntimeIdentifier>
  </PropertyGroup>

  <ItemGroup>
    <ApplicationDefinition Include="WinUIApp.xaml" SubType="Designer" />

    <Content Remove="Assets\GetStoreApp.ico" />
    <Content Remove="EmbedAssets\cookie.xml" />
    <Content Remove="EmbedAssets\Lengths.bin" />
    <Content Remove="EmbedAssets\LICENSE" />
    <Content Remove="EmbedAssets\url.xml" />
    <Content Remove="EmbedAssets\wu.xml" />

    <Manifest Include="$(ApplicationManifest)" />

    <MyEmbeddedItems Include="EmbedAssets\cookie.xml" />
    <MyEmbeddedItems Include="EmbedAssets\Lengths.bin" />
    <MyEmbeddedItems Include="EmbedAssets\LICENSE" />
    <MyEmbeddedItems Include="EmbedAssets\url.xml" />
    <MyEmbeddedItems Include="EmbedAssets\wu.xml" />

    <None Remove="Assets\LICENSE" />
    <None Remove="Styles\WinUI\AppbarButton.xaml" />
    <None Remove="Styles\WinUI\HyperlinkButton.xaml" />
    <None Remove="Styles\WinUI\InfoBar.xaml" />
    <None Remove="Styles\WinUI\MenuFlyout.xaml" />
    <None Remove="UI\Controls\Download\CompletedControl.xaml" />
    <None Remove="UI\Controls\Store\QueryLinksControl.xaml" />
    <None Remove="UI\Controls\Store\SearchStoreControl.xaml" />
    <None Remove="UI\Controls\WinGet\InstalledAppsControl.xaml" />
    <None Remove="UI\Controls\WinGet\SearchAppsControl.xaml" />
    <None Remove="UI\Controls\WinGet\UpgradableAppsControl.xaml" />
    <None Remove="UI\Dialogs\About\AppInformationDialog.xaml" />
    <None Remove="UI\Dialogs\About\ConsoleStartupArgsDialog.xaml" />
    <None Remove="UI\Dialogs\About\DesktopStartupArgsDialog.xaml" />
    <None Remove="UI\Dialogs\About\LicenseDialog.xaml" />
    <None Remove="UI\Dialogs\Common\AppRunningDialog.xaml" />
    <None Remove="UI\Dialogs\Common\ClosingWindowDialog.xaml" />
    <None Remove="UI\Dialogs\Common\DeletePromptDialog.xaml" />
    <None Remove="UI\Dialogs\Common\DownloadNotifyDialog.xaml" />
    <None Remove="UI\Dialogs\Common\SelectEmptyPromptDialog.xaml" />
    <None Remove="UI\Dialogs\Download\FileInformationDialog.xaml" />
    <None Remove="UI\Dialogs\Download\InstallingNotifyDialog.xaml" />
    <None Remove="UI\Dialogs\Settings\RestartAppsDialog.xaml" />
    <None Remove="UI\Dialogs\Settings\TraceCleanupPromptDialog.xaml" />
    <None Remove="UI\Dialogs\WinGet\RebootDialog.xaml" />
    <None Remove="UI\TeachingTips\DataCopyTip.xaml" />
    <None Remove="UI\TeachingTips\QuickOperationTip.xaml" />
    <None Remove="Views\Pages\AboutPage.xaml" />
    <None Remove="Views\Pages\AppManagerPage.xaml" />
    <None Remove="Views\Pages\AppUpdatePage.xaml" />
    <None Remove="Views\Pages\DownloadPage.xaml" />
    <None Remove="Views\Pages\SettingsPage.xaml" />
    <None Remove="Views\Pages\StorePage.xaml" />
    <None Remove="Views\Pages\WinGetPage.xaml" />
    <None Remove="Views\Windows\MainWindow.xaml" />
    <None Remove="WinUIApp.xaml" />
    
    <PackageReference Include="Microsoft.Web.WebView2" Version="1.0.2817-prerelease" />
    <PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.1.3" />
    <PackageReference Include="Microsoft.WindowsAppSDK" Version="1.6.240829007" />

    <Page Update="Styles\WinUI\AppBarButton.xaml" XamlRuntime="$(DefaultXamlRuntime)" />
    <Page Update="Styles\WinUI\HyperlinkButton.xaml" XamlRuntime="$(DefaultXamlRuntime)" />
    <Page Update="Styles\WinUI\InfoBar.xaml" XamlRuntime="$(DefaultXamlRuntime)" />
    <Page Update="Styles\WinUI\MenuFlyout.xaml" XamlRuntime="$(DefaultXamlRuntime)" />
    <Page Update="UI\Controls\Download\CompletedControl.xaml" XamlRuntime="$(DefaultXamlRuntime)" />
    <Page Update="UI\Controls\WinGet\InstalledAppsControl.xaml" XamlRuntime="$(DefaultXamlRuntime)" />
    <Page Update="UI\Controls\WinGet\SearchAppsControl.xaml" XamlRuntime="$(DefaultXamlRuntime)" />
    <Page Update="UI\Controls\WinGet\UpgradableAppsControl.xaml" XamlRuntime="$(DefaultXamlRuntime)" />
    <Page Update="UI\Controls\Store\QueryLinksControl.xaml" XamlRuntime="$(DefaultXamlRuntime)" />
    <Page Update="UI\Controls\Store\SearchStoreControl.xaml" XamlRuntime="$(DefaultXamlRuntime)" />
    <Page Update="UI\Dialogs\About\AppInformationDialog.xaml" XamlRuntime="$(DefaultXamlRuntime)" />
    <Page Update="UI\Dialogs\About\ConsoleStartupArgsDialog.xaml" XamlRuntime="$(DefaultXamlRuntime)" />
    <Page Update="UI\Dialogs\About\DesktopStartupArgsDialog.xaml" XamlRuntime="$(DefaultXamlRuntime)" />
    <Page Update="UI\Dialogs\About\LicenseDialog.xaml" XamlRuntime="$(DefaultXamlRuntime)" />
    <Page Update="UI\Dialogs\Common\AppRunningDialog.xaml" XamlRuntime="$(DefaultXamlRuntime)" />
    <Page Update="UI\Dialogs\Common\ClosingWindowDialog.xaml" XamlRuntime="$(DefaultXamlRuntime)" />
    <Page Update="UI\Dialogs\Common\DeletePromptDialog.xaml" XamlRuntime="$(DefaultXamlRuntime)" />
    <Page Update="UI\Dialogs\Common\DownloadNotifyDialog.xaml" XamlRuntime="$(DefaultXamlRuntime)" />
    <Page Update="UI\Dialogs\Common\SelectEmptyPromptDialog.xaml" XamlRuntime="$(DefaultXamlRuntime)" />
    <Page Update="UI\Dialogs\Download\FileInformationDialog.xaml" XamlRuntime="$(DefaultXamlRuntime)" />
    <Page Update="UI\Dialogs\Download\InstallingNotifyDialog.xaml" XamlRuntime="$(DefaultXamlRuntime)" />
    <Page Update="UI\Dialogs\Settings\RestartAppsDialog.xaml" XamlRuntime="$(DefaultXamlRuntime)" />
    <Page Update="UI\Dialogs\Settings\TraceCleanupPromptDialog.xaml" XamlRuntime="$(DefaultXamlRuntime)" />
    <Page Update="UI\Dialogs\WinGet\RebootDialog.xaml" XamlRuntime="$(DefaultXamlRuntime)" />
    <Page Update="UI\TeachingTips\DataCopyTip.xaml" XamlRuntime="$(DefaultXamlRuntime)" />
    <Page Update="UI\TeachingTips\OperationResultTip.xaml" XamlRuntime="$(DefaultXamlRuntime)" />
    <Page Update="UI\TeachingTips\QuickOperationTip.xaml" XamlRuntime="$(DefaultXamlRuntime)" />
    <Page Update="Views\Pages\AboutPage.xaml" />
    <Page Update="Views\Pages\AppManagerPage.xaml" XamlRuntime="$(DefaultXamlRuntime)" />
    <Page Update="Views\Pages\AppUpdatePage.xaml" XamlRuntime="$(DefaultXamlRuntime)" />
    <Page Update="Views\Pages\DownloadPage.xaml" XamlRuntime="$(DefaultXamlRuntime)" />
    <Page Update="Views\Pages\SettingsPage.xaml" XamlRuntime="$(DefaultXamlRuntime)" />
    <Page Update="Views\Pages\StorePage.xaml" XamlRuntime="$(DefaultXamlRuntime)" />
    <Page Update="Views\Pages\WinGetPage.xaml" XamlRuntime="$(DefaultXamlRuntime)" />
    <Page Update="Views\Windows\MainWindow.xaml" XamlRuntime="$(DefaultXamlRuntime)" />
    <Page Remove="WinUIApp.xaml" />

    <ProjectReference Include="..\Microsoft.Management.Deployment.Projection\Microsoft.Management.Deployment.Projection.csproj" />
  </ItemGroup>

  <!-- 在 Debug 调试模式下测试 AOT 发布后的文件 -->
  <Target Name="AutoPublish" AfterTargets="AfterBuild" Condition="$(Configuration) == 'Debug'">
    <MSBuild Projects="$(MSBuildProjectFullPath)" Targets="Publish" />
    <Copy SourceFiles="$(NativeOutputPath)$(AssemblyName).exe" DestinationFiles="$(ProjectDir)obj\$(Platform)\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\apphost.exe" />
  </Target>
  

  <!-- 捆绑前对二进制文件进行后处理 -->
  <!-- 该任务会在 Debug 以 AOT 发布时触发,故限制在 Release 模式下进行操作 -->
  <Target Name="DigitialSignGeneratedExeFile" AfterTargets="GenerateSingleFileBundle" DependsOnTargets="PrepareForBundle" Condition="$(Configuration) == 'Release'">
    <!-- 对生成的 GetStoreApp.exe 文件进行数字签名 -->  
    <Exec Command="$(SolutionDir)signtool.exe sign /f $(SolutionDir)GetStoreAppPackage\GetStoreAppPackage_SignKey.pfx /t http://timestamp.digicert.com /fd SHA256 $(NativeOutputPath)$(AssemblyName).exe" />
  </Target>

  <!-- 不要复制本机引导文件 -->
  <Target Name="_RemoveWasdkBootstrapDll" BeforeTargets="ResolveReferences">
    <ItemGroup>
      <ReferenceCopyLocalPaths Remove="@(ReferenceCopyLocalPaths)" Condition="'%(Filename)%(Extension)' == 'Microsoft.WindowsAppRuntime.Bootstrap.dll'" />
    </ItemGroup>
  </Target>

  <!-- 将需要的文件嵌入到包资源索引文件(Pri)中 -->
  <Target Name="AddMyEmbeddedItems" BeforeTargets="_GenerateProjectPriFileCore" AfterTargets="_CalculateInputsForGenerateProjectPriFileCore">
    <Copy SourceFiles="@(MyEmbeddedItems)" DestinationFiles="@(MyEmbeddedItems->'$(IntermediateOutputPath)embed\EmbedAssets\%(RecursiveDir)%(Filename)%(Extension)')" SkipUnchangedFiles="true" />
    <ReadLinesFromFile File="$(_EmbedFileResfilePath)">
      <Output TaskParameter="Lines" ItemName="ItemsFromFile" />
    </ReadLinesFromFile>
    <ItemGroup>
      <MyEmbeddedFileList Include="@(ItemsFromFile)" />
      <MyEmbeddedFileList Include="@(MyEmbeddedItems)" />
    </ItemGroup>
    <WriteLinesToFile File="$(_EmbedFileResfilePath)" Lines="@(MyEmbeddedFileList)" Overwrite="true" Encoding="Unicode" />
  </Target>
</Project>

Gert Storebweieb.Csproj project file
GetStoreAppWebView.Csproj 项目文件

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
    <AnalysisLevel>latest</AnalysisLevel>
    <AssemblyName>GetStoreAppWebView</AssemblyName>
    <CheckForOverflowUnderflow>false</CheckForOverflowUnderflow>
    <CsWinRTEnableDynamicObjectsSupport>false</CsWinRTEnableDynamicObjectsSupport>
    <DebugType>portable</DebugType>
    <DefaultXamlRuntime>UAP</DefaultXamlRuntime>
    <DefineConstants>DISABLE_XAML_GENERATED_MAIN</DefineConstants>
    <Deterministic>true</Deterministic>
    <DesktopCompatible>true</DesktopCompatible>
    <DisableXbfLineInfo>false</DisableXbfLineInfo>
    <FileAlignment>512</FileAlignment>
    <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
    <ImplicitUsings>disable</ImplicitUsings>
    <IncludeAllContentForSelfExtract>false</IncludeAllContentForSelfExtract>
    <IncludeSymbols>false</IncludeSymbols>
    <IsAotCompatible>true</IsAotCompatible>
    <LangVersion>latest</LangVersion>
    <OptimizationPreference>Size</OptimizationPreference>
    <Optimize>false</Optimize>
    <OutputType>WinExe</OutputType>
    <Platforms>x86;x64;ARM64</Platforms>
    <PublishAot>true</PublishAot>
    <PublishProtocol>FileSystem</PublishProtocol>
    <PublishReadyToRun>false</PublishReadyToRun>
    <PublishSelfContained>true</PublishSelfContained>
    <PublishSingleFile>true</PublishSingleFile>
    <RestoreProjectStyle>PackageReference</RestoreProjectStyle>
    <RootNamespace>GetStoreAppWebView</RootNamespace>
    <RuntimeIdentifiers>win-x86;win-x64;win-arm64</RuntimeIdentifiers>
    <StartupObject>GetStoreAppWebView.Program</StartupObject>
    <TargetFramework>net9.0-windows10.0.26100.0</TargetFramework>
    <TargetPlatformMinVersion>10.0.19041.0</TargetPlatformMinVersion>
    <TrimmerRemoveSymbols>true</TrimmerRemoveSymbols>
    <UseRidGraph>true</UseRidGraph>
    <UseUwpTools>true</UseUwpTools>
    <WebView2EnableCsWinRTProjection>true</WebView2EnableCsWinRTProjection>
    <Win32Resource>GetStoreAppWebView.res</Win32Resource>
    <WindowsSdkPackageVersion>10.0.26100.45</WindowsSdkPackageVersion>
  </PropertyGroup>

  <PropertyGroup Condition="'$(Platform)'=='x86'">
    <RuntimeIdentifier>win-x86</RuntimeIdentifier>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Platform)'=='x64'">
    <RuntimeIdentifier>win-x64</RuntimeIdentifier>
  </PropertyGroup>
  <PropertyGroup Condition="'$(Platform)'=='ARM64'">
    <RuntimeIdentifier>win-arm64</RuntimeIdentifier>
  </PropertyGroup>

  <ItemGroup>    
    <Content Remove="Assets\GetStoreAppWebView.ico" />

    <!-- Temporary workaround, remove when https://github.com/dotnet/sdk/pull/41936 is available in the .NET SDK -->
    <CompilerVisibleProperty Include="CsWinRTUseWindowsUIXamlProjections" />
    <RuntimeHostConfigurationOption Include="CSWINRT_USE_WINDOWS_UI_XAML_PROJECTIONS" Value="$(CsWinRTUseWindowsUIXamlProjections)" Trim="true" />

    <Manifest Include="$(ApplicationManifest)" />

    <None Remove="Dialogs\ProcessFailedDialog.xaml" />
    <None Remove="Pages\MainPage.xaml" />
    <None Remove="Pages\TaskbarPinPage.xaml" />
    <None Remove="Styles\UWP\AcrylicBrush.xaml" />
    <None Remove="Styles\UWP\AppbarButton.xaml" />
    <None Remove="Styles\UWP\Button.xaml" />
    <None Remove="Styles\UWP\Common.xaml" />
    <None Remove="Styles\UWP\ContentDialog.xaml" />
    <None Remove="Styles\UWP\CornerRadius.xaml" />
    <None Remove="Styles\UWP\Hyperlink.xaml" />
    <None Remove="Styles\UWP\MenuFlyout.xaml" />
    <None Remove="Styles\UWP\ScrollBar.xaml" />
    <None Remove="Styles\UWP\ScrollViewer.xaml" />
    <None Remove="Styles\UWP\TextBlock.xaml" />

    <PackageReference Include="DisposableMemory.ModernNetUAP.XamlCompiler" Version="0.2.2" />

    <PackageReference Include="Microsoft.Web.WebView2" Version="1.0.2817-prerelease" />
    <PackageReference Include="Microsoft.Windows.CsWinRT" Version="2.1.3" />

    <Page Update="Dialogs\ProcessFailedDialog.xaml" XamlRuntime="$(DefaultXamlRuntime)" />
    <Page Update="Pages\MainPage.xaml" XamlRuntime="$(DefaultXamlRuntime)" />
    <Page Update="Pages\TaskbarPinPage.xaml" XamlRuntime="$(DefaultXamlRuntime)" />
    <Page Update="Styles\UWP\AcrylicBrush.xaml" XamlRuntime="$(DefaultXamlRuntime)" />
    <Page Update="Styles\UWP\AppbarButton.xaml" XamlRuntime="$(DefaultXamlRuntime)" />
    <Page Update="Styles\UWP\Button.xaml" XamlRuntime="$(DefaultXamlRuntime)" />
    <Page Update="Styles\UWP\Common.xaml" XamlRuntime="$(DefaultXamlRuntime)" />
    <Page Update="Styles\UWP\ContentDialog.xaml" XamlRuntime="$(DefaultXamlRuntime)" />
    <Page Update="Styles\UWP\CornerRadius.xaml" XamlRuntime="$(DefaultXamlRuntime)" />
    <Page Update="Styles\UWP\Hyperlink.xaml" XamlRuntime="$(DefaultXamlRuntime)" />
    <Page Update="Styles\UWP\MenuFlyout.xaml" XamlRuntime="$(DefaultXamlRuntime)" />
    <Page Update="Styles\UWP\ScrollBar.xaml" XamlRuntime="$(DefaultXamlRuntime)" />
    <Page Update="Styles\UWP\ScrollViewer.xaml" XamlRuntime="$(DefaultXamlRuntime)" />
    <Page Update="Styles\UWP\TextBlock.xaml" XamlRuntime="$(DefaultXamlRuntime)" />
  </ItemGroup>

  <!-- 在 Debug 调试模式下测试 AOT 发布后的文件 -->
  <Target Name="AutoPublish" AfterTargets="AfterBuild" Condition="$(Configuration) == 'Debug'">
    <MSBuild Projects="$(MSBuildProjectFullPath)" Targets="Publish" />
    <Copy SourceFiles="$(NativeOutputPath)$(AssemblyName).exe" DestinationFiles="$(ProjectDir)obj\$(Platform)\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\apphost.exe" />
  </Target>
</Project>

Project link
项目链接

https://github.com/Gaoyifei1011/GetStoreApp

Note: I manually removed Microsoft.Web.WebView2.Core.Projection.dll. If you want to test this bug, you'll need to remove this line of code from wapproj.
注意:我由于手动移除了 Microsoft.Web.WebView2.Core.Projection.dll。如果你们想测试这个 Bug,需要在 wapproj 将这一行代码移除。

      <AppxPackagePayload Remove="@(AppxPackagePayload)" Condition="'%(FileName)%(Extension)'=='Microsoft.Web.WebView2.Core.Projection.dll'" />

@oggy22
Copy link
Member

oggy22 commented Oct 24, 2024

Hi @Gaoyifei1011 , can you please try reproing with the latest prerelease version https://www.nuget.org/packages/Microsoft.Web.WebView2/1.0.2895-prerelease?

@Gaoyifei1011
Copy link
Author

Hi @Gaoyifei1011 , can you please try reproing with the latest prerelease version https://www.nuget.org/packages/Microsoft.Web.WebView2/1.0.2895-prerelease?

The WinUI 3 project is not in the root directory

--------------------------------

WinUI 3 项目未在根目录下

{D9BB4B0B-3A8F-47A9-97C7-99A7F149FC1E}
{3AD72734-26BD-433E-98D8-FFAAF6245D26}


The WinUI 3 project is in the root directory

--------------------------------

WinUI 3 项目在根目录下

{CEE89719-2BD6-4E8C-A987-C2894A92D871}

I created a blank template project and upgraded WebView2 to the 1.0.2895.0 preview and found that Projection.dll still replicates after AOT is released

--------------------------------

我创建了一个空白模板项目并升级 WebView2 到 1.0.2895.0 预览版,发现 Projection.dll 在 AOT 发布后还是会复制
App1 (Package)_1.0.3.0_x64.msixbundle.zip
App1 (Package)_1.0.2.0_x64.msixbundle.zip
App1.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants