Windows 应用 SDK 的最新试验通道发行说明

重要

不支持在生产环境中使用试验通道,并且无法将使用试验版本的应用发布到 Microsoft Store

此试验通道包含 Windows 应用 SDK 的多个版本,其中附带了处于开发早期阶段的试验通道功能。 用于试验功能的 API 具有试验特性。 如果在代码中调用试验 API,会收到生成时警告。 试验通道中的所有 API 均可能出现大量修订和重大更改。 试验功能和 API 可随时从后续版本中删除。

重要链接

试验通道发行说明存档:

版本 1.8 实验版(1.8.0-experimental2)

将设备上的 AI 与 Windows AI API 配合使用

重要

这些 API 所需的基础 ML 模型当前要求您的设备目前在开发通道上运行最新版的 Windows 11 内部预览版。 此外,这些 API 要求您的设备需为 Copilot+ 电脑。 请参阅 Copilot+ 电脑开发人员指南 了解有关这些设备的详细信息。 在缺少必要支持的设备上调用 API 时,API 将引发异常。

Windows 应用 SDK 包含高级 Windows AI 功能,使开发人员能够将智能功能无缝集成到其应用程序中。 这些增强功能包括本地 AI 功能,例如响应传入的提示、识别图像中的文本、描述图像内容、从图片中提取对象等。

有关在创建 Windows AI API 期间利用的负责任的开发实践的信息,在创建 AI 辅助功能时也可以应用这些做法,请参阅 在 Windows 上开发负责任的生成 AI 应用程序和功能 指南。

十进制数据类型

新的 Decimal 支持提供了一种高精度的 base-10 数值数据类型,对于财务和科学计算而言是无价的,避免浮点数据类型固有的不精确和舍入错误。 它的结构为 96 位(12 字节)无符号整数,按可变幂 10 进行缩放,从而精确表示小数值。 这使对缺少十进制数据类型的编程语言提供十进制支持,并提供与支持十进制的语言(例如 C#、Python)的互作性。

NuGet 元包

Windows 应用 SDK NuGet 包已转换为 NuGet 元包。 参与 Windows 应用 SDK 的每个组件现在都是一个组件 NuGet 包,由元包列为依赖项。 这样,开发人员就可以选择元包或为其应用程序选择特定的组件包。 使用单个组件包可让开发人员仅包含其应用所需的 API 和功能。 默认体验的行为就像 WindowsAppSDKSelfContained 已设置为 True 一样,但可以引用包 Microsoft.WindowsAppSDK.Packages 以使用框架包部署。

Microsoft.Windows.SDK.BuildTools.MSIX 重构

MSIX 发布支持已纳入独立的 nuget 包,该包可由 Windows 应用 SDK 和其他项目独立维护和使用。 此外,还弥补了与 Single-Project 解决方案的几个功能空缺,包括生成 MSIX 捆绑包和上传 MSIX 包。

Windows AI API

Phi Silica的 Low-Rank 调整(LoRA)

Low-Rank Adaption(LoRA)使开发人员能够使用自己的自定义数据微调设备语言模型(Phi Silica)。 此适配器使输出能够与金融、医疗和教育等特定方案保持一致。 有关详细信息,请参阅 Phi Silica LoRA

文本智能 - 对话摘要

Phi Silica 现在有一个对话总结功能,允许你总结人们通过电子邮件、聊天或会话中所说的话。 有关更多详细信息,请参阅 Phi 硅

适用于 1.8 实验性的 2 的新 API

此版本包括以下新的和经过修改的实验 API:

Microsoft.UI.Composition

    CompositionNotificationDeferral
    CompositionProjectedShadow
        MaxOpacity
        MinOpacity
        OpacityFalloff

    CompositionProjectedShadowCaster
        AncestorClip
        Mask

    CompositionProjectedShadowDrawOrder
    CompositionProjectedShadowReceiver
        DrawOrder
        Mask
Microsoft.UI.Composition.Experimental

    ExpCompositionVisualSurface
    ExpExpressionNotificationProperty
    IExpCompositionPropertyChanged
    IExpCompositionPropertyChangedListener
    IExpCompositor
    IExpVisual
Microsoft.UI.Content

    ContentAppWindowBridge
    ContentDisplayOrientations
    ContentExternalBackdropLink
    ContentExternalOutputLink
    ContentIsland
        Connected
        ConnectionInfo
        ConnectRemoteEndpoint
        Disconnected
        IsRemoteEndpointConnected
        Root

    ContentIslandEnvironment
        CurrentOrientation
        NativeOrientation
        ThemeChanged

    ContentSite
        SetContentNodeParent
        TryGetAutomationProvider

    ContentSiteEnvironment
        CurrentOrientation
        NativeOrientation
        NotifyThemeChanged

    CoreWindowSiteBridge
    CoreWindowTopLevelWindowBridge
    DesktopChildSiteBridge
        AcceptRemoteEndpoint
        ConnectionInfo
        IsRemoteEndpointConnected
        RemoteEndpointConnecting
        RemoteEndpointDisconnected
        RemoteEndpointRequestedStateChanged

    DesktopSiteBridge
        TryCreatePopupSiteBridge

    EndpointConnectionEventArgs
    EndpointRequestedStateChangedEventArgs
    IContentIslandEndpointConnectionPrivate
    IContentNodeOwner
    IContentSiteBridgeEndpointConnectionPrivate
    PopupWindowSiteBridge
    ProcessStarter
    SystemVisualSiteBridge
Microsoft.UI.Input

    InputKeyboardSource
        GetForWindowId

    InputLayoutPolicy
    InputLightDismissAction
        GetForIsland

    InputPointerActivationBehavior
    InputPointerSource
        ActivationBehavior
        DirectManipulationHitTest
        GetForVisual
        GetForWindowId
        RemoveForVisual
        TouchHitTesting
        TrySetDeviceKinds

    ProximityEvaluation
    TouchHitTestingEventArgs
Microsoft.UI.Windowing

    AppWindow
        GetCurrentPlacement
        PersistedStateId
        PlacementRestorationBehavior
        SaveCurrentPlacement
        SaveCurrentPlacementForAllPersistedStateIds
        SetCurrentPlacement

    AppWindowPlacementDetails
    DisplayArea
        GetMetricsFromWindowId

    PlacementInfo
    PlacementRestorationBehavior
Microsoft.UI.Xaml

    XamlIsland
        ShouldConstrainPopupsToWorkArea
Microsoft.UI.Xaml.Automation.Peers

    AutomationEvents
        Notification

    InkCanvasAutomationPeer
    PagerControlAutomationPeer
Microsoft.UI.Xaml.Controls

    ContentDialogPlacement
        UnconstrainedPopup

    DoInkPresenterWork
    ElementFactory
    FlowLayout
    FlowLayoutAnchorInfo
    FlowLayoutLineAlignment
    FlowLayoutState
    IApplicationViewSpanningRects
    IndexPath
    InkCanvas
    ISelfPlayingAnimatedVisual
    ItemContainer
        CanUserInvoke
        CanUserInvokeProperty
        CanUserSelect
        CanUserSelectProperty
        ItemInvoked
        MultiSelectMode
        MultiSelectModeProperty

    ItemContainerInteractionTrigger
    ItemContainerInvokedEventArgs
    ItemContainerMultiSelectMode
    ItemContainerUserInvokeMode
    ItemContainerUserSelectMode
    LayoutPanel
    NumberBox
        InputScope
        InputScopeProperty
        TextAlignment
        TextAlignmentProperty

    PagerControl
    PagerControlButtonVisibility
    PagerControlDisplayMode
    PagerControlSelectedIndexChangedEventArgs
    PagerControlTemplateSettings
    ProgressRing
        DeterminateSource
        DeterminateSourceProperty
        IndeterminateSource
        IndeterminateSourceProperty

    RecyclePool
    RecyclingElementFactory
    ScrollingScrollStartingEventArgs
    ScrollingZoomStartingEventArgs
    ScrollView
        ScrollStarting
        ZoomStarting

    SelectionModel
    SelectionModelChildrenRequestedEventArgs
    SelectionModelSelectionChangedEventArgs
    SelectTemplateEventArgs
    StackLayout
        IsVirtualizationEnabled
        IsVirtualizationEnabledProperty

    StackLayoutState
    TeachingTip
        Opened

    TeachingTipOpenedEventArgs
    UniformGridLayoutState
Microsoft.UI.Xaml.Controls.Primitives

    ScrollPresenter
        ScrollStarting
        ZoomStarting
Microsoft.Windows.AI.Foundation

    AIFoundationContract
    EmbeddingVector
Microsoft.Windows.AI.Imaging

    ImageObjectRemover
    ImageObjectRemoverContract
Microsoft.Windows.AI.Text

    ConversationItem
    ConversationSummaryOptions
    InputKind
    LanguageModel
        CreateContext
        CreateContext
        CreateContext
        GenerateEmbeddingVectors
        GenerateEmbeddingVectors
        GenerateResponseAsync
        GenerateResponseAsync
        GenerateResponseAsync
        GenerateResponseFromEmbeddingsAsync
        GenerateResponseFromEmbeddingsAsync
        GenerateResponseFromEmbeddingsAsync
        GetUsablePromptLength
        GetUsablePromptLength
        GetVectorSpaceId

    LanguageModelEmbeddingVectorResult
    TextSummarizer
        SummarizeConversationAsync
Microsoft.Windows.AI.Text.Experimental (C#-only, see Known Issues)
 
    LowRankAdaptation
    LanguageModelOptionsExperimental
    LanguageModelExperimental
Microsoft.Windows.ApplicationModel.Background.UniversalBGTask

    Task
        Run
Microsoft.Windows.ApplicationModel.WindowsAppRuntime

    DeploymentManager
        Repair

    DeploymentStatus
        PackageRepairFailed
Microsoft.Windows.AppNotifications

    AppNotification
        ConferencingConfig

    AppNotificationConferencingConfig
Microsoft.Windows.AppNotifications.Builder

    AppNotificationBuilder
        AddCameraPreview

    AppNotificationButton
        SetSettingStyle

    AppNotificationButtonSettingStyle
Microsoft.Windows.Storage

    ApplicationData
        GetForUnpackaged
Microsoft.Windows.Storage.Pickers

    FileOpenPicker
    FileSavePicker
    FolderPicker
    PickerLocationId
    PickerViewMode
    PickFileResult
    PickFolderResult
Microsoft.Windows.Vision

    ScreenRegionBoundingBox
    ScreenRegionDetectionContract
    ScreenRegionLabel
Microsoft.Windows.Widgets.Feeds.Providers

    FeedManager
        TryRemoveAnnouncementById

    IFeedManager3
Microsoft.Windows.Widgets.Providers

    WidgetInfo
        Rank

    WidgetUpdateRequestOptions
        Rank

已知问题

  • 此版本中缺少C++的 Microsoft.Windows.AI.Text.Experimental API 投影。 投影可用于 C# 。
  • 如果在默认的自包含模式下使用 Microsoft.WindowsAppSDK.WinUI 组件包,请确保在使用 WebView2 API 时将 WebView2EnableCsWinRTProjection 属性设置为 true。 这有助于防止版本冲突并避免相关的警告。
  • 使用 WindowsAppSDK 组件包时,你可能会注意到一条警告 NU1603 ,指示找不到依赖组件包的指定版本,而是解决了另一个组件包。 这在 experimental2 构建版本中是预期的,NuGet 将正确解析包的较新版本,从而允许您的项目构建。 如果将警告视为错误,可以通过指定属性 <WarningsNotAsErrors>NU1603</WarningsNotAsErrors>暂时将此特定警告视为非错误。

版本 1.8 实验版(1.8.0-experimental1)

将设备上的 AI 与 Windows AI API 配合使用

重要

这些 API 所需的基础 ML 模型当前要求您的设备目前在开发通道上运行最新版的 Windows 11 内部预览版。 此外,这些 API 要求您的设备需为 Copilot+ 电脑。 请参阅 Copilot+ 电脑开发人员指南 了解有关这些设备的详细信息。 在缺少必要支持的设备上调用 API 时,API 将引发异常。

Windows AI API 提供了多个 AI 支持的功能和 API,让你在 Windows 应用中轻松、高效、负责任地使用设备上的 AI 模型。 在此版本中,我们将提供多个以方案为中心的 API,以便利用强大的功能,而无需查找、运行或优化自己的机器学习 (ML) 模型。

详细了解在 Windows AI API 开发期间使用的负责任的开发做法,在 Windows 上开发负责任的生成 AI 应用程序和功能 指南中创建 AI 辅助功能时,也可以应用这些做法。

这是实验性频道的最新版本。

若要下载,请将 WinAppSDK NuGet 版本重新定目标到 1.8.250515001-experimental1

对象擦除

ImageObjectRemover可用于从图像中删除对象。 该模型采用图像和灰度掩码,指示要删除的对象、清除图像中的屏蔽区域,并将擦除的区域替换为图像背景。

适用于 1.8-experimental1 的新 API

此版本包括以下新的和经过修改的实验 API:

Microsoft.Graphics.Imaging

    ImageBuffer
    ImageBufferContract
    ImageObjectExtractor
    ImageObjectExtractorContract
    ImageObjectExtractorHint
    ImageObjectRemover
    ImageObjectRemoverContract
    ImageScaler
    ImageScalerContract
    PixelFormat
Microsoft.UI.Composition

    CompositionNotificationDeferral
    CompositionProjectedShadow
        MaxOpacity
        MinOpacity
        OpacityFalloff

    CompositionProjectedShadowCaster
        AncestorClip
        Mask

    CompositionProjectedShadowDrawOrder
    CompositionProjectedShadowReceiver
        DrawOrder
        Mask
Microsoft.UI.Composition.Experimental

    ExpCompositionVisualSurface
    ExpExpressionNotificationProperty
    IExpCompositionPropertyChanged
    IExpCompositionPropertyChangedListener
    IExpCompositor
    IExpVisual
Microsoft.UI.Content

    ContentAppWindowBridge
    ContentDisplayOrientations
    ContentExternalBackdropLink
    ContentExternalOutputLink
    ContentIsland
        Connected
        ConnectionInfo
        ConnectRemoteEndpoint
        Disconnected
        IsRemoteEndpointConnected
        Root

    ContentIslandEnvironment
        CurrentOrientation
        NativeOrientation
        ThemeChanged

    ContentSite
        SetContentNodeParent
        TryGetAutomationProvider

    ContentSiteEnvironment
        CurrentOrientation
        NativeOrientation
        NotifyThemeChanged

    CoreWindowSiteBridge
    CoreWindowTopLevelWindowBridge
    DesktopChildSiteBridge
        AcceptRemoteEndpoint
        ConnectionInfo
        IsRemoteEndpointConnected
        RemoteEndpointConnecting
        RemoteEndpointDisconnected
        RemoteEndpointRequestedStateChanged

    DesktopSiteBridge
        TryCreatePopupSiteBridge

    EndpointConnectionEventArgs
    EndpointRequestedStateChangedEventArgs
    IContentIslandEndpointConnectionPrivate
    IContentNodeOwner
    IContentSiteBridgeEndpointConnectionPrivate
    PopupWindowSiteBridge
    ProcessStarter
    SystemVisualSiteBridge
Microsoft.UI.Input

    InputKeyboardSource
        GetForWindowId

    InputLayoutPolicy
    InputLightDismissAction
        GetForIsland

    InputPointerActivationBehavior
    InputPointerSource
        ActivationBehavior
        DirectManipulationHitTest
        GetForVisual
        GetForWindowId
        RemoveForVisual
        TouchHitTesting
        TrySetDeviceKinds

    ProximityEvaluation
    TouchHitTestingEventArgs
Microsoft.UI.Input.Experimental

    ExpInputSite
    ExpPointerPoint
Microsoft.UI.Windowing

    AppWindow
        GetCurrentPlacement
        PersistedStateId
        PlacementRestorationBehavior
        SaveCurrentPlacement
        SaveCurrentPlacementForAllPersistedStateIds
        SetCurrentPlacement

    AppWindowPlacementDetails
    DisplayArea
        GetMetricsFromWindowId

    PlacementInfo
    PlacementRestorationBehavior
Microsoft.UI.Xaml

    XamlIsland
        ShouldConstrainPopupsToWorkArea
Microsoft.UI.Xaml.Automation.Peers

    AutomationEvents
        Notification

    InkCanvasAutomationPeer
    PagerControlAutomationPeer
Microsoft.UI.Xaml.Controls

    ContentDialogPlacement
        UnconstrainedPopup

    DoInkPresenterWork
    ElementFactory
    FlowLayout
    FlowLayoutAnchorInfo
    FlowLayoutLineAlignment
    FlowLayoutState
    IApplicationViewSpanningRects
    IndexPath
    InkCanvas
    ISelfPlayingAnimatedVisual
    ItemContainer
        CanUserInvoke
        CanUserInvokeProperty
        CanUserSelect
        CanUserSelectProperty
        ItemInvoked
        MultiSelectMode
        MultiSelectModeProperty

    ItemContainerInteractionTrigger
    ItemContainerInvokedEventArgs
    ItemContainerMultiSelectMode
    ItemContainerUserInvokeMode
    ItemContainerUserSelectMode
    LayoutPanel
    NumberBox
        InputScope
        InputScopeProperty
        TextAlignment
        TextAlignmentProperty

    PagerControl
    PagerControlButtonVisibility
    PagerControlDisplayMode
    PagerControlSelectedIndexChangedEventArgs
    PagerControlTemplateSettings
    ProgressRing
        DeterminateSource
        DeterminateSourceProperty
        IndeterminateSource
        IndeterminateSourceProperty

    RecyclePool
    RecyclingElementFactory
    ScrollingScrollStartingEventArgs
    ScrollingZoomStartingEventArgs
    ScrollView
        ScrollStarting
        ZoomStarting

    SelectionModel
    SelectionModelChildrenRequestedEventArgs
    SelectionModelSelectionChangedEventArgs
    SelectTemplateEventArgs
    StackLayout
        IsVirtualizationEnabled
        IsVirtualizationEnabledProperty

    StackLayoutState
    UniformGridLayoutState
Microsoft.UI.Xaml.Controls.Primitives

    ScrollPresenter
        ScrollStarting
        ZoomStarting
Microsoft.Windows.AI

    AIFeatureReadyContract
    AIFeatureReadyResult
    AIFeatureReadyResultState
    AIFeatureReadyState
Microsoft.Windows.AI.ContentModeration

    ContentFilterOptions
    ContentModerationContract
    ImageContentFilterSeverity
    SeverityLevel
    TextContentFilterSeverity
Microsoft.Windows.AI.Generative

    ImageDescriptionContract
    ImageDescriptionGenerator
    ImageDescriptionKind
    ImageDescriptionResult
    ImageDescriptionResultStatus
    LanguageModel
    LanguageModelContext
    LanguageModelContract
    LanguageModelEmbeddingVectorResult
    LanguageModelOptions
    LanguageModelResponseResult
    LanguageModelResponseStatus
Microsoft.Windows.ApplicationModel.WindowsAppRuntime

    DeploymentManager
        Repair

    DeploymentStatus
        PackageRepairFailed
Microsoft.Windows.AppNotifications

    AppNotification
        ConferencingConfig

    AppNotificationConferencingConfig
Microsoft.Windows.AppNotifications.Builder

    AppNotificationBuilder
        AddCameraPreview

    AppNotificationButton
        SetSettingStyle

    AppNotificationButtonSettingStyle
Microsoft.Windows.SemanticSearch

    EmbeddingVector
    SemanticSearchContract
Microsoft.Windows.Storage

    ApplicationData
        GetForUnpackaged
Microsoft.Windows.Storage.Pickers

    FileOpenPicker
    FileSavePicker
    FolderPicker
    PickerLocationId
    PickerViewMode
    PickFileResult
    PickFolderResult
Microsoft.Windows.Vision

    BoundingBox
    DetectedLineStyle
    OrientationDetectionOptions
    RecognizedLine
    RecognizedLineStyle
    RecognizedText
    RecognizedWord
    TextRecognitionContract
    TextRecognizer
    TextRecognizerOptions
Microsoft.Windows.Widgets.Feeds.Providers

    FeedManager
        TryRemoveAnnouncementById

    IFeedManager3
Microsoft.Windows.Workloads

    WorkloadPriority
    WorkloadsContract

错误修复

此版本中包含以下 bug 修复:

  • 修复了以下问题:如果 Windows 设置中的“悬停时滚动非活动窗口”选项被禁用,则鼠标滚轮输入会被忽略。 有关详细信息,请参阅 GitHub 问题 #10091