Appcenter-sdk-dotnet: WinUI 3 support

Created on 7 May 2021  路  10Comments  路  Source: microsoft/appcenter-sdk-dotnet

Description

Installing the SDK in WinUI 3 (Reunion 0.5.6) project works, but the SDK does not work at runtime. The exception I am getting is that the file System.Windows.Forms can't be found. It seems like the nuget package does not correctly install the UWP version of the appcenter SDK.

Repro Steps

Please list the steps used to reproduce your issue.

  1. Create empty WinUI 3 project
  2. Add Microsoft.AppCenter.Analytics and Microsoft.AppCenter.Crashes
  3. Add AppCenter.Start("[my-project-id]", typeof(Crashes), typeof(Analytics)); to App constructor

If you need more detailed error reports or repro steps, let me know. I guess this needs a dedicated nuget package that supports dotnet 5 + (mostly) UWP.

feature request

Most helpful comment

Hi! Sorry for the long response.
We are already working on it. I will notify you when we will have any updates.

All 10 comments

Hi! Thanks for getting in touch with us!
Please, fill out the Details part in the issue template. To do that click New issue > Problem report. In particular, we need to know the App Center version which you use and verbose logs with repo steps before and after the crash.
Also please clarify what kind of project you use, WinUI in UWP? And how you crash your app? I checked this behavior on my side on an empty app with a test crash and for me all work correclty.

@AnastasiaKubova Thank you for checking this out. WinUI 3 is only support in one configuration: with dotnet 5 and in "desktop" mode. UWP is not supported.

I think the Details section does not provide any helpful additional information, but here you go:

Description

Installing the SDK in WinUI 3 (Reunion 0.5.6) project works, but the SDK does not work at runtime. The exception I am getting is that the file System.Windows.Forms can't be found. It seems like the nuget package does not correctly install the UWP version of the appcenter SDK.

Repro Steps

Please list the steps used to reproduce your issue.

  • Create empty WinUI 3 project
  • Add Microsoft.AppCenter.Analytics and Microsoft.AppCenter.Crashes
  • Add AppCenter.Start("[my-project-id]", typeof(Crashes), typeof(Analytics)); to App constructor

Details

  1. What is your app platform (Xamarin.Android or Xamarin.iOS or UWP)?
    As mentioned above: WinUI 3 (Reunion 0.5.6)
  2. If using Xamarin.Forms or if using portable/shared code to call our SDK APIs, are you using shared project, PCL code or .NET standard code for the application? Which .NET standard version or which PCL profile?
    dotnet 5 (net5.0-windows10.0.19041.0)
  3. Which SDK version are you using?
    latest (4.2.0).
  4. Which OS version did you experience the issue on?
    Windows 10 20H2 19042
  5. What device version did you see this error on? Were you using an emulator or a physical device?
    Windows 10 20H2 19042 (is this a different question from 4?)
  6. What third party libraries are you using?
  <ItemGroup>
    <PackageReference Include="Microsoft.AppCenter.Analytics" Version="4.2.0" />
    <PackageReference Include="Microsoft.AppCenter.Crashes" Version="4.2.0" />
    <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="5.0.1" />
    <PackageReference Include="Microsoft.ProjectReunion" Version="0.5.6" />
    <PackageReference Include="Microsoft.Windows.CsWinRT" Version="1.2.5" />
    <Manifest Include="$(ApplicationManifest)" />
  </ItemGroup>
  1. Please enable verbose logging for your app using AppCenter.LogLevel = LogLevel.Verbose before your call to AppCenter.Start(...) and include the logs here:
Exception thrown at 0x00007FF92B624B59 in App.exe: Microsoft C++ exception: EEFileLoadException at memory location 0x00000035A6F79F70.
Exception thrown at 0x00007FF92B624B59 in App.exe: Microsoft C++ exception: [rethrow] at memory location 0x0000000000000000.
Exception thrown at 0x00007FF92B624B59 in App.exe: Microsoft C++ exception: EEFileLoadException at memory location 0x00000035A6F79F70.
Exception thrown at 0x00007FF92B624B59 in App.exe: Microsoft C++ exception: [rethrow] at memory location 0x0000000000000000.
Exception thrown at 0x00007FF92B624B59 in App.exe: Microsoft C++ exception: EEFileLoadException at memory location 0x00000035A6F79F70.
Exception thrown at 0x00007FF92B624B59 in App.exe: Microsoft C++ exception: [rethrow] at memory location 0x0000000000000000.
Exception thrown: 'System.IO.FileNotFoundException' in Microsoft.AppCenter.dll
Exception thrown: 'System.TypeInitializationException' in Microsoft.AppCenter.dll

Exception thrown at 0x00007FF92B624B59 (KernelBase.dll) in App.exe: WinRT originate error - 0x80131534 : 'The type initializer for 'Microsoft.AppCenter.Utils.ApplicationLifecycleHelper' threw an exception.'.

Thanks for the additional info!
Could you please clarify do you have a desktop app or a UWP app (I just a bit confused because in the description you mention the UWP app, but if I right understand you test on the desktop app, right?)?

Based on this docs I see that WinUI already has a preview version with support UWP apps. I checked this behavior on WinUI in UWP app and for me all work well.

My app is a desktop app

Currently, the App Center SDK doesn't support WinUI apps. I will mark this issue as a feature request.

Hi @AnastasiaKubova Has WinUI 3 support been considered for AppCenter? Can you share any update on this feature request?

@Marv51 we have notified our PMs but there are no updates on this feature yet.

馃 Link back to WinUI 3 issue tracking ecosystem support for these scenarios in general: https://github.com/microsoft/microsoft-ui-xaml/issues/5116

Hi @russelarms and @AnastasiaKubova, any update on this?

Hi! Sorry for the long response.
We are already working on it. I will notify you when we will have any updates.

Was this page helpful?
0 / 5 - 0 ratings