AEAssessmentApplication class has no proper constructor · Issue #19133 · dotnet/macios (original) (raw)

Steps to Reproduce

  1. Create NET MAUI project, using either NET6 or NET7
  2. Create AEAssessmentSession and try to add AEAssessmentApplication to its configuration (AEAssessmentConfiguration) in MacCatalyst platform-dependent code

Expected Behavior

There should be available:

and/or

Actual Behavior

Only no-arg constructor and get-only properties are available for AEAssessmentApplication class

Environment

Visual Studio Community 2022 for Mac
Version 17.6.4 (build 472)
Installation UUID: 33003d53-15c5-4131-84aa-de9b3a899679

Runtime
.NET 7.0.3 (64-bit)
Architecture: Arm64
Microsoft.macOS.Sdk 13.1.1007; git-rev-head:8afca776a0a96613dfb7200e0917bb57f9ed5583; git-branch:release/7.0.1xx-xcode14.2

Roslyn (Language Service)
4.6.0-3.23180.6+99e956e42697a6dd886d1e12478ea2b27cceacfa

NuGet
Version: 6.4.0.117

Xamarin Designer
Version: 17.6.3.9
Hash: 2648399ae8
Branch: remotes/origin/d17-6
Build date: 2023-09-07 02:05:20 UTC

.NET SDK (Arm64)
SDK: /usr/local/share/dotnet/sdk/7.0.401/Sdks
SDK Versions:
    7.0.401
    7.0.307
    7.0.306
    6.0.414
    6.0.413
    6.0.412
    6.0.408
    6.0.406
MSBuild SDKs: /Applications/Visual Studio.app/Contents/MonoBundle/MSBuild/Current/bin/Sdks

.NET SDK (x64)
SDK Versions:
    7.0.401
    6.0.414
    6.0.412

.NET Runtime (Arm64)
Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
    8.0.0-rc.1.23419.4
    7.0.11
    7.0.10
    7.0.9
    7.0.5
    6.0.22
    6.0.21
    6.0.20
    6.0.16
    6.0.14

.NET Runtime (x64)
Runtime: /usr/local/share/dotnet/x64/dotnet
Runtime Versions:
    7.0.11
    6.0.22
    6.0.20

Xamarin.Profiler
Version: 1.8.0.49
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

Updater
Version: 11

Apple Developer Tools
Xcode: 15.0 22265
Build: 15A240d

Xamarin.Mac
Version: 9.3.0.6 Visual Studio Community
Hash: 97731c92c
Branch: xcode14.3
Build date: 2023-04-11 22:38:35-0400

Xamarin.iOS
Version: 16.4.0.6 Visual Studio Community
Hash: 97731c92c
Branch: xcode14.3
Build date: 2023-04-11 22:38:36-0400

Xamarin.Android
Version: 13.2.1.2 (Visual Studio Community)
Commit: xamarin-android/d17-5/a8a26c7
Android SDK: Library/Developer/Xamarin/android-sdk-macosx
    Supported Android versions:
        13.0 (API level 33)

SDK Command-line Tools Version: 7.0
SDK Platform Tools Version: 34.0.3
SDK Build Tools Version: 32.0.0

Build Information: 
Mono: d9a6e87
Java.Interop: xamarin/java.interop/d17-5@149d70fe
SQLite: xamarin/sqlite/3.40.1@68c69d8
Xamarin.Android Tools: xamarin/xamarin-android-tools/d17-5@ca1552d

Microsoft Build of OpenJDK
Java SDK: /Library/Java/JavaVirtualMachines/microsoft-11.jdk
11.0.16.1
Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

Eclipse Temurin JDK
Java SDK: /Library/Java/JavaVirtualMachines/temurin-8.jdk
1.8.0.302
Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

Android SDK Manager
Version: 17.6.0.50
Hash: a715dca
Branch: HEAD
Build date: 2023-09-07 02:05:26 UTC

Android Device Manager
Version: 0.0.0.1309
Hash: 06e3e77
Branch: HEAD
Build date: 2023-09-07 02:05:26 UTC

Build Information
Release ID: 1706040472
Git revision: 0b8c2cb9f01ef14a2b07ff4ea047268c8756fee6
Build date: 2023-09-07 02:03:50+00
Build branch: release-17.6
Build lane: release-17.6

Operating System
Mac OS X 14.0.0
Darwin 23.0.0 Darwin Kernel Version 23.0.0
    Fri Sep 15 14:42:57 PDT 2023
    root:xnu-10002.1.13~1/RELEASE_ARM64_T8112 arm64

Example

I am using AutomaticAssessmentConfiguration namespace from automaticassessmentconfiguration.cs in order to implement EDU Assessment mode in my application.

I have tried to use inheritance with property overriding (since they have been marked
as virtual in base class), but that solution has stopped working with macOS Sonoma:

public class AEAllowedApplication : AEAssessmentApplication
{
    private string _bundleId;
    private string _teamId;

    public override string BundleIdentifier => _bundleId;
    public override string TeamIdentifier => _teamId;
    public AEAssessmentParticipantConfiguration Config { get; set; } = new AEAssessmentParticipantConfiguration();

    public AEAllowedApplication(string bundleId, bool networkAllowed) : this(bundleId, bundleId, networkAllowed)
    {
    }

    public AEAllowedApplication(string bundleId, string teamId, bool networkAllowed)
    {
        _bundleId = bundleId;
        _teamId = teamId;
        Config.AllowsNetworkAccess = networkAllowed;
    }
}