WindowsAppSDK icon indicating copy to clipboard operation
WindowsAppSDK copied to clipboard

Follow up on How to specify exact version of MSVC toolset in Windows App SDK project? (#5767)

Open PetrMinar opened this issue 2 months ago • 2 comments

https://github.com/microsoft/WindowsAppSDK/issues/5767

I cannot reopen the old question, so created new issue.

This is the result of asking on the Visual Studio Developer Community: This issue originates from the Windows App SDK and not Visual Studio. You can open a new issue for this project in GitHub here: https://github.com/microsoft/WindowsAppSDK/issues

So where should I search for solution?

PetrMinar avatar Nov 03 '25 13:11 PetrMinar

Visual Studio, since this is a Visual Studio issue.

Microsoft.CppBuild.targets contains:

  <ItemGroup Condition="'$(UseDefaultPropertyPageSchemas)' != 'false' and '$(UseDefaultGeneralPropertyPageSchema)' != 'false'">
    <PropertyPageSchema Include="$(VCTargetsPath)$(LangID)\general.xml" Condition="'$(WindowsStoreApp)' != 'true'">
      <Context>Project</Context>
    </PropertyPageSchema>
    <PropertyPageSchema Include="$(VCTargetsPath)$(LangID)\general_advanced.xml" Condition="'$(WindowsStoreApp)' != 'true'">
      <Context>Project</Context>
    </PropertyPageSchema>
    <PropertyPageSchema Include="$(VCTargetsPath)$(LangID)\general_advanced_hostarm64.xml" Condition="'$(WindowsStoreApp)' != 'true' and '$(_VC_arm64_ToolsInstalled)' == 'true'">
      <Context>Project</Context>
    </PropertyPageSchema>
    <PropertyPageSchema Include="$(VCTargetsPath)$(LangID)\general_advanced_netcore.xml" Condition="'$(WindowsStoreApp)' != 'true' and '$(CLRSupport)' == 'NetCore'">
      <Context>Project</Context>
    </PropertyPageSchema>
    <PropertyPageSchema Include="$(VCTargetsPath)$(LangID)\general_appcontainerapplication.xml" Condition="'$(WindowsStoreApp)' == 'true'">
      <Context>Project</Context>
    </PropertyPageSchema>
    <PropertyPageSchema Include="$(VCTargetsPath)$(LangID)\general_ps.xml">
      <Context>PropertySheet</Context>
    </PropertyPageSchema>
    <PropertyPageSchema Include="$(VCTargetsPath)$(LangID)\folder.xml">
      <Context>File;BrowseObject</Context>
    </PropertyPageSchema>
  </ItemGroup>

So the switch is $(WindowsStoreApp). The setting you wish to modify is in general_advanced.xml.

Microsoft.Cpp.Default.props contains:

    <WindowsStoreApp Condition="'$(WindowsStoreApp)' == '' and '$(ApplicationType)' == 'Windows Store'">true</WindowsStoreApp>
    <WindowsStoreApp Condition="'$(WindowsAppContainer)' == 'true'">true</WindowsStoreApp>
    <WindowsStoreApp Condition="'$(WindowsStoreApp)' == ''">false</WindowsStoreApp>

So WindowsStoreApp is set when ApplicationType is set to "Windows Store".

Looking at the contents of a WinUI 3 project:

  <PropertyGroup Label="Globals">
    <CppWinRTOptimized>true</CppWinRTOptimized>
    <CppWinRTRootNamespaceAutoMerge>true</CppWinRTRootNamespaceAutoMerge>
    <MinimalCoreWin>true</MinimalCoreWin>
    <ProjectGuid>{d934744a-3ace-4bb9-86ae-0a2da3241b1a}</ProjectGuid>
    <ProjectName>TestApp</ProjectName>
    <RootNamespace>TestApp</RootNamespace>
    <!--
      $(TargetName) should be same as $(RootNamespace) so that the produced binaries (.exe/.pri/etc.)
      have a name that matches the .winmd
    -->
    <TargetName>$(RootNamespace)</TargetName>
    <DefaultLanguage>en-US</DefaultLanguage>
    <MinimumVisualStudioVersion>16.0</MinimumVisualStudioVersion>
    <AppContainerApplication>false</AppContainerApplication>
    <AppxPackage>false</AppxPackage>
    <ApplicationType>Windows Store</ApplicationType>
    <ApplicationTypeRevision>10.0</ApplicationTypeRevision>
    <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
    <WindowsTargetPlatformMinVersion>10.0.17763.0</WindowsTargetPlatformMinVersion>
    <UseWinUI>true</UseWinUI>
    <WindowsPackageType>None</WindowsPackageType>
  </PropertyGroup>

ApplicationType is there and set to "Windows Store". But ApplicationType is also used to set TargetPlatformIdentifier to "UAP", and this is required to enable things like the Xaml compiler. Visual Studio controls Microsoft.CppBuild.targets and Microsoft.Cpp.Default.props, so Visual Studio would be the best bet.

DarranRowe avatar Nov 03 '25 17:11 DarranRowe

@DarranRowe Thank you for your analysis. I have opened new issue on Visual Studio Developer Community, because they already closed the old one...

PetrMinar avatar Nov 04 '25 08:11 PetrMinar