WinUI3 EntryPointNotFoundException After VS 17.1.2 Update

Viewed 165

I just installed Visual Studio 2022 17.2.1 and my WinUI3 Project does not run anymore.

Even the installed app on my computer doesn't open. When I try to compile and run within VS the follow error is generated

System.EntryPointNotFoundException: 'Unable to find an entry point named 'XamlCheckProcessRequirements' in DLL 'Microsoft.ui.xaml.dll'.'

Error

if dotnet build dotnet build command

3 Answers

After the update...the Microsoft.Ui.Xaml nuget package was causing the error. Removing it solved to problem. <PackageReference Include="Microsoft.UI.Xaml" Version="2.7.1"/>

I also had the problem. I believe, I could fix the problem by creating the WinUI3 project using the correct project template.

Before, I used the "Windows App SDK extension" in Visual Studio 2022. Then I removed this extension and instead installed the item "Windows APP SDK C# Templates" from the Visual Studio installer (item from "Installation details").

With the new / correct project template "Empty App, packaged (WinUI 3 in Desktop), I created a WinUI 3 project.

Here you find the relevant parts of the .cjproj file:

<Project Sdk="Microsoft.NET.Sdk">
  <PropertyGroup>
    <OutputType>WinExe</OutputType>
    <TargetFramework>net6.0-windows10.0.19041.0</TargetFramework>
    <TargetPlatformMinVersion>10.0.17763.0</TargetPlatformMinVersion>
    <RootNamespace>MyApp</RootNamespace>
    <ApplicationManifest>app.manifest</ApplicationManifest>
    <Platforms>x86;x64;arm64</Platforms>
    <RuntimeIdentifiers>win10-x86;win10-x64;win10-arm64</RuntimeIdentifiers>
    <PublishProfile>win10-$(Platform).pubxml</PublishProfile>
    <UseWinUI>true</UseWinUI>
    <EnablePreviewMsixTooling>true</EnablePreviewMsixTooling>
  </PropertyGroup>


  <ItemGroup>
    <PackageReference Include="Microsoft.WindowsAppSDK" Version="1.1.2" />
    <PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.1" />
    <Manifest Include="$(ApplicationManifest)" />
  </ItemGroup>


</Project>

You can see, that two Nuget Packages are required:

Microsoft.WindowsAppSDK and Microsoft.Windows.SDK.BuildTools.

As you see, I used Windows App SDK 1.1.2 at that time. (I you publish an unpackaged app, the respective Window App SDK needs to be installed on the system, i can be found here)


In the project settings, take a look at the value in TargetFramework value. It seems that a value of simply "net6.0" does not work. In this post you will find this statement:

Changing net5.0-windows10.0.19041.0 to net6.0-windows10.0.19041.0 worked for me, too.

Delete the version of your Microsoft.ui.xaml in this path and try to run your project. This solution worked for me

C:\Users\UserName\.nuget\packages\microsoft.ui.xaml

Related