diff --git a/.gitignore b/.gitignore index 479e37e613..50cb25bb4e 100644 --- a/.gitignore +++ b/.gitignore @@ -204,6 +204,8 @@ PublishScripts/ *.nupkg # NuGet Symbol Packages *.snupkg +# Visual Studio Extension build output (source files are *.vsixmanifest, not affected) +*.vsix # The packages folder can be ignored because of Package Restore **/[Pp]ackages/* # except build/, which is used as an MSBuild target. diff --git a/BuildAll.ps1 b/BuildAll.ps1 index 09a5034316..90d22c43c8 100644 --- a/BuildAll.ps1 +++ b/BuildAll.ps1 @@ -1,4 +1,4 @@ -<# +<# This script is to build the Foundation transport package that will be used to generate the windows app sdk package. This script is called from BuildAll.ps1 from the aggregator repo and should not be called directly. @@ -179,7 +179,7 @@ Try { .\tools\GenerateDynamicDependencyOverrides.ps1 -Path "$buildOverridePath" .\tools\GeneratePushNotificationsOverrides.ps1 -Path "$buildOverridePath" - if ($AzureBuildStep -ne "all") + if ($AzureBuildStep -ne "all" -and $AzureBuildStep -ne "BuildTemplates") { # Some builds have "-branchname" appended, but when this happens the environment variable # TFS_BUILDNUMBER has the un-modified version. @@ -666,6 +666,50 @@ Try { exit 1 } } + if (($AzureBuildStep -eq "all") -Or ($AzureBuildStep -eq "BuildTemplates")) + { + #------------------ + # Build WinUI template artifacts: + # - dotnet-new NuGet (Microsoft.WindowsAppSDK.WinUI.CSharp.Templates.*.nupkg) + # - templates VSIX (Standalone + Component, x C# + C++ = 4 .vsix) + # + # All artifacts land in \localpackages\ so a single dev workflow + # (the docs, the csproj's default, the NuGet.config + # "localpackages" feed, and Test-DotnetNewTemplates.ps1) all agree on + # one path. .vsix files coexist fine; NuGet only sees *.nupkg. + #------------------ + $templatesOutputDir = Join-Path $env:Build_SourcesDirectory "localpackages" + if (-not (Test-Path $templatesOutputDir)) + { + New-Item -ItemType Directory -Path $templatesOutputDir -Force | Out-Null + } + + write-host "Packing dotnet-new templates (Microsoft.WindowsAppSDK.WinUI.CSharp.Templates) ..." + & dotnet pack "dev\Templates\Dotnet\WinAppSdk.CSharp.DotnetNewTemplates.csproj" ` + --configuration $Configuration ` + --output $templatesOutputDir + if ($lastexitcode -ne 0) + { + write-host "ERROR: dotnet pack WinAppSdk.CSharp.DotnetNewTemplates.csproj FAILED." + exit 1 + } + + # Templates VSIX (Standalone + Component, matching CI). The + # Microsoft.WindowsAppSDK version used for restore comes from + # dev\Templates\Directory.Build.props ( default) + # - single source of truth. + write-host "Building templates VSIX (Standalone + Component) ..." + & "dev\Templates\VSIX\build-local-VSIX-package\Build-VSIX-Local.ps1" ` + -Configuration $Configuration ` + -Deployment Both ` + -RepoRoot $env:Build_SourcesDirectory ` + -OutputDir $templatesOutputDir + if ($lastexitcode -ne 0) + { + write-host "ERROR: Build-VSIX-Local.ps1 FAILED." + exit 1 + } + } $files = Get-ChildItem $OutputDirectory -File -Filter "*.nupkg" foreach ($file in $files) { diff --git a/Directory.Packages.props b/Directory.Packages.props index 1404733052..797eaee6fa 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -46,10 +46,10 @@ ValueOrDefault resolves to $(WindowsAppSDKVersionPinned) when set (mono-build), otherwise falls back to the pinned version literal. --> - $([MSBuild]::ValueOrDefault('$(WindowsAppSDKVersionPinned)', '2.0.3-dev.experimental1')) - $([MSBuild]::ValueOrDefault('$(WindowsAppSDKVersionPinned)', '3.0.0-experimental-27300.1866.260419-1600.1')) - $([MSBuild]::ValueOrDefault('$(WindowsAppSDKVersionPinned)', '3.0.0-experimental-27300.1866.260419-1600.1')) - $([MSBuild]::ValueOrDefault('$(WindowsAppSDKVersionPinned)', '3.0.0-experimental-Rolling.20260419.2')) + $([MSBuild]::ValueOrDefault('$(WindowsAppSDKVersionPinned)', '2.0.6-dev.experimental1')) + $([MSBuild]::ValueOrDefault('$(WindowsAppSDKVersionPinned)', '3.0.0-experimental-27300.1878.260525-0800.0')) + $([MSBuild]::ValueOrDefault('$(WindowsAppSDKVersionPinned)', '3.0.0-experimental-27300.1878.260525-0800.0')) + $([MSBuild]::ValueOrDefault('$(WindowsAppSDKVersionPinned)', '3.0.0-experimental-Rolling.20260525.1')) $([MSBuild]::ValueOrDefault('$(WindowsAppSDKVersionPinned)', '1.7.0-main.20241009.0')) diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-BuildInstaller-Steps.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-BuildInstaller-Steps.yml index 03a9863a44..8779166963 100644 --- a/build/AzurePipelinesTemplates/WindowsAppSDK-BuildInstaller-Steps.yml +++ b/build/AzurePipelinesTemplates/WindowsAppSDK-BuildInstaller-Steps.yml @@ -23,7 +23,7 @@ parameters: # preserves the legacy name so non-monobuild callers don't need to opt in. - name: artifactName type: string - default: 'WindowsAppSDK_Nuget_And_MSIX' + default: 'WindowsAppSDK-NuGet-And-MSIX' # When true, skip the artifact download step entirely. The caller is responsible # for ensuring $(parameters.artifactName) content is already present at # $(System.ArtifactsDirectory) before this template's first MSBuild step. Used by @@ -34,6 +34,12 @@ parameters: - name: SkipArtifactDownload type: boolean default: false +# Branch (in the Aggregator pipeline's repo) to pull the latest Windows App SDK +# nuget from when UseCurrentBuild is false. The Aggregator nightly runs daily on +# 'main', so default there. Override if the active publishing branch changes. +- name: NightlyBranchName + type: string + default: 'refs/heads/release/dev/monobuild' steps: - task: PowerShell@2 @@ -69,19 +75,28 @@ steps: condition: and(succeeded(), ne(variables.SkipInstallerBuild, true)) - ${{ else }}: ### - # This step downloads the WindowsAppSDK NuGet package from a pipeline - # variables: OfficialPipelineID LatestOfficialBuildID - # for use in building the Installers + # This step downloads the WindowsAppSDK NuGet package from the Aggregator nightly + # pipeline (identified by the OfficialPipelineID variable) for use in building the + # VSIX. We pull the latest run from NightlyBranchName rather than a pinned + # LatestOfficialBuildID so PR build-validation runs always get a fresh package without + # needing a build id supplied at queue time. + # + # The nightly runs commonly finish as PartiallySucceeded (some downstream test/SDL + # stages are not green) even though the packaging stage produced the artifact, so + # both allowPartiallySucceededBuilds and allowFailedBuilds must be true -- the task + # requires the pair to be set together to consider non-succeeded runs. - task: DownloadPipelineArtifact@2 displayName: 'Download WindowsAppSDK From Latest Nightly' inputs: artifactName: ${{ parameters.artifactName }} targetPath: '$(System.ArtifactsDirectory)' source: 'specific' - project: 55e8140e-57ac-4e5f-8f9c-c7c15b51929d # TODO: replace with $(System.TeamProjectId) once we can have a full WinAppSDK Build on the new mono repo - pipeline: $(OfficialPipelineID) - pipelineId: $(LatestOfficialBuildID) - condition: and(succeeded(), ne(variables.SkipInstallerBuild, true)) + project: $(System.TeamProjectId) + pipeline: 190463 + runVersion: 'latestFromBranch' + runBranch: '${{ parameters.NightlyBranchName }}' + allowPartiallySucceededBuilds: true + allowFailedBuilds: true ### # Install the internal licensing support for release-signed packages. This can always be present in diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-BuildVSIX-Steps.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-BuildVSIX-Steps.yml index eefcce41cf..ff7a11fbf7 100644 --- a/build/AzurePipelinesTemplates/WindowsAppSDK-BuildVSIX-Steps.yml +++ b/build/AzurePipelinesTemplates/WindowsAppSDK-BuildVSIX-Steps.yml @@ -31,7 +31,7 @@ parameters: # preserves the legacy name so non-monobuild callers don't need to opt in. - name: artifactName type: string - default: 'WindowsAppSDK_Nuget_And_MSIX' + default: 'WindowsAppSDK-NuGet-And-MSIX' # When true, skip the artifact download step entirely. The caller is responsible # for ensuring $(parameters.artifactName) content is already present at # $(System.ArtifactsDirectory) before ExtractWindowsAppSDKVersion runs. Used by @@ -41,6 +41,17 @@ parameters: - name: SkipArtifactDownload type: boolean default: false +# Defaults true to preserve official-build behavior. +# Set to false in PR build-validation runs to skip pushing to the symbol server. +- name: PublishSymbols + type: boolean + default: true +# Branch (in the Aggregator pipeline's repo) to pull the latest Windows App SDK +# nuget from when UseCurrentBuild is false. The Aggregator nightly runs daily on +# 'main', so default there. Override if the active publishing branch changes. +- name: NightlyBranchName + type: string + default: 'refs/heads/release/dev/monobuild' steps: - ${{ if eq(parameters.SkipArtifactDownload, false) }}: @@ -52,19 +63,29 @@ steps: targetPath: '$(System.ArtifactsDirectory)' - ${{ else }}: ### - # This step downloads the WindowsAppSDK NuGet package from a pipeline - # variables: OfficialPipelineID LatestOfficialBuildID - # for use in building the VSIX + # This step downloads the WindowsAppSDK NuGet package from the Aggregator nightly + # pipeline (identified by the OfficialPipelineID variable) for use in building the + # VSIX. We pull the latest run from NightlyBranchName rather than a pinned + # LatestOfficialBuildID so PR build-validation runs always get a fresh package without + # needing a build id supplied at queue time. + # + # The nightly runs commonly finish as PartiallySucceeded (some downstream test/SDL + # stages are not green) even though the packaging stage produced the artifact, so + # both allowPartiallySucceededBuilds and allowFailedBuilds must be true -- the task + # requires the pair to be set together to consider non-succeeded runs. - task: DownloadPipelineArtifact@2 displayName: 'Download WindowsAppSDK From Latest Nightly' inputs: artifactName: ${{ parameters.artifactName }} targetPath: '$(System.ArtifactsDirectory)' source: 'specific' - project: 55e8140e-57ac-4e5f-8f9c-c7c15b51929d # TODO: replace with $(System.TeamProjectId) once we can have a full WinAppSDK Build on the new mono repo - pipeline: $(OfficialPipelineID) - pipelineId: $(LatestOfficialBuildID) - + project: $(System.TeamProjectId) + pipeline: 190463 + runVersion: 'latestFromBranch' + runBranch: '${{ parameters.NightlyBranchName }}' + allowPartiallySucceededBuilds: true + allowFailedBuilds: true + - task: PowerShell@2 name: ExtractWindowsAppSDKVersion displayName: Extract WindowsAppSDKVersion @@ -113,7 +134,7 @@ steps: - task: VSBuild@1 displayName: 'Restore WindowsAppSDK.Extension.sln' inputs: - solution: $(FoundationRepoPath)dev\VSIX\WindowsAppSDK.Extension.sln + solution: $(FoundationRepoPath)dev\Templates\VSIX\WindowsAppSDK.Extension.sln platform: 'Any CPU' configuration: '$(buildConfiguration)' msBuildArgs: '/t:restore /p:OptionalVSIXVersion="${{ parameters.OptionalVSIXVersion }}" /p:WindowsAppSDKVersion="$(WindowsAppSDKPackageVersion)" /p:RestoreAdditionalProjectSources="$(System.ArtifactsDirectory)" /p:EnableExperimentalVSIXFeatures="${{ parameters.EnableExperimentalVSIXFeatures }}" /binaryLogger:$(ob_outputDirectory)\binlogs\StandaloneVSIX.restore.binlog' @@ -121,7 +142,7 @@ steps: - task: VSBuild@1 displayName: 'Build Standalone WindowsAppSDK.Extension.sln' inputs: - solution: $(FoundationRepoPath)dev\VSIX\WindowsAppSDK.Extension.sln + solution: $(FoundationRepoPath)dev\Templates\VSIX\WindowsAppSDK.Extension.sln platform: 'Any CPU' configuration: '$(buildConfiguration)' msBuildArgs: '/p:OptionalVSIXVersion="${{ parameters.OptionalVSIXVersion }}" /p:WindowsAppSDKVersion="$(WindowsAppSDKPackageVersion)" /p:EnableExperimentalVSIXFeatures="${{ parameters.EnableExperimentalVSIXFeatures }}" /binaryLogger:$(ob_outputDirectory)\binlogs\StandaloneVSIX.build.binlog' @@ -147,7 +168,7 @@ steps: - task: VSBuild@1 displayName: 'Restore Component WindowsAppSDK.Extension.sln' inputs: - solution: $(FoundationRepoPath)dev\VSIX\WindowsAppSDK.Extension.sln + solution: $(FoundationRepoPath)dev\Templates\VSIX\WindowsAppSDK.Extension.sln platform: 'Any CPU' configuration: '$(buildConfiguration)' msBuildArgs: '/t:restore /p:OptionalVSIXVersion="${{ parameters.OptionalVSIXVersion }}" /p:WindowsAppSDKVersion="$(WindowsAppSDKPackageVersion)" /p:RestoreAdditionalProjectSources="$(System.ArtifactsDirectory)" /p:EnableExperimentalVSIXFeatures="${{ parameters.EnableExperimentalVSIXFeatures }}" /binaryLogger:$(ob_outputDirectory)\binlogs\ComponentVSIX.restore.binlog' @@ -155,7 +176,7 @@ steps: - task: VSBuild@1 displayName: 'Build Component WindowsAppSDK.Extension.sln' inputs: - solution: $(FoundationRepoPath)dev\VSIX\WindowsAppSDK.Extension.sln + solution: $(FoundationRepoPath)dev\Templates\VSIX\WindowsAppSDK.Extension.sln platform: 'Any CPU' configuration: '$(buildConfiguration)' msBuildArgs: '/restore /p:OptionalVSIXVersion="${{ parameters.OptionalVSIXVersion }}" /p:WindowsAppSDKVersion="$(WindowsAppSDKPackageVersion)" /p:EnableExperimentalVSIXFeatures="${{ parameters.EnableExperimentalVSIXFeatures }}" /p:Deployment="Component" /binaryLogger:$(ob_outputDirectory)\binlogs\ComponentVSIX.build.binlog' @@ -188,7 +209,7 @@ steps: - task: CopyFiles@2 displayName: 'Stage unsigned VSIX files for publishing' inputs: - SourceFolder: '$(FoundationRepoPath)dev\VSIX\BuildOutput\obj\AnyCPU$(buildConfiguration)' + SourceFolder: '$(FoundationRepoPath)dev\Templates\VSIX\BuildOutput\obj\AnyCPU$(buildConfiguration)' Contents: '**/WindowsAppSDK.*.vsix' flattenFolders: true TargetFolder: '$(ob_outputDirectory)\VSIX' @@ -197,7 +218,7 @@ steps: - task: CopyFiles@2 displayName: 'Stage unsigned VSIX files for signing' inputs: - SourceFolder: '$(FoundationRepoPath)dev\VSIX\BuildOutput\obj\AnyCPU$(buildConfiguration)' + SourceFolder: '$(FoundationRepoPath)dev\Templates\VSIX\BuildOutput\obj\AnyCPU$(buildConfiguration)' Contents: '**/WindowsAppSDK.*.vsix' flattenFolders: true TargetFolder: '$(Agent.TempDirectory)/UnsignedVSIX' @@ -221,13 +242,13 @@ steps: parameters: IsMonobuild: ${{ parameters.IsMonobuild }} InnerParams: - SearchPattern: '$(FoundationRepoPath)dev\VSIX\BuildOutput\obj\AnyCPU$(buildConfiguration)\**\WindowsAppSDK*.pdb' + SearchPattern: '$(FoundationRepoPath)dev\Templates\VSIX\BuildOutput\obj\AnyCPU$(buildConfiguration)\**\WindowsAppSDK*.pdb' IsOfficial: ${{ parameters.IsOfficial }} - task: CopyFiles@2 displayName: 'Stage VSIX component JSONs' inputs: - SourceFolder: '$(FoundationRepoPath)dev\VSIX\BuildOutput\obj\AnyCPU$(buildConfiguration)' + SourceFolder: '$(FoundationRepoPath)dev\Templates\VSIX\BuildOutput\obj\AnyCPU$(buildConfiguration)' Contents: '**/WindowsAppSDK*.pdb' flattenFolders: true TargetFolder: '$(ob_outputDirectory)\symbols' @@ -235,7 +256,7 @@ steps: - task: CopyFiles@2 displayName: 'Stage VSIX component JSONs' inputs: - SourceFolder: '$(FoundationRepoPath)dev\VSIX\BuildOutput\obj\AnyCPU$(buildConfiguration)' + SourceFolder: '$(FoundationRepoPath)dev\Templates\VSIX\BuildOutput\obj\AnyCPU$(buildConfiguration)' Contents: '**/WindowsAppSDK.*.Component.json' flattenFolders: true TargetFolder: '$(ob_outputDirectory)' @@ -243,7 +264,7 @@ steps: - task: CopyFiles@2 displayName: 'Stage VSIX manifest' inputs: - SourceFolder: '$(FoundationRepoPath)dev\VSIX' + SourceFolder: '$(FoundationRepoPath)dev\Templates\VSIX' Contents: 'extension.manifest.json' flattenFolders: true TargetFolder: '$(ob_outputDirectory)' @@ -251,7 +272,7 @@ steps: - task: CopyFiles@2 displayName: 'Stage VSIX overview markdown' inputs: - SourceFolder: '$(FoundationRepoPath)dev\VSIX' + SourceFolder: '$(FoundationRepoPath)dev\Templates\VSIX' Contents: 'overview.md' flattenFolders: true TargetFolder: '$(ob_outputDirectory)' diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-DotnetNewTemplates-Publish-Stage.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-DotnetNewTemplates-Publish-Stage.yml new file mode 100644 index 0000000000..afd8fe1d3b --- /dev/null +++ b/build/AzurePipelinesTemplates/WindowsAppSDK-DotnetNewTemplates-Publish-Stage.yml @@ -0,0 +1,53 @@ +parameters: +- name: pool + type: object + default: + vmImage: 'windows-latest' +- name: dependsOnStage + type: string + default: 'DotnetNewTemplates_Build' + +stages: +- stage: DotnetNewTemplates_Publish + displayName: 'Publish dotnet new templates to NuGet.org' + dependsOn: + - ${{ parameters.dependsOnStage }} + jobs: + - job: PublishNuGetOrg + displayName: 'Publish dotnet new template pack to NuGet.org' + pool: ${{ parameters.pool }} + variables: + ob_outputDirectory: '$(Pipeline.Workspace)\drop_DotnetNewTemplates_Build_PackDotnetNewTemplates' + ob_artifactBaseName: 'dotnet-new-template-pack' + dotnetTemplatesArtifactPath: '$(Pipeline.Workspace)\drop_DotnetNewTemplates_Build_PackDotnetNewTemplates' + steps: + - checkout: self + + - download: current + displayName: 'Download dotnet new template pack artifact' + artifact: 'drop_DotnetNewTemplates_Build_PackDotnetNewTemplates' + + - task: PowerShell@2 + displayName: 'Verify dotnet new template pack artifact exists' + inputs: + targetType: inline + script: | + $artifactPath = '$(dotnetTemplatesArtifactPath)' + if (-not (Test-Path $artifactPath)) { + throw "Expected artifact directory '$artifactPath' was not found in the downloaded drop artifact." + } + $packages = Get-ChildItem -Path $artifactPath -Filter *.nupkg -File -Recurse + if (-not $packages) { + throw "No .nupkg files were found under '$artifactPath'." + } + Write-Host "Found the following packages ready for publish:" + $packages | ForEach-Object { Write-Host " - $($_.FullName)" } + + - task: 333b11bd-d341-40d9-afcf-b32d5ce6f23b@2 + displayName: 'Publish dotnet new templates to NuGet.org' + inputs: + command: 'push' + packagesToPush: '$(dotnetTemplatesArtifactPath)\*.nupkg' + verbosityPush: 'Detailed' + nuGetFeedType: 'external' + publishFeedCredentials: 'NugetOrg' diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-DotnetNewTemplates-Stages.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-DotnetNewTemplates-Stages.yml new file mode 100644 index 0000000000..b95e01f9ff --- /dev/null +++ b/build/AzurePipelinesTemplates/WindowsAppSDK-DotnetNewTemplates-Stages.yml @@ -0,0 +1,154 @@ +parameters: +- name: pool + type: object + default: + vmImage: 'windows-latest' +- name: sourceSubdirectory + type: string + default: 'WindowsAppSDK' +- name: publishToInternalFeed + type: boolean + default: true +- name: SignOutput + type: boolean + default: false +# PR pipelines pass true so every pack (including manual replays without a +# PR#) gets a timestamp + pr suffix that makes the .nupkg filename +# uniquely identify the run. Official pipelines leave this false so the +# pack version matches the csproj verbatim. +- name: IsPRBuild + type: boolean + default: false + +stages: +- stage: DotnetNewTemplates_Build + displayName: 'Build and pack dotnet new templates' + dependsOn: [] + jobs: + - job: PackDotnetNewTemplates + displayName: 'Pack dotnet new template NuGet' + dependsOn: [] + pool: ${{ parameters.pool }} + variables: + ob_outputDirectory: '$(Build.ArtifactStagingDirectory)\dotnet-new-template-pack' + templateProjectDir: '$(Build.SourcesDirectory)\${{ parameters.sourceSubdirectory }}\dev\Templates\Dotnet' + # Set by the "Compute package version" step below. + PackVersionFull: '' + steps: + - checkout: self + + - task: PowerShell@2 + displayName: 'Ensure test certificate for signing' + inputs: + targetType: inline + workingDirectory: '$(Build.SourcesDirectory)\${{ parameters.sourceSubdirectory }}' + script: | + $repoRoot = "$(Build.SourcesDirectory)\${{ parameters.sourceSubdirectory }}" + $userDir = Join-Path $repoRoot '.user' + $pfxPath = Join-Path $userDir 'winappsdk.certificate.test.pfx' + $pwdPath = Join-Path $userDir 'winappsdk.certificate.test.pwd' + + if (-not (Test-Path $userDir)) { + New-Item -ItemType Directory -Path $userDir | Out-Null + } + + if ((Test-Path $pfxPath) -and (Test-Path $pwdPath)) { + Write-Host "Test certificate already exists at $pfxPath" + } + else { + $password = [Guid]::NewGuid().ToString() + $securePwd = ConvertTo-SecureString -String $password -Force -AsPlainText + $subject = 'CN=WindowsAppSDK Test Certificate' + $cert = New-SelfSignedCertificate -Type CodeSigningCert -Subject $subject -KeyExportPolicy Exportable -KeyAlgorithm RSA -KeyLength 2048 -CertStoreLocation 'Cert:\CurrentUser\My' + Export-PfxCertificate -Cert $cert -FilePath $pfxPath -Password $securePwd | Out-Null + Set-Content -Path $pwdPath -Value $password -NoNewline + Write-Host "Created test certificate at $pfxPath" + } + + - task: UseDotNet@2 + displayName: 'Use .NET SDK' + inputs: + packageType: sdk + version: '8.0.x' + + - task: PowerShell@2 + displayName: 'Verify template csproj exists before restore' + inputs: + targetType: inline + workingDirectory: '$(templateProjectDir)' + script: | + Write-Host "Current directory: $(Get-Location)" + $projectPath = Join-Path (Get-Location) 'WinAppSdk.CSharp.DotnetNewTemplates.csproj' + if (-not (Test-Path $projectPath)) { + throw "Template project missing at $projectPath" + } + Write-Host "Confirmed template project at $projectPath" + + - task: DotNetCoreCLI@2 + displayName: 'Restore template project' + inputs: + command: 'restore' + projects: '$(templateProjectDir)\WinAppSdk.CSharp.DotnetNewTemplates.csproj' + workingDirectory: '$(templateProjectDir)' + + # PR builds always get a unique SemVer prerelease tag appended: + # ----pr + # Manual PR-pipeline replays (no SYSTEM_PULLREQUEST_PULLREQUESTNUMBER) + # use pr0 so the filename still differentiates runs by timestamp. + # Official builds (IsPRBuild=false) keep the csproj verbatim. + - task: PowerShell@2 + displayName: 'Compute package version' + inputs: + targetType: inline + workingDirectory: '$(templateProjectDir)' + script: | + $csprojPath = Join-Path '$(templateProjectDir)' 'WinAppSdk.CSharp.DotnetNewTemplates.csproj' + [xml]$csproj = Get-Content -LiteralPath $csprojPath + $versionNode = Select-Xml -Xml $csproj -XPath '/Project/PropertyGroup/Version' | Select-Object -First 1 + if (-not $versionNode) { throw "No element found in $csprojPath" } + $baseVersion = $versionNode.Node.InnerText.Trim() + if ([string]::IsNullOrWhiteSpace($baseVersion)) { throw "csproj is empty in $csprojPath" } + $isPR = [System.Convert]::ToBoolean('${{ parameters.IsPRBuild }}') + if ($isPR) { + $pr = $env:SYSTEM_PULLREQUEST_PULLREQUESTNUMBER + if ([string]::IsNullOrWhiteSpace($pr)) { $pr = '0' } + $now = Get-Date + $stamp = "$($now.ToString('yyyy'))-$($now.ToString('MMdd'))-$($now.ToString('HHmm'))-pr$pr" + # Join with '-' so any prerelease tag already in stays one valid SemVer identifier. + $fullVersion = "$baseVersion-$stamp" + } else { + $fullVersion = $baseVersion + } + Write-Host "Computed package version: $fullVersion" + Write-Host "##vso[task.setvariable variable=PackVersionFull]$fullVersion" + + # DotNetCoreCLI@2 'pack' ignores 'arguments'; properties go via 'buildProperties'. + - task: DotNetCoreCLI@2 + displayName: 'Pack dotnet new templates' + inputs: + command: 'pack' + packagesToPack: '$(templateProjectDir)\WinAppSdk.CSharp.DotnetNewTemplates.csproj' + buildProperties: 'WindowsAppSDKBuildPipeline=1;Version=$(PackVersionFull)' + outputDir: '$(ob_outputDirectory)' + workingDirectory: '$(templateProjectDir)' + + - ${{ if eq(parameters.SignOutput, true) }}: + - template: AzurePipelinesTemplates/WindowsAppSDK-EsrpCodeSigning-Steps.yml@WindowsAppSDKConfig + parameters: + FolderPath: '$(ob_outputDirectory)' + Pattern: '*.nupkg' + KeyCode: 'CP-401405' + UseMinimatch: true + + - task: 333b11bd-d341-40d9-afcf-b32d5ce6f23b@2 + displayName: 'Publish dotnet template pack to internal feed' + condition: and(succeeded(), eq('${{ parameters.publishToInternalFeed }}', 'true')) + inputs: + command: 'push' + packagesToPush: '$(ob_outputDirectory)\*.nupkg' + verbosityPush: 'Detailed' + nuGetFeedType: 'internal' + publishVstsFeed: 'ProjectReunion/Project.Reunion.nuget.internal' + allowPackageConflicts: true + + diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-DotnetNewTemplates-Test-Stage.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-DotnetNewTemplates-Test-Stage.yml new file mode 100644 index 0000000000..2b88af3441 --- /dev/null +++ b/build/AzurePipelinesTemplates/WindowsAppSDK-DotnetNewTemplates-Test-Stage.yml @@ -0,0 +1,74 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# +# Stage template: Smoke-test dotnet new templates by scaffolding and building +# each C# project template and all item templates. +# +# This stage runs after DotnetNewTemplates_Build in the main build pipeline +# (WindowsAppSDK-DotnetNewTemplates.yml). It downloads the .nupkg artifact +# produced by the build stage and passes it to Test-DotnetNewTemplates.ps1. + +parameters: +- name: pool + type: object + default: + vmImage: 'windows-latest' +- name: sourceSubdirectory + type: string + default: 'WindowsAppSDK' +- name: dependsOnStage + type: string + default: 'DotnetNewTemplates_Build' +- name: platforms + type: object + default: + - x64 +- name: dotnetSdkVersion + type: string + default: '8.0.x' + +stages: +- stage: DotnetNewTemplates_Test + displayName: 'Smoke-test dotnet new templates' + dependsOn: + - ${{ parameters.dependsOnStage }} + jobs: + - job: TestDotnetNewTemplates + displayName: 'Scaffold and build dotnet new templates' + pool: ${{ parameters.pool }} + timeoutInMinutes: 60 + variables: + ob_outputDirectory: '$(Build.ArtifactStagingDirectory)\test-results' + templateArtifactDir: '$(Pipeline.Workspace)\drop_DotnetNewTemplates_Build_PackDotnetNewTemplates' + steps: + - checkout: self + + - download: current + displayName: 'Download template pack artifact' + artifact: 'drop_DotnetNewTemplates_Build_PackDotnetNewTemplates' + + - task: UseDotNet@2 + displayName: 'Use .NET SDK ${{ parameters.dotnetSdkVersion }}' + inputs: + packageType: sdk + version: '${{ parameters.dotnetSdkVersion }}' + + - task: NuGetAuthenticate@1 + displayName: 'Authenticate NuGet feeds' + + - task: PowerShell@2 + displayName: 'Run template smoke tests' + inputs: + targetType: inline + workingDirectory: '$(Build.SourcesDirectory)\${{ parameters.sourceSubdirectory }}' + script: | + $package = Get-ChildItem -Path '$(templateArtifactDir)' -Filter 'Microsoft.WindowsAppSDK*.nupkg' -Recurse | Select-Object -First 1 + if (-not $package) { + throw "No template .nupkg found under '$(templateArtifactDir)'" + } + Write-Host "Using template package: $($package.FullName)" + $platforms = '${{ join(',', parameters.platforms) }}' -split ',' + & '$(Build.SourcesDirectory)\${{ parameters.sourceSubdirectory }}\dev\Templates\Dotnet\Test-DotnetNewTemplates.ps1' ` + -PackagePath $package.FullName ` + -Platforms $platforms ` + -SkipAppLaunch diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-PackTransportPackage-Stage.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-PackTransportPackage-Stage.yml index 329a850e9b..98fdde6cdc 100644 --- a/build/AzurePipelinesTemplates/WindowsAppSDK-PackTransportPackage-Stage.yml +++ b/build/AzurePipelinesTemplates/WindowsAppSDK-PackTransportPackage-Stage.yml @@ -11,6 +11,18 @@ parameters: - name: "BuildMockWindowsAppSDK" type: boolean default: true +- name: PrOrNightly + displayName: "PR or Nightly" + type: string + default: '' +- name: BuildType + displayName: "Build Type" + type: string + default: 'experimental' +- name: RunUpdateLibraryJob + displayName: "Run the Update Library Variable Group Job" + type: boolean + default: false stages: - stage: Pack @@ -45,4 +57,14 @@ stages: parameters: SignOutput: ${{ parameters.SignOutput }} IsOfficial: ${{ parameters.IsOfficial }} - PublishPackage: ${{ parameters.PublishPackage }} \ No newline at end of file + PublishPackage: ${{ parameters.PublishPackage }} + +- stage: UpdateFoundationLibrary + dependsOn: Pack + condition: and(succeeded('Pack'), eq(${{ parameters.RunUpdateLibraryJob }}, true)) + jobs: + - template: WindowsAppSDK-UpdateLibrary-Job.yml + parameters: + jobName: 'UpdateFoundationLibraryJob' + BuildType: ${{ parameters.BuildType }} + PrOrNightly: ${{ parameters.PrOrNightly }} diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-UpdateLibrary-Job.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-UpdateLibrary-Job.yml new file mode 100644 index 0000000000..b1c637304a --- /dev/null +++ b/build/AzurePipelinesTemplates/WindowsAppSDK-UpdateLibrary-Job.yml @@ -0,0 +1,157 @@ +# This template updates the Azure DevOps Variable Group (Library) for the Open (Foundation) repo +# after a successful official build. It bumps PatchVersion and Revision variables. +# This job should only run on official builds (not PR or Nightly). + +parameters: +- name: jobName + displayName: "Job Name" + type: string + default: 'UpdateFoundationLibraryJob' +- name: BuildType + displayName: "Build Type" + type: string + default: 'stable' +- name: PrOrNightly + displayName: "PR or Nightly" + type: string + default: '' + +jobs: +- job: ${{ parameters.jobName }} + variables: + ob_outputDirectory: '$(REPOROOT)\out' + ob_artifactBaseName: '${{parameters.jobName}}' + pool: + type: windows + displayName: "Update Foundation Variable Group" + steps: + - script: | + echo MajorVersion : $(MajorVersion) + echo MinorVersion : $(MinorVersion) + echo Revision : $(Revision) + echo FoundationMinorVersionResolved : $(FoundationMinorVersionResolved) + echo FoundationPatchVersionResolved : $(FoundationPatchVersionResolved) + echo FoundationLibraryName : $(FoundationLibraryName) + echo NugetBuildTypePrefix : $(NugetBuildTypePrefix) + displayName: 'Variables' + + # Create the next Variable Group if it does not already exist so that when we change the Major version, + # the next build will already have the variable group available. + - task: PowerShell@2 + displayName: Create Next Variable Group if Necessary + env: + AZURE_DEVOPS_EXT_PAT: $(System.AccessToken) + inputs: + targetType: 'inline' + script: | + $NextMajorVersion = [int]$(MajorVersion) + 1 + $NextLibraryName = "$NextMajorVersion-Foundation-Versions" + + echo "Next Major Version will be $NextMajorVersion, so next Variable Group will be $NextLibraryName" + echo "Checking to see if the next Variable Group exists" + $groupExists = az pipelines variable-group list --query "[?name=='$NextLibraryName']" | ConvertFrom-Json + if ($groupExists.Count -eq 0) + { + echo "Creating Variable Group $NextLibraryName" + az pipelines variable-group create --name "$NextLibraryName" --description "Variable group for Windows App SDK Foundation Major Version $NextMajorVersion" --authorize --variables FoundationMinorVersion=0 FoundationPatchVersion=0 FoundationPreviewRevision=0 FoundationExperimentalRevision=0 + } + else + { + echo "Variable Group $NextLibraryName already exists" + } + + - task: PowerShell@2 + condition: and(ne(variables.FoundationMinorVersionResolved, variables.MinorVersion), eq('${{ parameters.PrOrNightly }}', '')) + displayName: Update FoundationMinorVersion in Variable Group + env: + AZURE_DEVOPS_EXT_PAT: $(System.AccessToken) + inputs: + targetType: 'inline' + script: | + echo "Updating Foundation Minor Version variable in Variable Group" + $group_id = $(az pipelines variable-group list -p $(System.TeamProject) --group-name $(FoundationLibraryName) --query '[0].id' -o json) + az pipelines variable-group variable update --group-id $group_id --name FoundationMinorVersion --value $(MinorVersion) + + - task: PowerShell@2 + condition: eq('${{ parameters.PrOrNightly }}', '') + displayName: Update PreviewRevision in Variable Group + env: + AZURE_DEVOPS_EXT_PAT: $(System.AccessToken) + inputs: + targetType: 'inline' + script: | + echo "Determining if we need to update FoundationPreviewRevision variable in Variable Group" + $NextPreviewRevision = [int]$(FoundationPreviewRevisionResolved) + if ("${{ parameters.BuildType }}" -eq 'preview') + { + $NextPreviewRevision = $NextPreviewRevision + 1 + } + + if ($NextPreviewRevision -ne '$(FoundationPreviewRevision)') + { + echo "Updating FoundationPreviewRevision variable in Variable Group to $NextPreviewRevision" + $group_id = $(az pipelines variable-group list -p $(System.TeamProject) --group-name $(FoundationLibraryName) --query '[0].id' -o json) + az pipelines variable-group variable update --group-id $group_id --name FoundationPreviewRevision --value $NextPreviewRevision + } + else + { + echo "No update needed for FoundationPreviewRevision variable in Variable Group" + } + + - task: PowerShell@2 + condition: eq('${{ parameters.PrOrNightly }}', '') + displayName: Update ExperimentalRevision in Variable Group + env: + AZURE_DEVOPS_EXT_PAT: $(System.AccessToken) + inputs: + targetType: 'inline' + script: | + echo "Determining if we need to update FoundationExperimentalRevision variable in Variable Group" + $NextExperimentalRevision = [int]$(FoundationExperimentalRevisionResolved) + if ("${{ parameters.BuildType }}" -eq "experimental") + { + $NextExperimentalRevision = $NextExperimentalRevision + 1 + } + + if ($NextExperimentalRevision -ne '$(FoundationExperimentalRevision)') + { + echo "Updating FoundationExperimentalRevision variable in Variable Group to $NextExperimentalRevision" + $group_id = $(az pipelines variable-group list -p $(System.TeamProject) --group-name $(FoundationLibraryName) --query '[0].id' -o json) + az pipelines variable-group variable update --group-id $group_id --name FoundationExperimentalRevision --value $NextExperimentalRevision + } + else + { + echo "No update needed for FoundationExperimentalRevision variable in Variable Group" + } + + - task: PowerShell@2 + condition: eq('${{ parameters.PrOrNightly }}', '') + displayName: Update FoundationPatchVersion in Variable Group + env: + AZURE_DEVOPS_EXT_PAT: $(System.AccessToken) + inputs: + targetType: 'inline' + script: | + echo "Determining if we need to update FoundationPatchVersion variable in Variable Group" + $NextPatchVersion = "$(FoundationPatchVersionResolved)" + + # Bump patch on stable official builds (when NugetBuildTypePrefix is empty, meaning not PR/Nightly) + if (("${{ parameters.BuildType }}" -eq "stable") -And ('$(NugetBuildTypePrefix)' -eq '')) + { + $NextPatchVersion = [int]$NextPatchVersion + 1 + } + elseif ((($(FoundationMinorVersionResolved) -ne 0) -Or ($(FoundationPatchVersionResolved) -ne 0)) -And ('$(NugetBuildTypePrefix)' -eq '')) + { + $NextPatchVersion = [int]$NextPatchVersion + 1 + } + + if ($NextPatchVersion -ne '$(FoundationPatchVersion)') + { + echo "Updating FoundationPatchVersion variable in Variable Group to $NextPatchVersion" + $group_id = $(az pipelines variable-group list -p $(System.TeamProject) --group-name $(FoundationLibraryName) --query '[0].id' -o json) + az pipelines variable-group variable update --group-id $group_id --name FoundationPatchVersion --value $NextPatchVersion + } + else + { + echo "No update needed for FoundationPatchVersion variable in Variable Group" + } diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-VSIXTemplates-BuildValidation-Stage.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-VSIXTemplates-BuildValidation-Stage.yml new file mode 100644 index 0000000000..b922e8de27 --- /dev/null +++ b/build/AzurePipelinesTemplates/WindowsAppSDK-VSIXTemplates-BuildValidation-Stage.yml @@ -0,0 +1,111 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# +# VSIX templates build-validation stage. +# +# Runs WindowsAppSDK-BuildVSIX-Steps.yml so any VSIX-pack regression +# (VSSDK1300 path overflow, broken template asset, manifest error, etc.) +# surfaces at PR time. This validates that the VSIXes still build and pack; +# it does not install or instantiate them, so it is a build regression check +# rather than a smoke/build-verification test. Skips: +# - SDL/PREfast scans (runStaticAnalysis: false) +# - VSIX code signing (SignOutput: false) +# - Symbol server publish (PublishSymbols: false) +# +# Path-length note: VSSDK1300 is a MAX_PATH (260) issue. We check the repo +# out into a WindowsAppSDK\ subfolder (`path: s\WindowsAppSDK` paired with +# `foundationRepoPath: 'WindowsAppSDK\'`) so absolute paths in this stage +# are long enough to catch the same class of regression that a top-level +# checkout layout would miss. + +parameters: +- name: pool + type: object + default: + type: windows + +stages: +- stage: VSIXTemplates_BuildValidation + displayName: 'Validate VSIX templates build' + dependsOn: [] + jobs: + - job: BuildVSIX + displayName: 'Restore + build WindowsAppSDK.Extension.sln (Standalone + Component)' + pool: ${{ parameters.pool }} + timeoutInMinutes: 60 + variables: + # Required by OneBranch v2. + ob_outputDirectory: '$(Build.ArtifactStagingDirectory)\vsix-buildvalidation' + # Path prefix consumed as $(FoundationRepoPath) inside + # WindowsAppSDK-BuildVSIX-Steps.yml; pairs with the `path: s\WindowsAppSDK` + # checkout below. See file header for why. + foundationRepoPath: 'WindowsAppSDK\' + buildConfiguration: 'Release' + steps: + # Land the repo in a subfolder; see file header for why. + - checkout: self + path: s\WindowsAppSDK + + - task: PowerShell@2 + displayName: 'Compute VSIX version + announce build-validation scope' + inputs: + targetType: 'inline' + script: | + # .... Mirrors Build-VSIX-Local.ps1. + # All segments fit uint16; year-as-Major outranks any official 1.x/2.x + # (workload-shipped) and is strictly monotonic across years. A tester who + # installs a PR VSIX must uninstall it before any official update of + # the same Identity Id will apply. + $now = Get-Date + $pr = $env:SYSTEM_PULLREQUEST_PULLREQUESTNUMBER + if ([string]::IsNullOrWhiteSpace($pr)) { $pr = '0' } + $version = "$($now.Year).$($now.ToString('MMdd')).$($now.ToString('HHmm')).$pr" + Write-Host "##vso[task.setvariable variable=OptionalVSIXVersion]$version" + + Write-Host "VSIX build validation: building Cpp + Cs, Standalone + Component (4 VSIXes)" + Write-Host "VSIX version: $version" + Write-Host "Pool : $(Agent.MachineName) ($(Agent.OS))" + Write-Host "Sources dir : $(Build.SourcesDirectory)" + Write-Host "Repo path : $(Build.SourcesDirectory)\$(foundationRepoPath)" + + - template: WindowsAppSDK-BuildVSIX-Steps.yml@self + parameters: + SignOutput: false + runStaticAnalysis: false + PublishSymbols: false + UseCurrentBuild: false + IsOfficial: false + OptionalVSIXVersion: '$(OptionalVSIXVersion)' + + - task: PowerShell@2 + displayName: 'Rename staged VSIXes to include version (PR-downloadable artifacts)' + # BuildVSIX-Steps.yml already staged the .vsix files into + # $(ob_outputDirectory)\VSIX (unsigned branch). Default MSBuild output + # names omit the version, so testers downloading the PR artifact would + # see only `WindowsAppSDK.Cs.Extension.Dev17.Standalone.vsix`. Rename in + # place to the same `..vsix` shape Build-VSIX-Local.ps1 uses, + # so the filename alone identifies which PR/run produced the VSIX. + inputs: + targetType: 'inline' + script: | + $version = '$(OptionalVSIXVersion)' + $stageDir = Join-Path '$(ob_outputDirectory)' 'VSIX' + if (-not (Test-Path $stageDir)) { + Write-Warning "Staging dir not found: $stageDir (BuildVSIX-Steps.yml staging may have failed)" + exit 0 + } + $vsixes = Get-ChildItem -Path $stageDir -Filter 'WindowsAppSDK.*.vsix' -File + if ($vsixes.Count -eq 0) { + Write-Warning "No .vsix files found in $stageDir" + exit 0 + } + foreach ($v in $vsixes) { + # Skip if already versioned (idempotent re-run safety). + if ($v.BaseName -match "\.$([Regex]::Escape($version))$") { + Write-Host "Skip (already versioned): $($v.Name)" + continue + } + $newName = "$($v.BaseName).$version.vsix" + Rename-Item -Path $v.FullName -NewName $newName + Write-Host "Renamed: $($v.Name) -> $newName" + } diff --git a/build/AzurePipelinesTemplates/WindowsAppSDK-VersionVariables.yml b/build/AzurePipelinesTemplates/WindowsAppSDK-VersionVariables.yml new file mode 100644 index 0000000000..2f911a5a60 --- /dev/null +++ b/build/AzurePipelinesTemplates/WindowsAppSDK-VersionVariables.yml @@ -0,0 +1,52 @@ +# This template loads version variables from a per-major-version Azure DevOps Library +# for the Open (Foundation) repo. It mirrors the pattern from the Aggregator repo's +# WindowsAppSDK-VersionVariables.yml but uses a separate "Foundation-Versions" library. +# +# Variables loaded from the library: +# - FoundationMinorVersion: The minor version for Foundation, tracked independently +# - FoundationPatchVersion: The patch version, incremented on each official build +# - FoundationPreviewRevision: The revision for preview official builds +# - FoundationExperimentalRevision: The revision for experimental official builds +# +# All builds (PR, Nightly, Official) use the Library-based version. Only official builds +# update the Library values. PR/Nightly are distinguished by NugetBuildTypePrefix + Revision. + +parameters: +- name: PrOrNightly + displayName: "PR or Nightly Identifier" + type: string + default: '' +- name: BuildType + displayName: "Build Type" + type: string + default: 'experimental' + +variables: + - template: AzurePipelinesTemplates\WindowsAppSDK-Versions.yml@WindowsAppSDKVersionConfig + - name: FoundationLibraryName + value: ${{ format('{0}-Foundation-Versions', variables.MajorVersion)}} + - group: ${{ variables.FoundationLibraryName }} + - name: FoundationMinorVersionResolved + value: $[coalesce(variables['FoundationMinorVersion'], 0)] + - name: FoundationPatchVersionResolved + value: $[coalesce(variables['FoundationPatchVersion'], 0)] + - name: PRNightlyRevision + value: $[counter(format('{0}-{1}-{2}-{3}', variables.MajorVersion, variables.FoundationMinorVersionResolved, variables.FoundationPatchVersionResolved, variables.NugetBuildTypePrefix), 1)] + - name: FoundationPreviewRevisionResolved + value: $[coalesce(variables['FoundationPreviewRevision'], 0)] + - name: FoundationExperimentalRevisionResolved + value: $[coalesce(variables['FoundationExperimentalRevision'], 0)] + - ${{ if ne(parameters.PrOrNightly, '') }}: + - name: Revision + value: $[variables['PRNightlyRevision']] + - ${{ else }}: + - ${{ if eq(parameters.BuildType, 'experimental') }}: + - name: Revision + value: $[variables['FoundationExperimentalRevisionResolved']] + - ${{ else }}: + - ${{ if eq(parameters.BuildType, 'preview') }}: + - name: Revision + value: $[variables['FoundationPreviewRevisionResolved']] + - ${{ else }}: + - name: Revision + value: "" diff --git a/build/NuSpecs/microsoft.windowsappsdk.foundation-config.cmake b/build/NuSpecs/microsoft.windowsappsdk.foundation-config.cmake index e72f51dd1f..4a6d46ce68 100644 --- a/build/NuSpecs/microsoft.windowsappsdk.foundation-config.cmake +++ b/build/NuSpecs/microsoft.windowsappsdk.foundation-config.cmake @@ -10,9 +10,8 @@ This package defines the following CMake targets: * Microsoft.WindowsAppSDK.Foundation - A target representing the C++/WinRT projection, headers and libraries of - the Windows App SDK Foundation APIs. This does not include the necessary runtime components to use the - Windows App SDK, and is intended to be used by library authors who want to consume the Windows App SDK - Foundation APIs. + the Windows App SDK Foundation APIs. This target does not have any deployment-mode-specific behavior, + however it does forward-declare two variant targets (Foundation_Framework and Foundation_SelfContained) that the wasdk_link_component_variant() helper populates based on the consumer's WindowsAppSDKSelfContained property. * Microsoft.WindowsAppSDK.Foundation_Framework - A target representing the Windows App SDK Foundation APIs for framework-dependent deployment scenarios. Auto-initialization behavior is controlled by target properties @@ -51,7 +50,7 @@ if(CMAKE_VERSION VERSION_LESS 3.31) message(FATAL_ERROR "Microsoft.WindowsAppSDK.Foundation requires at least CMake 3.31, but CMake ${CMAKE_VERSION} is in use.") endif() - +find_package(Microsoft.WindowsAppSDK.Base CONFIG REQUIRED) find_package(Microsoft.WindowsAppSDK.InteractiveExperiences CONFIG REQUIRED) block(SCOPE_FOR VARIABLES) @@ -78,6 +77,17 @@ block(SCOPE_FOR VARIABLES) ${PACKAGE_LOCATION}/include ) + # Forward-declare deployment-mode variant targets adjacent to the basic target. + # Populated further below; this declaration lets wasdk_link_component_variant() enforce + # the contract that both variants exist at configure time. + add_library(Microsoft.WindowsAppSDK.Foundation_Framework INTERFACE) + add_library(Microsoft.WindowsAppSDK.Foundation_SelfContained INTERFACE) + + # Basic target as variant selector + # Resolves to _Framework or _SelfContained based on the consumer's WindowsAppSDKSelfContained + # property at generation time. + wasdk_link_component_variant(Foundation) + #[[==================================================================================================================== Target: Microsoft.WindowsAppSDK.Foundation_DynamicDependencyBootstrap @@ -217,7 +227,7 @@ block(SCOPE_FOR VARIABLES) IMPORTED_LOCATION "${FRAMEWORK_DLLS}" ) - add_library(Microsoft.WindowsAppSDK.Foundation_SelfContained INTERFACE) + # _SelfContained interface target was forward-declared near the basic target above. wasdk_transform_appxfragment( Microsoft.WindowsAppSDK.Foundation_SelfContained @@ -271,7 +281,7 @@ block(SCOPE_FOR VARIABLES) If the Runtime package is not found, _Framework is not available. ====================================================================================================================]]# - add_library(Microsoft.WindowsAppSDK.Foundation_Framework INTERFACE) + # _Framework interface target was forward-declared near the basic target above. target_link_libraries(Microsoft.WindowsAppSDK.Foundation_Framework INTERFACE @@ -353,107 +363,104 @@ block(SCOPE_FOR VARIABLES) ) #[[==================================================================================================================== - wasdk_generate_appx_manifest() - - Generates an AppxManifest.xml for packaged apps. For framework-dependent apps, automatically - includes the entry for the Windows App Runtime Framework package. - - wasdk_generate_appx_manifest( - TARGET - OUTPUT - IDENTITY_NAME - IDENTITY_PUBLISHER - IDENTITY_VERSION - [DISPLAY_NAME ] - [DESCRIPTION ] - [LOGO ] - ) - - The TARGET must already be defined via add_executable(). If the target links - Microsoft.WindowsAppSDK.Foundation_Framework, a for the Windows App Runtime - Framework package is automatically included. If the target links _SelfContained, no - PackageDependency is added. - ====================================================================================================================]]# - function(wasdk_generate_appx_manifest) - set(ONE_VALUE_KEYWORDS TARGET OUTPUT IDENTITY_NAME IDENTITY_PUBLISHER IDENTITY_VERSION DISPLAY_NAME DESCRIPTION LOGO) - cmake_parse_arguments(PARSE_ARGV 0 APPX "" "${ONE_VALUE_KEYWORDS}" "") + Foundation auto-init configuration validation (deferred) - if(NOT APPX_TARGET) - message(FATAL_ERROR "wasdk_generate_appx_manifest: TARGET is required") - endif() - if(NOT APPX_OUTPUT) - set(APPX_OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/AppxManifest.xml") - endif() - if(NOT APPX_IDENTITY_NAME OR NOT APPX_IDENTITY_PUBLISHER OR NOT APPX_IDENTITY_VERSION) - message(FATAL_ERROR "wasdk_generate_appx_manifest: IDENTITY_NAME, IDENTITY_PUBLISHER, and IDENTITY_VERSION are required") - endif() - if(NOT APPX_DISPLAY_NAME) - set(APPX_DISPLAY_NAME "${APPX_IDENTITY_NAME}") + Runs at end of consumer's directory configure. Walks targets that link + any Microsoft.WindowsAppSDK* and validates 2 configuration rules: + + Rule A: FW Unpackaged + WindowsAppSdkBootstrapInitialize=FALSE + → "The Windows App SDK Bootstrapper is required for framework-dependent unpackaged apps" + + Rule B: SelfContained + downlevel SDK (< 19H1) + WindowsAppSdkUndockedRegFreeWinRTInitialize=FALSE + → "Undocked Reg-Free WinRT activation is required for self-contained apps targeting Windows versions prior to 10.0.18362.0" + + Both produce configure-time FATAL_ERROR. This Foundation-side validator only fires when Foundation + IS loaded. + ====================================================================================================================]]# + function(_wasdk_foundation_validate_target target) + get_target_property(_type ${target} TYPE) + if(NOT _type STREQUAL "EXECUTABLE") + return() endif() - if(NOT APPX_DESCRIPTION) - set(APPX_DESCRIPTION "${APPX_DISPLAY_NAME}") + + get_target_property(_link_libs ${target} LINK_LIBRARIES) + if(NOT _link_libs) + return() endif() - if(NOT APPX_LOGO) - set(APPX_LOGO "Logo.png") + set(_uses_wasdk FALSE) + foreach(_lib IN LISTS _link_libs) + if(_lib MATCHES "^Microsoft\\.WindowsAppSDK") + set(_uses_wasdk TRUE) + break() + endif() + endforeach() + if(NOT _uses_wasdk) + return() endif() - # Determine architecture - wasdk_detect_platform() - if(PLATFORM_IDENTIFIER STREQUAL "x64") - set(_PROC_ARCH "x64") - elseif(PLATFORM_IDENTIFIER STREQUAL "arm64") - set(_PROC_ARCH "arm64") - else() - set(_PROC_ARCH "x64") + get_target_property(_pkg_type ${target} WindowsPackageType) + get_target_property(_sc ${target} WindowsAppSDKSelfContained) + get_target_property(_bootstrap ${target} WindowsAppSdkBootstrapInitialize) + get_target_property(_urf ${target} WindowsAppSdkUndockedRegFreeWinRTInitialize) + + # Rule A: FW Unpackaged + BootstrapInit=FALSE → error + if(_pkg_type STREQUAL "None" AND NOT _sc AND _bootstrap STREQUAL "FALSE") + message(FATAL_ERROR + "The Windows App SDK Bootstrapper is required for framework-dependent unpackaged apps. " + "Target '${target}' has WindowsPackageType=\"None\" and " + "WindowsAppSdkBootstrapInitialize=FALSE. Either set " + "WindowsAppSdkBootstrapInitialize=TRUE, change the deployment model, or " + "make the app self-contained.") endif() - # Build the PackageDependency section if framework info is available - set(_PACKAGE_DEPENDENCY "") - if(DEFINED WINDOWSAPPSDK_FRAMEWORK_PACKAGE_NAME) - set(_PACKAGE_DEPENDENCY " \n") + # Rule B: SC + downlevel SDK + URFInit=FALSE → error + if(_sc AND _urf STREQUAL "FALSE") + # Detect the target's MINIMUM supported OS version. + # CMAKE_SYSTEM_VERSION (set via -DCMAKE_SYSTEM_VERSION or by toolchain + # file) is the canonical CMake variable for the target MIN OS version. + # CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION is the BUILD SDK that VS + # selects to compile against (often newer than the target min); not + # what we want for this check. Falls back to env if neither set. + set(_tpv "") + if(NOT "${CMAKE_SYSTEM_VERSION}" STREQUAL "") + set(_tpv "${CMAKE_SYSTEM_VERSION}") + elseif(NOT "${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}" STREQUAL "") + set(_tpv "${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}") + elseif(DEFINED ENV{WindowsSDKVersion}) + string(REGEX REPLACE "^([0-9]+\\.[0-9]+\\.[0-9]+\\.[0-9]+).*" "\\1" _tpv "$ENV{WindowsSDKVersion}") + endif() + if(_tpv AND _tpv VERSION_LESS "10.0.18362.0") + message(FATAL_ERROR + "Undocked Reg-Free WinRT activation is required for self-contained apps targeting Windows versions prior to 10.0.18362.0. " + "Target '${target}' is self-contained, targets SDK version ${_tpv}, and has " + "WindowsAppSdkUndockedRegFreeWinRTInitialize=FALSE. Either remove the " + "explicit FALSE override, raise the target SDK version, or switch to " + "framework-dependent deployment.") + endif() endif() + endfunction() - # Generate the manifest - file(WRITE "${APPX_OUTPUT}" -" - - - - ${APPX_DISPLAY_NAME} - ${APPX_IDENTITY_PUBLISHER} - ${APPX_DESCRIPTION} - ${APPX_LOGO} - - - -${_PACKAGE_DEPENDENCY} - - - - - - - - - - - - - - -") - - # Copy manifest + logo to output directory post-build - add_custom_command(TARGET ${APPX_TARGET} POST_BUILD - COMMAND ${CMAKE_COMMAND} -E copy_if_different "${APPX_OUTPUT}" $ - ) + function(_wasdk_foundation_validate_recursive _dir) + get_directory_property(_targets DIRECTORY ${_dir} BUILDSYSTEM_TARGETS) + foreach(_t IN LISTS _targets) + _wasdk_foundation_validate_target(${_t}) + endforeach() + + get_directory_property(_subdirs DIRECTORY ${_dir} SUBDIRECTORIES) + foreach(_sub IN LISTS _subdirs) + _wasdk_foundation_validate_recursive(${_sub}) + endforeach() + endfunction() + + function(_wasdk_foundation_validate) + _wasdk_foundation_validate_recursive(${CMAKE_CURRENT_SOURCE_DIR}) endfunction() + # Register DEFER hook; idempotent per directory. + get_directory_property(_already_deferred _WASDK_FOUNDATION_VALIDATE_DEFERRED) + if(NOT _already_deferred) + set_property(DIRECTORY PROPERTY _WASDK_FOUNDATION_VALIDATE_DEFERRED TRUE) + cmake_language(DEFER CALL _wasdk_foundation_validate) + endif() + endblock() diff --git a/build/WindowsAppSDK-DotnetNewTemplates-Publish.yml b/build/WindowsAppSDK-DotnetNewTemplates-Publish.yml new file mode 100644 index 0000000000..8a155ae0aa --- /dev/null +++ b/build/WindowsAppSDK-DotnetNewTemplates-Publish.yml @@ -0,0 +1,100 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. +# +# Standalone (non-OneBranch) pipeline for publishing dotnet new templates to NuGet.org. +# This pipeline is separate from the OneBranch build pipeline because OneBranch agents +# block outbound internet access, which prevents pushing packages to NuGet.org. +# +# Usage: +# 1. Run the OneBranch build pipeline (WindowsAppSDK-DotnetNewTemplates.yml) first. +# 2. Note the build ID from that run. +# 3. Run this pipeline, providing the build ID as a parameter. + +trigger: none + +parameters: +- name: "BuildPipelineId" + displayName: "Build pipeline definition ID (from WindowsAppSDK-DotnetNewTemplates pipeline)" + type: number + default: 186691 +- name: "BuildRunId" + displayName: "Build run ID to download artifact from" + type: number +- name: "ArtifactName" + displayName: "Artifact name from the build pipeline" + type: string + default: 'drop_DotnetNewTemplates_Build_PackDotnetNewTemplates' + +variables: +- template: WindowsAppSDK-CommonVariables.yml + +pool: + vmImage: 'windows-latest' + +stages: +- stage: DotnetNewTemplates_Approval + displayName: 'Approve NuGet.org publish' + jobs: + - job: WaitForPublishApproval + displayName: 'Manual Approval' + pool: server + timeoutInMinutes: 1440 + steps: + - task: ManualValidation@0 + displayName: 'Verify artifacts before NuGet.org publish' + timeoutInMinutes: 1440 + inputs: + notifyUsers: '' + instructions: | + Please verify the .nupkg in the ${{ parameters.ArtifactName }} folder before continuing the publish to NuGet.org: + https://dev.azure.com/microsoft/ProjectReunion/_build/results?buildId=${{ parameters.BuildRunId }}&view=artifacts&pathAsName=false&type=publishedArtifacts + +- stage: DotnetNewTemplates_Publish + displayName: 'Publish dotnet new templates to NuGet.org' + dependsOn: + - DotnetNewTemplates_Approval + jobs: + - job: PublishNuGetOrg + displayName: 'Publish dotnet new template pack to NuGet.org' + pool: + vmImage: 'windows-latest' + variables: + dotnetTemplatesArtifactPath: '$(Pipeline.Workspace)\BuildArtifact' + steps: + - checkout: none + + - task: DownloadPipelineArtifact@2 + displayName: 'Download dotnet new template pack artifact' + inputs: + source: 'specific' + project: '$(System.TeamProjectId)' + pipeline: ${{ parameters.BuildPipelineId }} + runVersion: 'specific' + runId: ${{ parameters.BuildRunId }} + artifact: '${{ parameters.ArtifactName }}' + targetPath: '$(dotnetTemplatesArtifactPath)' + + - task: PowerShell@2 + displayName: 'Verify dotnet new template pack artifact exists' + inputs: + targetType: inline + script: | + $artifactPath = '$(dotnetTemplatesArtifactPath)' + if (-not (Test-Path $artifactPath)) { + throw "Expected artifact directory '$artifactPath' was not found." + } + $packages = Get-ChildItem -Path $artifactPath -Filter *.nupkg -File -Recurse + if (-not $packages) { + throw "No .nupkg files were found under '$artifactPath'." + } + Write-Host "Found the following packages ready for publish:" + $packages | ForEach-Object { Write-Host " - $($_.FullName)" } + + - task: 333b11bd-d341-40d9-afcf-b32d5ce6f23b@2 + displayName: 'Publish dotnet new templates to NuGet.org' + inputs: + command: 'push' + packagesToPush: '$(dotnetTemplatesArtifactPath)\*.nupkg' + verbosityPush: 'Detailed' + nuGetFeedType: 'external' + publishFeedCredentials: 'NugetOrg' diff --git a/build/WindowsAppSDK-DotnetNewTemplates.yml b/build/WindowsAppSDK-DotnetNewTemplates.yml new file mode 100644 index 0000000000..537db0d703 --- /dev/null +++ b/build/WindowsAppSDK-DotnetNewTemplates.yml @@ -0,0 +1,124 @@ +##################################################################################################################################### +# OneBranch Pipelines - Official # +##################################################################################################################################### +# # +# This pipeline was created by EasyStart from a sample located at: # +# https://aka.ms/obpipelines/easystart/samples # +# # +# Windows Undocked Wiki: https://www.osgwiki.com/wiki/Windows_Undocked_Template # +# General OB Documentation: https://aka.ms/obpipelines # +# Build MSBuild project: https://dev.azure.com/onebranch/OneBranch/_wiki/wikis/OneBranch.wiki/6045/Build-MSBuild-project # +# Yaml Schema: https://aka.ms/obpipelines/yaml/schema # +# Retail Tasks: https://aka.ms/obpipelines/tasks # +# Support: https://aka.ms/onebranchsup # +# # +##################################################################################################################################### + +name: $(version) + +# https://aka.ms/obpipelines/triggers +trigger: none + +parameters: +- name: "PublishDotnetNewTemplatesToInternalFeed" + displayName: "Publish dotnet new templates to internal feed" + type: boolean + default: false +- name: "SignOutput" + displayName: "Sign the NuGet package with ESRP" + type: boolean + default: true +variables: +- template: AzurePipelinesTemplates\WindowsAppSDK-Versions.yml@WindowsAppSDKVersionConfig +- template: WindowsAppSDK-CommonVariables.yml + +resources: + repositories: + - repository: templates + type: git + name: OneBranch.Pipelines/GovernedTemplates + ref: refs/heads/main + - repository: WindowsAppSDKConfig + type: git + name: ProjectReunion/WindowsAppSDKConfig + ref: refs/heads/main + - repository: WindowsAppSDKVersionConfig + type: git + name: ProjectReunion/WindowsAppSDKConfig + ref: refs/heads/main + +extends: + template: v2/Microsoft.NonOfficial.yml@templates # https://aka.ms/obpipelines/templates + parameters: + featureFlags: + EnableCDPxPAT: false + WindowsHostVersion: + Version: 2022 + Network: R1 + + platform: + name: 'windows_undocked' # windows undocked + + cloudvault: # Please refer the wiki for more information: https://aka.ms/obpipelines/cloudvault + enabled: false + + globalSdl: # Refer the wiki for more options in this parameter: https://aka.ms/obpipelines/sdl + tsa: + enabled: $(TsaEnabled) # onebranch publish all sdl results to TSA. If TSA is disabled all SDL tools will forced into 'break' build mode. Please provide TSAOptions.json. + isNativeCode: false #TODO turn back on when bug in CheckCFlags2.exe is fixed + suppression: + suppressionFile: $(Build.SourcesDirectory)\.gdn\OneBranch.gdnsuppress + asyncSdl: # https://aka.ms/obpipelines/asyncsdl + enabled: false + psscriptanalyzer: + enable: true + break: true + tsandjs: + enabled: true + break: true + python: + enabled: true + break: true + credscan: + enable: true + break: true + policheck: + enable: true + break: true + binskim: + enabled: true + break: true + analyzeTargetGlob: $(BinskimExclusionForFoundationRepo) + prefast: + enabled: false + break: true + logRootDirectory: '$(Build.SourcesDirectory)' + # Use "severity: 'Warning'" to be more sensitive, break on Warnings+Errors. + # Use "severity: 'Note'" to be even more sensitive, break on Notes+Warnings+Errors. + # Use "severity: 'Default'" to get back to default, i.e., break on Errors. Can't get less sensitive than that. + severity: Default + # Use "exclusionsFile: <>" to apply a local exclusion file. + apiscan: + # We will enable APIScan on a per-job basis downstream as needed. + enabled: false + # TODO: Once we've cleared away all existing errors, consider setting this to true. + break: false + + stages: + - template: AzurePipelinesTemplates\WindowsAppSDK-DotnetNewTemplates-Stages.yml@self + parameters: + pool: + type: windows + publishToInternalFeed: ${{ parameters.PublishDotnetNewTemplatesToInternalFeed }} + SignOutput: ${{ parameters.SignOutput }} + + - template: AzurePipelinesTemplates\WindowsAppSDK-DotnetNewTemplates-Test-Stage.yml@self + parameters: + pool: + type: windows + dependsOnStage: 'DotnetNewTemplates_Build' + + # NuGet.org publishing is handled by the separate non-OneBranch pipeline: + # WindowsAppSDK-DotnetNewTemplates-Publish.yml + # OneBranch agents block outbound internet, so a standalone pipeline with + # standard Azure-hosted agents is used for the NuGet.org push. diff --git a/build/WindowsAppSDK-Foundation-DevTest.yml b/build/WindowsAppSDK-Foundation-DevTest.yml index b6ec1a0cfc..99e523a0aa 100644 --- a/build/WindowsAppSDK-Foundation-DevTest.yml +++ b/build/WindowsAppSDK-Foundation-DevTest.yml @@ -54,11 +54,18 @@ variables: PrOrNightly: 'ci' - template: Build/WindowsAppSDK/AzurePipelinesTemplates/WindowsAppSDK-CommonVariables.yml@WinAppSDK - template: WindowsAppSDK-CommonVariables.yml + parameters: + PrOrNightly: 'devtest' +- template: AzurePipelinesTemplates\WindowsAppSDK-VersionVariables.yml + parameters: + PrOrNightly: 'devtest' - name: maxParallelForBuildSamplesCompatJob_x64 value: 20 - name: maxParallelForBuildSamplesCompatJob_arm64 value: 20 +name: $(MajorVersion).$(FoundationMinorVersionResolved).$(FoundationPatchVersionResolved)-$(NugetBuildTypePrefix)$(channel)$(Revision) + resources: repositories: - repository: templates diff --git a/build/WindowsAppSDK-Foundation-Nightly.yml b/build/WindowsAppSDK-Foundation-Nightly.yml index 4315b4a39b..2f608bf7bd 100644 --- a/build/WindowsAppSDK-Foundation-Nightly.yml +++ b/build/WindowsAppSDK-Foundation-Nightly.yml @@ -67,6 +67,8 @@ variables: - name: maxParallelForBuildSamplesCompatJob_arm64 value: 20 +name: $(MajorVersion).$(FoundationMinorVersionResolved).$(FoundationPatchVersionResolved)-$(NugetBuildTypePrefix)$(channel)$(Revision) + resources: repositories: - repository: templates diff --git a/build/WindowsAppSDK-Foundation-Official.yml b/build/WindowsAppSDK-Foundation-Official.yml index 28f34b7aeb..1a6c489afb 100644 --- a/build/WindowsAppSDK-Foundation-Official.yml +++ b/build/WindowsAppSDK-Foundation-Official.yml @@ -57,6 +57,18 @@ parameters: displayName: "Run WindowsAppSDK-CheckApiChanges stage" type: boolean default: true +- name: BuildType + displayName: "Build Type" + type: string + default: 'experimental' + values: + - 'stable' + - 'experimental' + - 'preview' +- name: RunUpdateLibraryJob + displayName: "Run the Update Library Variable Group Job" + type: boolean + default: true variables: - template: Build/WindowsAppSDK/WindowsAppSDK-Foundation-TestConfig.yml@WinAppSDK @@ -69,6 +81,8 @@ variables: - name: maxParallelForBuildSamplesCompatJob_arm64 value: 20 +name: $(MajorVersion).$(FoundationMinorVersionResolved).$(FoundationPatchVersionResolved)-$(NugetBuildTypePrefix)$(channel)$(Revision) + resources: repositories: - repository: templates @@ -175,6 +189,9 @@ extends: SignOutput: ${{ parameters.SignOutput }} PublishPackage: true IsOfficial: true + PrOrNightly: '' + BuildType: ${{ parameters.BuildType }} + RunUpdateLibraryJob: ${{ parameters.RunUpdateLibraryJob }} - ${{ if eq( parameters.CheckApiChanges, true ) }}: - template: AzurePipelinesTemplates\WindowsAppSDK-CheckApiChanges-Stage.yml@self diff --git a/build/WindowsAppSDK-TDBuild.yml b/build/WindowsAppSDK-TDBuild.yml index e38ddc7856..f7a82fb963 100644 --- a/build/WindowsAppSDK-TDBuild.yml +++ b/build/WindowsAppSDK-TDBuild.yml @@ -22,7 +22,7 @@ jobs: parameters: GitAction: ${{ parameters.GitAction }} ResourceFilePath: | - dev\VSIX\Extension\Cpp\Common\VSPackage.resx - dev\VSIX\Extension\Cs\Common\VSPackage.resx + dev\Templates\VSIX\Extension\Cpp\Common\VSPackage.resx + dev\Templates\VSIX\Extension\Cs\Common\VSPackage.resx dev\Interop\StoragePickers\Strings\StoragePickers.resw teamId: $(TdBuildTeamIDVSIX) diff --git a/build/WindowsAppSDK-Templates-PR.yml b/build/WindowsAppSDK-Templates-PR.yml new file mode 100644 index 0000000000..33a612bf69 --- /dev/null +++ b/build/WindowsAppSDK-Templates-PR.yml @@ -0,0 +1,113 @@ +# Templates PR Validation Pipeline +# +# PR validation for changes under dev/Templates/**. +# Reuses the build/pack + test stages from the main pipeline +# (WindowsAppSDK-DotnetNewTemplates.yml). Nothing is signed; nothing is +# published. PR-stamped versions keep PR artifacts from colliding with +# canonical packages -- see each stage for the exact format. +# +# Triggers are configured in the Azure DevOps UI (Edit pipeline -> Triggers), +# NOT in this YAML -- matches the WindowsAppSDK-Foundation-PR.yml convention. +# In the UI, under Pull request validation: +# - Override the YAML pull request trigger from here: ON +# - Enable pull request validation: ON +# - Branch filters: Include refs/heads/main +# Include refs/heads/release/* +# - Path filters: Include dev/Templates/** + +trigger: none + +# Shared variable templates: +# - Foundation-TestConfig: test matrices reused from the main pipeline. +# - Versions: MajorVersion / MinorVersion / PatchVersion (consumed by CommonVariables). +# - CommonVariables: WindowsContainerImage (required by 1ES OneBranch for +# "Initialize containers") and the family of ob_sdl_* knobs. The SDL knobs +# are inert here because we disable those scanners in globalSdl below. +# +# OfficialPipelineID is the Aggregator nightly definition id (WinAppSDK-Build-Nightly, +# OneBranch) that produces the WindowsAppSDK_Nuget_And_MSIX artifact daily on 'main'. +# The VSIX build-validation stage consumes it with runVersion 'latestFromBranch' to pull +# the latest nightly nuget, so no per-run build id is required. Defined here (not in the +# ADO UI) so it is version-controlled and reviewable. +variables: +- name: OfficialPipelineID + value: 118002 +- template: WindowsAppSDK-Foundation-TestConfig.yml@WindowsAppSDKConfig +- template: AzurePipelinesTemplates\WindowsAppSDK-Versions.yml@WindowsAppSDKVersionConfig +- template: WindowsAppSDK-CommonVariables.yml + +name: TemplatesPR-$(Date:yyyyMMdd)$(Rev:.r) + +resources: + repositories: + - repository: templates + type: git + name: OneBranch.Pipelines/GovernedTemplates + ref: refs/heads/main + - repository: WindowsAppSDKConfig + # adding config for WindowsAppSDK-VSIXTemplates-BuildValidation-Stage + type: git + name: ProjectReunion/WindowsAppSDKConfig + ref: refs/heads/main + - repository: WindowsAppSDKVersionConfig + type: git + name: ProjectReunion/WindowsAppSDKConfig + ref: refs/heads/main + +extends: + template: v2/Microsoft.NonOfficial.yml@templates + parameters: + featureFlags: + EnableCDPxPAT: false + WindowsHostVersion: + Version: 2022 + Network: R1 + + platform: + name: 'windows_undocked' + + cloudvault: + enabled: false + + # Skip heavy SDL tools for PR validation; the main pipeline + # (WindowsAppSDK-DotnetNewTemplates.yml) covers them on canonical builds. + globalSdl: + tsa: + enabled: false + isNativeCode: false + psscriptanalyzer: + enable: false + binskim: + enabled: false + prefast: + enabled: false + apiscan: + enabled: false + + stages: + # Build + pack the templates NuGet. IsPRBuild=true makes the stage stamp + # every pack as ----pr so the + # .nupkg filename uniquely identifies the run (manual replays without a + # PR# fall back to pr0 + timestamp). + - template: AzurePipelinesTemplates\WindowsAppSDK-DotnetNewTemplates-Stages.yml@self + parameters: + pool: + type: windows + publishToInternalFeed: false + SignOutput: false + IsPRBuild: true + + # Smoke-test: scaffold every template from the pack and dotnet build each. + - template: AzurePipelinesTemplates\WindowsAppSDK-DotnetNewTemplates-Test-Stage.yml@self + parameters: + pool: + type: windows + dependsOnStage: 'DotnetNewTemplates_Build' + + # Build-validate the VSIX. Runs the production VSIX pack steps so + # VSIX-pack regressions (e.g. VSSDK1300 path overflow) surface at PR + # time. See WindowsAppSDK-VSIXTemplates-BuildValidation-Stage.yml. + - template: AzurePipelinesTemplates\WindowsAppSDK-VSIXTemplates-BuildValidation-Stage.yml@self + parameters: + pool: + type: windows \ No newline at end of file diff --git a/dev/ApplicationData/M.W.S.ApplicationData.cpp b/dev/ApplicationData/M.W.S.ApplicationData.cpp index 3fd36a45d3..9890a1460a 100644 --- a/dev/ApplicationData/M.W.S.ApplicationData.cpp +++ b/dev/ApplicationData/M.W.S.ApplicationData.cpp @@ -7,6 +7,7 @@ #include "Microsoft.Windows.Storage.ApplicationData.g.cpp" #include "M.W.S.ApplicationDataContainer.h" +#include "UnpackagedApplicationData.h" #include @@ -24,25 +25,15 @@ static_assert(static_cast(winrt::Microsoft::Windows::Storage::Applicati namespace winrt::Microsoft::Windows::Storage::implementation { ApplicationData::ApplicationData(hstring const& packageFamilyName) : - m_unpackagedApplicationData(), m_applicationData(nullptr), m_packageFamilyName(packageFamilyName) { } ApplicationData::ApplicationData(winrt::Windows::Storage::ApplicationData& value, hstring const& packageFamilyName) : - m_unpackagedApplicationData(), m_applicationData(value), m_packageFamilyName(packageFamilyName) { } - ApplicationData::ApplicationData(hstring const& publisher, hstring const& product) : - m_unpackagedApplicationData(), - m_applicationData(nullptr), - m_packageFamilyName() - { - auto unpackagedApplicationData{ new ::Microsoft::Windows::Storage::UnpackagedApplicationData(publisher, product) }; - m_unpackagedApplicationData.reset(unpackagedApplicationData); - } winrt::Microsoft::Windows::Storage::ApplicationData ApplicationData::GetDefault() { const auto packageFamilyName{ ::AppModel::Identity::GetCurrentPackageFamilyName() }; @@ -114,25 +105,15 @@ namespace winrt::Microsoft::Windows::Storage::implementation _VerifyPublisher(publisher); _VerifyProduct(product); - return winrt::make(publisher, product); + return winrt::make(publisher, product); } bool ApplicationData::IsMachinePathSupported() { - if (m_unpackagedApplicationData) - { - return m_unpackagedApplicationData->IsMachinePathSupported(); - } - const auto path{ _MachinePath(m_packageFamilyName) }; return !path.empty(); } hstring ApplicationData::LocalCachePath() { - if (m_unpackagedApplicationData) - { - return m_unpackagedApplicationData->LocalCachePath(); - } - if (!m_applicationData) { return winrt::hstring{}; @@ -141,11 +122,6 @@ namespace winrt::Microsoft::Windows::Storage::implementation } hstring ApplicationData::LocalPath() { - if (m_unpackagedApplicationData) - { - return m_unpackagedApplicationData->LocalPath(); - } - if (!m_applicationData) { return winrt::hstring{}; @@ -154,21 +130,11 @@ namespace winrt::Microsoft::Windows::Storage::implementation } hstring ApplicationData::MachinePath() { - if (m_unpackagedApplicationData) - { - return m_unpackagedApplicationData->MachinePath(); - } - const auto path{ _MachinePath(m_packageFamilyName) }; return winrt::hstring{ path.c_str() }; } hstring ApplicationData::SharedLocalPath() { - if (m_unpackagedApplicationData) - { - return m_unpackagedApplicationData->SharedLocalPath(); - } - if (!m_applicationData) { return winrt::hstring{}; @@ -187,11 +153,6 @@ namespace winrt::Microsoft::Windows::Storage::implementation } hstring ApplicationData::TemporaryPath() { - if (m_unpackagedApplicationData) - { - return m_unpackagedApplicationData->TemporaryPath(); - } - if (!m_applicationData) { return winrt::hstring{}; @@ -200,11 +161,6 @@ namespace winrt::Microsoft::Windows::Storage::implementation } winrt::Windows::Storage::StorageFolder ApplicationData::LocalCacheFolder() { - if (m_unpackagedApplicationData) - { - return m_unpackagedApplicationData->LocalCacheFolder(); - } - if (!m_applicationData) { return nullptr; @@ -213,11 +169,6 @@ namespace winrt::Microsoft::Windows::Storage::implementation } winrt::Windows::Storage::StorageFolder ApplicationData::LocalFolder() { - if (m_unpackagedApplicationData) - { - return m_unpackagedApplicationData->LocalFolder(); - } - if (!m_applicationData) { return nullptr; @@ -226,11 +177,6 @@ namespace winrt::Microsoft::Windows::Storage::implementation } winrt::Windows::Storage::StorageFolder ApplicationData::MachineFolder() { - if (m_unpackagedApplicationData) - { - return m_unpackagedApplicationData->MachineFolder(); - } - const auto path{ MachinePath() }; if (path.empty()) { @@ -240,11 +186,6 @@ namespace winrt::Microsoft::Windows::Storage::implementation } winrt::Windows::Storage::StorageFolder ApplicationData::SharedLocalFolder() { - if (m_unpackagedApplicationData) - { - return m_unpackagedApplicationData->SharedLocalFolder(); - } - if (!m_applicationData) { return nullptr; @@ -253,11 +194,6 @@ namespace winrt::Microsoft::Windows::Storage::implementation } winrt::Windows::Storage::StorageFolder ApplicationData::TemporaryFolder() { - if (m_unpackagedApplicationData) - { - return m_unpackagedApplicationData->TemporaryFolder(); - } - if (!m_applicationData) { return nullptr; @@ -266,11 +202,6 @@ namespace winrt::Microsoft::Windows::Storage::implementation } winrt::Microsoft::Windows::Storage::ApplicationDataContainer ApplicationData::LocalSettings() { - if (m_unpackagedApplicationData) - { - return m_unpackagedApplicationData->LocalSettings(); - } - if (!m_applicationData) { return nullptr; @@ -280,11 +211,6 @@ namespace winrt::Microsoft::Windows::Storage::implementation } winrt::Windows::Foundation::IAsyncAction ApplicationData::ClearAsync(winrt::Microsoft::Windows::Storage::ApplicationDataLocality locality) { - if (m_unpackagedApplicationData) - { - co_await m_unpackagedApplicationData->ClearAsync(locality); - } - if (!m_applicationData) { co_return; @@ -300,11 +226,6 @@ namespace winrt::Microsoft::Windows::Storage::implementation } winrt::Windows::Foundation::IAsyncAction ApplicationData::ClearPublisherCacheFolderAsync(hstring folderName) { - if (m_unpackagedApplicationData) - { - co_await m_unpackagedApplicationData->ClearPublisherCacheFolderAsync(folderName); - } - if (!m_applicationData) { co_return; @@ -313,11 +234,6 @@ namespace winrt::Microsoft::Windows::Storage::implementation } void ApplicationData::Close() { - if (m_unpackagedApplicationData) - { - return m_unpackagedApplicationData->Close(); - } - if (m_applicationData) { m_applicationData.Close(); @@ -325,11 +241,6 @@ namespace winrt::Microsoft::Windows::Storage::implementation } hstring ApplicationData::GetPublisherCachePath(hstring const& folderName) { - if (m_unpackagedApplicationData) - { - return m_unpackagedApplicationData->GetPublisherCachePath(folderName); - } - auto folder{ GetPublisherCacheFolder(folderName) }; winrt::hstring path; if (folder) @@ -340,11 +251,6 @@ namespace winrt::Microsoft::Windows::Storage::implementation } winrt::Windows::Storage::StorageFolder ApplicationData::GetPublisherCacheFolder(hstring const& folderName) { - if (m_unpackagedApplicationData) - { - return m_unpackagedApplicationData->GetPublisherCacheFolder(folderName); - } - if (!m_applicationData) { return nullptr; diff --git a/dev/ApplicationData/M.W.S.ApplicationData.h b/dev/ApplicationData/M.W.S.ApplicationData.h index 11bb311a84..0d9f975561 100644 --- a/dev/ApplicationData/M.W.S.ApplicationData.h +++ b/dev/ApplicationData/M.W.S.ApplicationData.h @@ -5,8 +5,6 @@ #include "Microsoft.Windows.Storage.ApplicationData.g.h" -#include "UnpackagedApplicationData.h" - namespace winrt::Microsoft::Windows::Storage::implementation { struct ApplicationData : ApplicationDataT @@ -14,7 +12,6 @@ namespace winrt::Microsoft::Windows::Storage::implementation ApplicationData() = default; ApplicationData(hstring const& packageFamilyName); ApplicationData(winrt::Windows::Storage::ApplicationData& value, hstring const& packageFamilyName); - ApplicationData(hstring const& publisher, hstring const& product); static winrt::Microsoft::Windows::Storage::ApplicationData GetDefault(); static winrt::Microsoft::Windows::Storage::ApplicationData GetForUser(winrt::Windows::System::User user); @@ -47,7 +44,6 @@ namespace winrt::Microsoft::Windows::Storage::implementation static void _VerifyProduct(winrt::hstring const& string); private: - std::unique_ptr<::Microsoft::Windows::Storage::UnpackagedApplicationData> m_unpackagedApplicationData; winrt::Windows::Storage::ApplicationData m_applicationData; winrt::hstring m_packageFamilyName; }; diff --git a/dev/ApplicationData/M.W.S.ApplicationDataContainer.cpp b/dev/ApplicationData/M.W.S.ApplicationDataContainer.cpp index 048f144cc3..b5181a619f 100644 --- a/dev/ApplicationData/M.W.S.ApplicationDataContainer.cpp +++ b/dev/ApplicationData/M.W.S.ApplicationDataContainer.cpp @@ -6,26 +6,14 @@ #include "M.W.S.ApplicationDataContainer.h" #include "Microsoft.Windows.Storage.ApplicationDataContainer.g.cpp" -#include "UnpackagedApplicationDataContainer.h" - namespace winrt::Microsoft::Windows::Storage::implementation { ApplicationDataContainer::ApplicationDataContainer(winrt::Windows::Storage::ApplicationDataContainer const& value) : m_applicationDataContainer(value) { } - ApplicationDataContainer::ApplicationDataContainer(std::shared_ptr<::Microsoft::Windows::Storage::UnpackagedApplicationDataContainer> const& value) : - m_unpackagedApplicationDataContainer(value), - m_applicationDataContainer(nullptr) - { - } winrt::Windows::Foundation::Collections::IMap ApplicationDataContainer::Containers() { - if (m_unpackagedApplicationDataContainer) - { - return m_unpackagedApplicationDataContainer->Containers(); - } - winrt::Windows::Foundation::Collections::IMap map{ winrt::single_threaded_map() }; auto containers{ m_applicationDataContainer.Containers() }; for (auto container : containers) @@ -37,20 +25,10 @@ namespace winrt::Microsoft::Windows::Storage::implementation } hstring ApplicationDataContainer::Name() { - if (m_unpackagedApplicationDataContainer) - { - return m_unpackagedApplicationDataContainer->Name(); - } - return m_applicationDataContainer.Name(); } winrt::Microsoft::Windows::Storage::ApplicationDataLocality ApplicationDataContainer::Locality() { - if (m_unpackagedApplicationDataContainer) - { - return m_unpackagedApplicationDataContainer->Locality(); - } - static_assert(static_cast(winrt::Microsoft::Windows::Storage::ApplicationDataLocality::Local) == static_cast(winrt::Windows::Storage::ApplicationDataLocality::Local)); static_assert(static_cast(winrt::Microsoft::Windows::Storage::ApplicationDataLocality::LocalCache) == static_cast(winrt::Windows::Storage::ApplicationDataLocality::LocalCache)); static_assert(static_cast(winrt::Microsoft::Windows::Storage::ApplicationDataLocality::Temporary) == static_cast(winrt::Windows::Storage::ApplicationDataLocality::Temporary)); @@ -59,29 +37,14 @@ namespace winrt::Microsoft::Windows::Storage::implementation } winrt::Windows::Foundation::Collections::IPropertySet ApplicationDataContainer::Values() { - if (m_unpackagedApplicationDataContainer) - { - return m_unpackagedApplicationDataContainer->Values(); - } - return m_applicationDataContainer.Values(); } void ApplicationDataContainer::Close() { - if (m_unpackagedApplicationDataContainer) - { - return m_unpackagedApplicationDataContainer->Close(); - } - return m_applicationDataContainer.Close(); } winrt::Microsoft::Windows::Storage::ApplicationDataContainer ApplicationDataContainer::CreateContainer(hstring const& name, winrt::Microsoft::Windows::Storage::ApplicationDataCreateDisposition const& disposition) { - if (m_unpackagedApplicationDataContainer) - { - return m_unpackagedApplicationDataContainer->CreateContainer(name, disposition); - } - static_assert(static_cast(winrt::Microsoft::Windows::Storage::ApplicationDataCreateDisposition::Always) == static_cast(winrt::Windows::Storage::ApplicationDataCreateDisposition::Always)); static_assert(static_cast(winrt::Microsoft::Windows::Storage::ApplicationDataCreateDisposition::Existing) == static_cast(winrt::Windows::Storage::ApplicationDataCreateDisposition::Existing)); @@ -90,11 +53,6 @@ namespace winrt::Microsoft::Windows::Storage::implementation } void ApplicationDataContainer::DeleteContainer(hstring const& name) { - if (m_unpackagedApplicationDataContainer) - { - return m_unpackagedApplicationDataContainer->DeleteContainer(name); - } - m_applicationDataContainer.DeleteContainer(name); } } diff --git a/dev/ApplicationData/M.W.S.ApplicationDataContainer.h b/dev/ApplicationData/M.W.S.ApplicationDataContainer.h index c22bcce957..cb96cb97af 100644 --- a/dev/ApplicationData/M.W.S.ApplicationDataContainer.h +++ b/dev/ApplicationData/M.W.S.ApplicationDataContainer.h @@ -5,18 +5,12 @@ #include "Microsoft.Windows.Storage.ApplicationDataContainer.g.h" -namespace Microsoft::Windows::Storage -{ - struct UnpackagedApplicationDataContainer; -} - namespace winrt::Microsoft::Windows::Storage::implementation { struct ApplicationDataContainer : ApplicationDataContainerT { ApplicationDataContainer() = default; ApplicationDataContainer(winrt::Windows::Storage::ApplicationDataContainer const& value); - ApplicationDataContainer(std::shared_ptr<::Microsoft::Windows::Storage::UnpackagedApplicationDataContainer> const& value); winrt::Windows::Foundation::Collections::IMap Containers(); hstring Name(); @@ -27,7 +21,6 @@ namespace winrt::Microsoft::Windows::Storage::implementation void DeleteContainer(hstring const& name); private: - std::shared_ptr<::Microsoft::Windows::Storage::UnpackagedApplicationDataContainer> m_unpackagedApplicationDataContainer; winrt::Windows::Storage::ApplicationDataContainer m_applicationDataContainer; }; } diff --git a/dev/ApplicationData/UnpackagedApplicationData.cpp b/dev/ApplicationData/UnpackagedApplicationData.cpp index e1d3ba000f..975539e5ce 100644 --- a/dev/ApplicationData/UnpackagedApplicationData.cpp +++ b/dev/ApplicationData/UnpackagedApplicationData.cpp @@ -12,7 +12,7 @@ #include "ApplicationDataTelemetry.h" -namespace Microsoft::Windows::Storage +namespace winrt::Microsoft::Windows::Storage::implementation { UnpackagedApplicationData::UnpackagedApplicationData(winrt::hstring const& publisher, winrt::hstring const& product) : m_publisher(publisher), @@ -21,6 +21,23 @@ namespace Microsoft::Windows::Storage m_temporaryPath() { } + // The following functions are not implemented for the UnpackagedApplicationData implementation of ApplicationDataT + winrt::Microsoft::Windows::Storage::ApplicationData UnpackagedApplicationData::GetDefault() + { + throw winrt::hresult_not_implemented(); + } + winrt::Microsoft::Windows::Storage::ApplicationData UnpackagedApplicationData::GetForUser([[maybe_unused]] winrt::Windows::System::User user) + { + throw winrt::hresult_not_implemented(); + } + winrt::Microsoft::Windows::Storage::ApplicationData UnpackagedApplicationData::GetForPackageFamily([[maybe_unused]] winrt::hstring const& packageFamilyName) + { + throw winrt::hresult_not_implemented(); + } + winrt::Microsoft::Windows::Storage::ApplicationData UnpackagedApplicationData::GetForUnpackaged([[maybe_unused]] winrt::hstring const& publisher, [[maybe_unused]] winrt::hstring const& product) + { + throw winrt::hresult_not_implemented(); + } bool UnpackagedApplicationData::IsMachinePathSupported() { _VerifyNotClosed(); @@ -153,9 +170,8 @@ namespace Microsoft::Windows::Storage THROW_IF_WIN32_ERROR(::RegOpenCurrentUser(KEY_READ | KEY_WRITE, currentUserKey.put())); auto subKey{ std::format(L"SOFTWARE\\{}\\{}", m_publisher, m_product) }; auto key{ wil::reg::create_shared_key(currentUserKey.get(), subKey.c_str(), wil::reg::key_access::readwrite) }; - auto container{ std::make_shared( - std::move(key), winrt::hstring{}, winrt::Microsoft::Windows::Storage::ApplicationDataLocality::Local) }; - return winrt::make(container); + return winrt::make( + std::move(key), winrt::hstring{}, winrt::Microsoft::Windows::Storage::ApplicationDataLocality::Local); } winrt::Windows::Foundation::IAsyncAction UnpackagedApplicationData::ClearAsync(winrt::Microsoft::Windows::Storage::ApplicationDataLocality locality) { @@ -219,7 +235,7 @@ namespace Microsoft::Windows::Storage co_return; } - winrt::Windows::Foundation::IAsyncAction UnpackagedApplicationData::ClearPublisherCacheFolderAsync(winrt::hstring folderName) + winrt::Windows::Foundation::IAsyncAction UnpackagedApplicationData::ClearPublisherCacheFolderAsync([[maybe_unused]] winrt::hstring folderName) { _VerifyNotClosed(); @@ -233,14 +249,14 @@ namespace Microsoft::Windows::Storage m_localPath.clear(); m_temporaryPath.clear(); } - winrt::hstring UnpackagedApplicationData::GetPublisherCachePath(winrt::hstring const& folderName) + winrt::hstring UnpackagedApplicationData::GetPublisherCachePath([[maybe_unused]] winrt::hstring const& folderName) { _VerifyNotClosed(); // ApplicationData.PublisherCacheFolder has no unpackaged equivalent throw winrt::hresult_not_implemented(); } - winrt::Windows::Storage::StorageFolder UnpackagedApplicationData::GetPublisherCacheFolder(winrt::hstring const& folderName) + winrt::Windows::Storage::StorageFolder UnpackagedApplicationData::GetPublisherCacheFolder([[maybe_unused]] winrt::hstring const& folderName) { _VerifyNotClosed(); diff --git a/dev/ApplicationData/UnpackagedApplicationData.h b/dev/ApplicationData/UnpackagedApplicationData.h index 4424cde99d..7a32388852 100644 --- a/dev/ApplicationData/UnpackagedApplicationData.h +++ b/dev/ApplicationData/UnpackagedApplicationData.h @@ -3,15 +3,19 @@ #pragma once -#include "M.W.S.ApplicationDataContainer.h" +#include "Microsoft.Windows.Storage.ApplicationData.g.h" -namespace Microsoft::Windows::Storage +namespace winrt::Microsoft::Windows::Storage::implementation { - struct UnpackagedApplicationData + struct UnpackagedApplicationData : ApplicationDataT { UnpackagedApplicationData() = default; UnpackagedApplicationData(winrt::hstring const& publisher, winrt::hstring const& product); + static winrt::Microsoft::Windows::Storage::ApplicationData GetDefault(); + static winrt::Microsoft::Windows::Storage::ApplicationData GetForUser(winrt::Windows::System::User user); + static winrt::Microsoft::Windows::Storage::ApplicationData GetForPackageFamily(winrt::hstring const& packageFamilyName); + static winrt::Microsoft::Windows::Storage::ApplicationData GetForUnpackaged(winrt::hstring const& publisher, winrt::hstring const& product); bool IsMachinePathSupported(); winrt::hstring LocalCachePath(); winrt::hstring LocalPath(); diff --git a/dev/ApplicationData/UnpackagedApplicationDataContainer.cpp b/dev/ApplicationData/UnpackagedApplicationDataContainer.cpp index ce81b681eb..ee350a7941 100644 --- a/dev/ApplicationData/UnpackagedApplicationDataContainer.cpp +++ b/dev/ApplicationData/UnpackagedApplicationDataContainer.cpp @@ -7,7 +7,7 @@ #include "Validate.h" -namespace Microsoft::Windows::Storage +namespace winrt::Microsoft::Windows::Storage::implementation { namespace { @@ -835,9 +835,8 @@ namespace Microsoft::Windows::Storage for (const auto& keyData : wil::make_range(wil::reg::key_iterator{ m_key.get() }, wil::reg::key_iterator{})) { auto subKey{ wil::reg::open_shared_key(m_key.get(), keyData.name.c_str(), wil::reg::key_access::readwrite) }; - auto subContainer{ std::make_shared(std::move(subKey), winrt::hstring{ keyData.name }, m_locality) }; - auto wrappedContainer{ winrt::make(subContainer) }; - map.Insert(winrt::hstring{ keyData.name }, wrappedContainer); + auto subContainer{ winrt::make(std::move(subKey), winrt::hstring{ keyData.name }, m_locality) }; + map.Insert(winrt::hstring{ keyData.name }, subContainer); } return map; } @@ -879,14 +878,12 @@ namespace Microsoft::Windows::Storage if (disposition == winrt::Microsoft::Windows::Storage::ApplicationDataCreateDisposition::Existing) { auto subKey{ wil::reg::open_shared_key(m_key.get(), name.c_str(), wil::reg::key_access::readwrite) }; - auto subContainer{ std::make_shared(std::move(subKey), name, m_locality) }; - return winrt::make(subContainer); + return winrt::make(std::move(subKey), name, m_locality); } else { auto subKey{ wil::reg::create_shared_key(m_key.get(), name.c_str(), wil::reg::key_access::readwrite) }; - auto subContainer{ std::make_shared(std::move(subKey), name, m_locality) }; - return winrt::make(subContainer); + return winrt::make(std::move(subKey), name, m_locality); } } diff --git a/dev/ApplicationData/UnpackagedApplicationDataContainer.h b/dev/ApplicationData/UnpackagedApplicationDataContainer.h index b6e660da9a..f95e85357b 100644 --- a/dev/ApplicationData/UnpackagedApplicationDataContainer.h +++ b/dev/ApplicationData/UnpackagedApplicationDataContainer.h @@ -3,11 +3,11 @@ #pragma once -#include "M.W.S.ApplicationDataContainer.h" +#include "Microsoft.Windows.Storage.ApplicationDataContainer.g.h" -namespace Microsoft::Windows::Storage +namespace winrt::Microsoft::Windows::Storage::implementation { - struct UnpackagedApplicationDataContainer + struct UnpackagedApplicationDataContainer : ApplicationDataContainerT { UnpackagedApplicationDataContainer() = default; UnpackagedApplicationDataContainer(wil::shared_hkey key, winrt::hstring const& name, winrt::Microsoft::Windows::Storage::ApplicationDataLocality locality); diff --git a/dev/MRTCore/mrt/Microsoft.Windows.ApplicationModel.Resources/src/Helper.cpp b/dev/MRTCore/mrt/Microsoft.Windows.ApplicationModel.Resources/src/Helper.cpp index 58d419c808..c3fb916caa 100644 --- a/dev/MRTCore/mrt/Microsoft.Windows.ApplicationModel.Resources/src/Helper.cpp +++ b/dev/MRTCore/mrt/Microsoft.Windows.ApplicationModel.Resources/src/Helper.cpp @@ -3,6 +3,7 @@ #include "pch.h" #include "frameworkudk\ResourceManager.h" +#include bool IsResourceNotFound(HRESULT hr) { @@ -83,7 +84,7 @@ HRESULT GetDefaultPriFile(winrt::hstring& filePath) // GetDefaultPriFileForCurrentPackage will not handle the new case where // resources.pri is in the parent folder. - bool isPackaged = (hr != HRESULT_FROM_WIN32(APPMODEL_ERROR_NO_PACKAGE)); + bool isPackaged = AppModel::Identity::IsPackagedProcess(); hr = GetDefaultPriFileForCurentModule(isPackaged, filePath); // Sparse-packaged apps have identity but deploy PRI files as loose files; fall back to unpackaged discovery which also searches for "[modulename].pri". diff --git a/dev/RuntimeCompatibilityOptions/RuntimeCompatibilityOptions.cpp b/dev/RuntimeCompatibilityOptions/RuntimeCompatibilityOptions.cpp index 65310ff775..cd16e74f05 100644 --- a/dev/RuntimeCompatibilityOptions/RuntimeCompatibilityOptions.cpp +++ b/dev/RuntimeCompatibilityOptions/RuntimeCompatibilityOptions.cpp @@ -6,6 +6,138 @@ #include "Microsoft.Windows.ApplicationModel.WindowsAppRuntime.RuntimeCompatibilityOptions.g.cpp" #include "AssemblyInfo.h" #include +#include + +namespace +{ + // Per-release groups of WinAppSDK contained change IDs. Each group's + // releaseVersion is the patch release in which the contained change first + // shipped. RuntimeCompatibilityOptions::Apply() walks the active catalog at + // startup and pre-prunes (adds to the disabled list) any group whose + // releaseVersion is greater than the runtime's effective patch level. + // + // Release engineering: at branch cut, add a new release group to + // s_catalogGroupsProd below for any new WINAPPSDK_CHANGE_* IDs that landed + // in os.2020 FrameworkUdk Containment.h since the previous branch. + // + // Servicing engineers do NOT edit this file. They only add the + // #define WINAPPSDK_CHANGE_FOO id macro in their component source. + // Release engineering performs the catalog roll-up. + // + // The WinAppSDK_Security pseudo-version is reserved for security fixes - + // entries in a security group are catalog-tracked but are never + // auto-disabled by Apply's pre-prune walk because their releaseVersion (0) + // is never greater than any effective patch level. + // + // WinAppSDKReleaseVersion is defined locally here (rather than alongside + // FrameworkUdk's Containment.h enum) to break the per-release maintenance + // coupling between FrUdk and Foundation. It is named WinAppSDKReleaseVersion + // rather than WinAppSDKPatchVersion to avoid colliding with the legacy + // unscoped enum type name still exposed by older Containment.h headers + // (renamed there to WinAppSDKPatchVersionDeprecated in newer FrUdk + // revisions). The scoped enum keeps all release-version constants + // (WinAppSDK_Latest, WinAppSDK_Security, and per-release WinAppSDK_M_m_p + // values added by release engineering as the catalog grows) confined to + // this translation unit; no other component should reference them. + // WinAppSDKReleaseVersionFromValues mirrors the historical + // WinAppSDKPatchVersionFromValues encoding (major*1000000 + minor*1000 + patch) + // so the WindowsAppRuntimeVersion -> WinAppSDKReleaseVersion conversion + // is consistent with the encoding release engineering uses when adding + // new per-release enumerators below. + constexpr UINT32 WinAppSDKReleaseVersionFromValues(UINT32 major, UINT32 minor, UINT32 patch) + { + return (major * 1000000) + (minor * 1000) + patch; + } + + enum class WinAppSDKReleaseVersion : UINT32 + { + // No per-release enumerators on main today - the production catalog + // (s_catalogGroupsProd) is empty. Release engineering adds a + // WinAppSDK_X_Y_Z enumerator here only when the corresponding + // s_changes_X_Y_Z[] group is added below. WinAppSDK_Latest is the + // default "newest possible" sentinel used by Apply when no explicit + // patch level is requested; WinAppSDK_Security is the + // catalog-tracked-but-never-pre-pruned sentinel used by security + // change groups. + WinAppSDK_Latest = 999999999, + WinAppSDK_Security = 0, + }; + + struct CatalogGroup + { + const UINT32* changes; + UINT32 count; + WinAppSDKReleaseVersion releaseVersion; + }; + + template + constexpr CatalogGroup MakeGroup(const UINT32(&arr)[N], WinAppSDKReleaseVersion v) + { + return { arr, static_cast(N), v }; + } + + // Test-only catalog. Activated by ContainmentTestInitialize(true). Holds + // two groups whose releaseVersion straddles the runtime's effective + // patch level under the default WinAppSDKRuntimeConfiguration (Apply + // resolves an unspecified patch level to WinAppSDKReleaseVersion::WinAppSDK_Latest). + // Together they exercise both branches of Apply's pre-prune walk and + // span the changeId value range so that std::sort (Apply) and + // std::binary_search (FrUdk worker) are probed at both ends: + // + // * s_enabled_changes_test is pinned at WinAppSDK_Latest - 1, so + // its releaseVersion is NOT greater than the effective patch level. + // Apply prunes the group OUT of disabledChanges; these IDs remain + // ENABLED at runtime. {1, 2, 3} = small-end IDs that must not + // appear in the final sorted disabledChanges set. + // + // * s_disabled_changes_test is pinned at WinAppSDK_Latest + 1, so + // its releaseVersion IS greater than the effective patch level. + // Apply preserves the group IN disabledChanges; these IDs are + // DISABLED at runtime. {0, 99999999} = smallest representable ID + // and a high-value sentinel; they must appear in the final sorted + // disabledChanges set. + // + // Unit tests call IsChangeEnabled() (the 1-argument form) so the + // catalog pre-prune is the only mechanism that disables changes. + // Production callsites must not reference 0, 1, 2, 3, or 99999999. + constexpr UINT32 s_enabled_changes_test[] = { 1, 2, 3 }; + constexpr UINT32 s_disabled_changes_test[] = { 0, 99999999 }; + constexpr CatalogGroup s_catalogGroupsTest[] = { + MakeGroup(s_enabled_changes_test, + static_cast(static_cast(WinAppSDKReleaseVersion::WinAppSDK_Latest) - 1)), + MakeGroup(s_disabled_changes_test, + static_cast(static_cast(WinAppSDKReleaseVersion::WinAppSDK_Latest) + 1)), + }; + + // Production catalog. Empty until the first per-release group lands; we + // use pointer+count rather than an array so the empty state is well-formed + // in C++ (which disallows zero-sized arrays). When the first contained + // change ships, release engineering should replace these two lines with: + // constexpr CatalogGroup s_catalogGroupsProd[] = { MakeGroup(...), ... }; + // constexpr size_t s_catalogGroupsProdCount = std::size(s_catalogGroupsProd); + constexpr CatalogGroup const* s_catalogGroupsProd{ nullptr }; + constexpr size_t s_catalogGroupsProdCount{ 0 }; + + // Active catalog. ContainmentTestInitialize(bool) swaps these pointers + // between the production and test catalogs. Apply() reads them at runtime. + const CatalogGroup* s_catalogGroup{ s_catalogGroupsProd }; + size_t s_catalogGroupCount{ s_catalogGroupsProdCount }; +} + +STDAPI ContainmentTestInitialize(bool enableTest) noexcept try +{ + if (enableTest) + { + s_catalogGroup = s_catalogGroupsTest; + s_catalogGroupCount = std::size(s_catalogGroupsTest); + } + else + { + s_catalogGroup = s_catalogGroupsProd; + s_catalogGroupCount = s_catalogGroupsProdCount; + } + return S_OK; +} CATCH_RETURN(); namespace winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime::implementation { @@ -28,19 +160,44 @@ namespace winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime::implem } } - // Apply the patch level which applies to the major.minor version, if any. - if (m_patchLevel1.Major == WINDOWSAPPSDK_RELEASE_MAJOR && m_patchLevel1.Minor == WINDOWSAPPSDK_RELEASE_MINOR) + // Resolve the effective patch level for catalog pre-prune. This is owned + // entirely by WinAppSDK now - FrameworkUdk's Containment_GetChangeEnabled + // worker no longer compares against any per-change patch version. + // A default-initialized WindowsAppRuntimeVersion is {0,0,0}; treat that as + // "not set" rather than as a request to pin to 0.0.0. (In production builds + // WINDOWSAPPSDK_RELEASE_MAJOR is > 0 so this case never arises; in dev builds + // the macro is 0/0 and the unset sentinel would otherwise spuriously match.) + WinAppSDKReleaseVersion runtimePatchLevel{ WinAppSDKReleaseVersion::WinAppSDK_Latest }; + if (m_patchLevel1.Major == WINDOWSAPPSDK_RELEASE_MAJOR && m_patchLevel1.Minor == WINDOWSAPPSDK_RELEASE_MINOR + && (m_patchLevel1.Major != 0 || m_patchLevel1.Minor != 0 || m_patchLevel1.Patch != 0)) { // Apply patch level 1 - config.patchVersion = (WinAppSDKPatchVersion)WinAppSDKPatchVersionFromValues(m_patchLevel1.Major, m_patchLevel1.Minor, m_patchLevel1.Patch); + runtimePatchLevel = static_cast( + WinAppSDKReleaseVersionFromValues(m_patchLevel1.Major, m_patchLevel1.Minor, m_patchLevel1.Patch)); } - else if (m_patchLevel2.Major == WINDOWSAPPSDK_RELEASE_MAJOR && m_patchLevel2.Minor == WINDOWSAPPSDK_RELEASE_MINOR) + else if (m_patchLevel2.Major == WINDOWSAPPSDK_RELEASE_MAJOR && m_patchLevel2.Minor == WINDOWSAPPSDK_RELEASE_MINOR + && (m_patchLevel2.Major != 0 || m_patchLevel2.Minor != 0 || m_patchLevel2.Patch != 0)) { // Apply patch level 2 - config.patchVersion = (WinAppSDKPatchVersion)WinAppSDKPatchVersionFromValues(m_patchLevel2.Major, m_patchLevel2.Minor, m_patchLevel2.Patch); + runtimePatchLevel = static_cast( + WinAppSDKReleaseVersionFromValues(m_patchLevel2.Major, m_patchLevel2.Minor, m_patchLevel2.Patch)); } - // Add the set of disabled changes + // Mirror the resolved patch level into the ABI-locked + // WinAppSDKRuntimeConfiguration::patchVersion field as an opaque UINT32 + // cast. Containment_GetChangeEnabled no longer reads it for change + // filtering, but Containment_SetConfiguration still uses it as part of + // the identity check that detects attempts to apply a divergent + // configuration twice from the same process. + config.patchVersion = static_cast(static_cast(runtimePatchLevel)); + + // Build the disabled-changes list from two sources: + // (1) The app's explicit DisabledChanges list (unchanged behavior). + // (2) Catalog pre-pruning: every change whose release is newer than the + // effective patch level is treated as disabled, so callsites see + // pre-change behavior on patch-pinned runtimes. + // Duplicates between (1) and (2) are harmless: the FrUdk worker treats + // disabledChanges as a sorted set and uses set-membership semantics. std::vector disabledChanges; for (auto changeId : m_disabledChanges) { @@ -48,6 +205,23 @@ namespace winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime::implem // UINT32 is used internally for the changeId, so cast from the enum's Int32 to that. disabledChanges.push_back(static_cast(changeId)); } + + for (size_t g = 0; g < s_catalogGroupCount; ++g) + { + auto const& group = s_catalogGroup[g]; + if (group.releaseVersion > runtimePatchLevel) + { + for (UINT32 i = 0; i < group.count; ++i) + { + disabledChanges.push_back(group.changes[i]); + } + } + } + + // FrameworkUdk's Containment_GetChangeEnabled assumes disabledChanges is + // sorted ascending so it can use std::binary_search for O(log N) lookups. + std::sort(disabledChanges.begin(), disabledChanges.end()); + config.disabledChanges = disabledChanges.data(); config.disabledChangesCount = static_cast(disabledChanges.size()); diff --git a/dev/Templates/Directory.Build.props b/dev/Templates/Directory.Build.props new file mode 100644 index 0000000000..e8f8c87f61 --- /dev/null +++ b/dev/Templates/Directory.Build.props @@ -0,0 +1,37 @@ + + + + + + + 2.0.230706.1 + 10.0.26100.4654 + 1.0.220914.1 + + 1.0.0-preview1 + Standalone + + true + + + false + + + + + $(MSBuildThisFileDirectory)..\..\ + $(MSBuildThisFileDirectory)Source\ + $(TemplateSourceDir)ItemTemplates\ + $(TemplateSourceDir)ProjectTemplates\ + + diff --git a/dev/Templates/Dotnet/Directory.Build.props b/dev/Templates/Dotnet/Directory.Build.props new file mode 100644 index 0000000000..1125e90889 --- /dev/null +++ b/dev/Templates/Dotnet/Directory.Build.props @@ -0,0 +1,5 @@ + + + + + diff --git a/dev/Templates/Dotnet/README.md b/dev/Templates/Dotnet/README.md new file mode 100644 index 0000000000..3a6e849451 --- /dev/null +++ b/dev/Templates/Dotnet/README.md @@ -0,0 +1,160 @@ +# Windows App SDK WinUI 3 C# Templates + +Official WinUI 3 project and item templates for the +[Windows App SDK](https://learn.microsoft.com/windows/apps/windows-app-sdk/), +designed for use with the .NET CLI (`dotnet new`). This template pack provides +the same starting points available in Visual Studio — blank apps, navigation +views, MVVM scaffolding, tab-view shells, class libraries, unit test projects, +and common WinUI UI items — right from the command line. + +`dotnet run` launches the generated app with full MSIX package identity, so +features that require it (notifications, background tasks, Windows AI APIs, +etc.) work the same as they would in a Visual Studio F5 deploy. + +## Installation + +```shell +dotnet new install Microsoft.WindowsAppSDK.WinUI.CSharp.Templates +``` + +## Available Templates + +### Project Templates + +Get below list via `dotnet new list winui` + +| Short Name | Description | +|-------------------|--------------------------------------------------------------------------| +| `winui` | Minimal WinUI 3 blank app with MSIX packaging. Start here if unsure | +| `winui-mvvm` | WinUI 3 MVVM app using `CommunityToolkit.Mvvm` | +| `winui-navview` | WinUI 3 NavigationView starter app with MSIX packaging | +| `winui-tabview` | WinUI 3 TabView starter app with MSIX packaging | +| `winui-lib` | WinUI 3 class library for sharing UI components | +| `winui-unittest` | WinUI 3 packaged test app configured for MSTest | + +Each `winui-*` short name also has a `winui3-*` alias (e.g. `winui3-mvvm`). + +### Item Templates + +| Short Name | Description | +|----------------------------|----------------------------------------------------------| +| `winui-page` | WinUI 3 Page (XAML + code-behind) | +| `winui-window` | WinUI 3 Window (XAML + code-behind) | +| `winui-usercontrol` | WinUI 3 UserControl (XAML + code-behind) | +| `winui-templatedcontrol` | WinUI 3 templated control | +| `winui-resourcedictionary` | WinUI 3 ResourceDictionary | +| `winui-resw` | RESW resources file for localized strings | +| `winui-dialog` | WinUI 3 ContentDialog (XAML + code-behind) | + +Item templates are context-aware and only surface when `dotnet new` is executed +inside a WinUI project folder or when `--project` points to one. + +## Quick Start + +### Quickstart a new WinUI 3 APP + +```powershell +dotnet new winui -n MyApp +cd MyApp + +# dotnet build +dotnet run +``` + +`dotnet run` registers a loose-layout MSIX, gives the app package identity, +and launches it via AUMID activation — equivalent to F5 in Visual Studio. + +### Add items to an existing project + +```powershell +dotnet new winui-page -n SettingsPage --project .\MyApp.csproj +dotnet new winui-usercontrol -n ProfileCard --project .\MyApp.csproj +dotnet new winui-window -n SecondaryWindow --project .\MyApp.csproj +dotnet new winui-dialog -n ConfirmDialog --project .\MyApp.csproj +``` + +### Choosing a Target Framework + +Generated projects target `net{N}.0-windows10.0.26100.0`, where `{N}` is +selected at scaffold time via `--dotnet-version`: + +```shell +dotnet new winui --dotnet-version net8.0 -n MyApp +dotnet new winui --dotnet-version net9.0 -n MyApp +dotnet new winui --dotnet-version net10.0 -n MyApp +``` + +Supported choices: `net8.0`, `net9.0`, `net10.0`. If you omit +`--dotnet-version`, most templates default to `net10.0`; `winui-mvvm` matches +your installed .NET SDK. You can also edit `` in the +generated `.csproj` afterward. + +### Customizing `dotnet run` behavior + +Set any of these MSBuild properties inside a `` in the +generated `.csproj` to tweak how `dotnet run` launches the app: + +| Property | Default | Effect | +|--------------------------------|---------|------------------------------------------------------------------------------------------------| +| `EnableWinAppRunSupport` | `true` | Set to `false` to disable the packaged-launch integration and run unpackaged instead | +| `WinAppRunUseExecutionAlias` | `false` | For console apps — launches via `uap5:ExecutionAlias` so stdin/stdout stay in the terminal | +| `WinAppRunNoLaunch` | `false` | Register the package but don't launch (useful when attaching a different debugger first) | +| `WinAppRunDebugOutput` | `false` | Capture `OutputDebugString` and crash dumps; cannot be combined with another debugger | +| `WinAppLaunchArgs` | (empty) | Arguments passed to the app on launch (e.g. `--my-flag value`) | + +These properties are provided by the +[`Microsoft.Windows.SDK.BuildTools.WinApp`](https://www.nuget.org/packages/Microsoft.Windows.SDK.BuildTools.WinApp) +NuGet package, which is referenced automatically by the project templates. + +## Prerequisites + +- [.NET SDK](https://dotnet.microsoft.com/download) — `net8.0`, `net9.0`, or `net10.0` +- Windows 10 version 1809 (build 17763) or later +- **Developer Mode enabled** — required for `dotnet run` to register the loose-layout package. + Settings → System → For developers → Developer Mode → On. + +## Resources + +- [Windows App SDK documentation](https://learn.microsoft.com/windows/apps/windows-app-sdk/) +- [WinUI 3 documentation](https://learn.microsoft.com/windows/apps/winui/winui3/) +- [Release notes](https://github.com/microsoft/WindowsAppSDK/releases) +- [File an issue](https://github.com/microsoft/WindowsAppSDK/issues) + +## Contributing + +This template pack is built from the +[WindowsAppSDK](https://github.com/microsoft/WindowsAppSDK) repository under +`dev/Templates/Dotnet/`. The templates share the same XAML, code-behind, +and project files as the Visual Studio templates under +`dev/Templates/Source/ProjectTemplates/` and +`dev/Templates/Source/ItemTemplates/`, so there is only one copy to maintain. + +### Local Testing + +1. Pack the templates: + ```shell + dotnet pack dev/Templates/Dotnet/WinAppSdk.CSharp.DotnetNewTemplates.csproj -c Release -o localpackages + ``` +2. Uninstall any previous version: + ```shell + dotnet new uninstall Microsoft.WindowsAppSDK.WinUI.CSharp.Templates + ``` +3. Install the local package: + ```shell + dotnet new install ./localpackages/Microsoft.WindowsAppSDK.WinUI.CSharp.Templates..nupkg + ``` + +For an automated end-to-end run that scaffolds, builds, and (optionally) +launches every template, use the included script: + +```powershell +.\dev\Templates\Dotnet\Test-DotnetNewTemplates.ps1 # full run +.\dev\Templates\Dotnet\Test-DotnetNewTemplates.ps1 -SkipAppLaunch # CI-friendly +``` + +### Validation Checklist + +- Run `dotnet pack` locally and `dotnet new install` to verify the local build. +- Run `dotnet new list winui` to review and confirm all templates are registered. +- Build generated projects for x64, x86, and ARM64 in Visual Studio or `dotnet build`. +- Test packaged deployments on Windows 10 version 1809 or later. diff --git a/dev/Templates/Dotnet/Test-DotnetNewTemplates.ps1 b/dev/Templates/Dotnet/Test-DotnetNewTemplates.ps1 new file mode 100644 index 0000000000..4eb1810e73 --- /dev/null +++ b/dev/Templates/Dotnet/Test-DotnetNewTemplates.ps1 @@ -0,0 +1,488 @@ +# Copyright (c) Microsoft Corporation. +# Licensed under the MIT License. + +<#+ +.SYNOPSIS +Validates the WinUI 3 dotnet new template pack end-to-end. + +.DESCRIPTION +Builds (or consumes) the template NuGet package, reinstalls it locally, and +scaffolds every WinUI 3 project and item template. Each generated project is +built, and app templates are optionally launched via dotnet run using the +recommended WinAppSDK self-contained properties. + +.PARAMETER PackagePath +Path to an existing Microsoft.WindowsAppSDK.WinUI.CSharp.Templates .nupkg. When +omitted, the script runs dotnet pack to create a package under -PackOutputDirectory. + +.PARAMETER Configuration +MSBuild configuration used for dotnet pack (default: Release). + +.PARAMETER PackOutputDirectory +Directory (relative to the repo root or absolute) where dotnet pack should emit +the .nupkg (default: localpackages). + +.PARAMETER Platforms +One or more MSBuild Platform values to validate for each template (default: x64). + +.PARAMETER SkipAppLaunch +Skips launching the generated WinUI apps at the end of the run. Builds still +occur. + +.PARAMETER RunTimeoutSeconds +If greater than zero, any WinUI apps launched at the end of the run are +automatically closed after the specified number of seconds. A value of 0 keeps +them open until you close each window manually (default). + +.PARAMETER KeepWorkingDirectory +Preserves the temporary scaffolding directory instead of deleting it. + +.EXAMPLE +PS> ./Test-DotnetNewTemplates.ps1 + +Builds the template pack, installs it, scaffolds every template, and runs app +templates for x64. + +.EXAMPLE +PS> ./Test-DotnetNewTemplates.ps1 -PackagePath C:/tmp/Templates.nupkg -Platforms x64,arm64 -SkipAppLaunch + +Installs the provided package and validates builds for both x64 and arm64 +without launching the apps. +#> +[CmdletBinding()] +param( + [Parameter()] + [string]$PackagePath, + + [Parameter()] + [string]$Configuration = 'Release', + + [Parameter()] + [string]$PackOutputDirectory = 'localpackages', + + [Parameter()] + [string[]]$Platforms = @('x64'), + + [Parameter()] + [switch]$SkipAppLaunch, + + [Parameter()] + [int]$RunTimeoutSeconds = 0, + + [Parameter()] + [switch]$KeepWorkingDirectory +) + +Set-StrictMode -Version 2.0 +$ErrorActionPreference = 'Stop' + +$script:exitCode = 0 +$results = New-Object System.Collections.Generic.List[object] +$appExecutables = New-Object System.Collections.Generic.List[object] +$dotnetPath = (Get-Command dotnet -ErrorAction Stop).Source +$workingRoot = $null +$originalNugetPackages = $env:NUGET_PACKAGES + +function Write-Step { + param([string]$Message) + Write-Host "`n>> $Message" -ForegroundColor Cyan +} + +function Add-Result { + param( + [string]$Template, + [string]$Platform, + [string]$Step, + [string]$Status, + [string]$Path + ) + + $results.Add([pscustomobject]@{ + Template = $Template + Platform = $Platform + Step = $Step + Status = $Status + Path = $Path + }) | Out-Null +} + +function Invoke-DotnetCommand { + param( + [string[]]$Arguments, + [string]$WorkingDirectory, + [string]$Description, + [switch]$CaptureOutput + ) + + $display = "dotnet {0}" -f ($Arguments -join ' ') + Write-Step "$display ($Description)" + + Push-Location -Path $WorkingDirectory + try { + # Temporarily allow stderr from native commands to avoid treating + # non-fatal messages (e.g. dotnet template update checks) as + # terminating errors. Real failures are caught via $LASTEXITCODE. + $savedEAP = $ErrorActionPreference + $ErrorActionPreference = 'Continue' + if ($CaptureOutput.IsPresent) { + $output = & $dotnetPath @Arguments 2>&1 + } + else { + & $dotnetPath @Arguments 2>&1 | ForEach-Object { Write-Host $_ } + } + $exitCode = $LASTEXITCODE + } + finally { + $ErrorActionPreference = $savedEAP + Pop-Location + } + + if ($exitCode -ne 0) { + throw "dotnet $Description failed with exit code $exitCode" + } + + if ($CaptureOutput.IsPresent) { + return $output + } +} + +function Get-TemplatePackagePath { + param( + [string]$PackagePathOverride, + [string]$ProjectPath, + [string]$Configuration, + [string]$PackOutputDirectory, + [string]$RepoRoot + ) + + if ($PackagePathOverride) { + if (-not (Test-Path -Path $PackagePathOverride -PathType Leaf)) { + throw "PackagePath '$PackagePathOverride' does not exist." + } + return (Resolve-Path -Path $PackagePathOverride).Path + } + + $packOutput = if ([System.IO.Path]::IsPathRooted($PackOutputDirectory)) { + $PackOutputDirectory + } + else { + Join-Path -Path $RepoRoot -ChildPath $PackOutputDirectory + } + + if (-not (Test-Path -Path $packOutput)) { + Write-Step "Creating pack output directory '$packOutput'" + New-Item -ItemType Directory -Path $packOutput -Force | Out-Null + } + + Invoke-DotnetCommand -Arguments @('pack', $ProjectPath, '-c', $Configuration, '-o', $packOutput) -WorkingDirectory $RepoRoot -Description "pack template project" + + $package = Get-ChildItem -Path $packOutput -Filter 'Microsoft.WindowsAppSDK*.nupkg' | Sort-Object LastWriteTime -Descending | Select-Object -First 1 + if (-not $package) { + throw "No template package was produced in '$packOutput'." + } + return $package.FullName +} + +function Remove-TemplatePackIfPresent { + param([string]$RepoRoot) + + try { + Invoke-DotnetCommand -Arguments @('new', 'uninstall', 'Microsoft.WindowsAppSDK.WinUI.CSharp.Templates') -WorkingDirectory $RepoRoot -Description 'uninstall existing template pack' + } + catch { + Write-Step 'Template pack uninstall reported no installed instances; continuing.' + } +} + +function Install-TemplatePack { + param( + [string]$RepoRoot, + [string]$PackageToInstall + ) + + Remove-StaleTemplateEnginePackage -PackagePath $PackageToInstall + Invoke-DotnetCommand -Arguments @('new', 'install', $PackageToInstall) -WorkingDirectory $RepoRoot -Description 'install template pack' +} + +function Remove-StaleTemplateEnginePackage { + param([string]$PackagePath) + + $packageFileName = [System.IO.Path]::GetFileName($PackagePath) + $templateEngineDir = Join-Path -Path $env:USERPROFILE -ChildPath '.templateengine\packages' + if (-not (Test-Path -Path $templateEngineDir -PathType Container)) { + return + } + + $cachedPackage = Join-Path -Path $templateEngineDir -ChildPath $packageFileName + if (Test-Path -Path $cachedPackage -PathType Leaf) { + Write-Step "Removing cached template package '$cachedPackage'" + Remove-Item -Path $cachedPackage -Force + } +} + +function Get-AppExecutablePath { + param( + [string]$ProjectPath, + [string]$ProjectName + ) + + $binFolder = Join-Path -Path $ProjectPath -ChildPath 'bin' + if (-not (Test-Path -Path $binFolder -PathType Container)) { + return $null + } + + $exe = Get-ChildItem -Path $binFolder -Filter "$ProjectName.exe" -Recurse -ErrorAction SilentlyContinue | Sort-Object LastWriteTime -Descending | Select-Object -First 1 + if ($exe) { + return $exe.FullName + } + return $null +} + +function Launch-AppExecutables { + param([int]$TimeoutSeconds) + + if ($appExecutables.Count -eq 0) { + Write-Step 'No WinUI executables were recorded for launch.' + return + } + + Write-Step 'Launching WinUI apps for manual validation...' + foreach ($entry in $appExecutables) { + Write-Host "Launching $($entry.Template) ($($entry.Platform)) -> $($entry.Path)" -ForegroundColor Yellow + try { + $process = Start-Process -FilePath $entry.Path -PassThru -WindowStyle Normal + if ($TimeoutSeconds -gt 0) { + $exited = $process.WaitForExit($TimeoutSeconds * 1000) + if (-not $exited) { + Write-Warning "App '$($entry.Path)' is still running after $TimeoutSeconds seconds; terminating process." + $process.Kill() + } + elseif ($process.ExitCode -ne 0) { + Write-Warning "App '$($entry.Path)' exited with code $($process.ExitCode)." + } + } + } + catch { + Write-Warning "Failed to start '$($entry.Path)': $_" + } + } + + if ($TimeoutSeconds -le 0) { + Write-Host "`nAll WinUI apps are running. Manually validate them and close each window when finished." -ForegroundColor Cyan + } +} + +function New-ProjectFromTemplate { + param( + [string]$TemplateShortName, + [string]$ProjectName, + [string]$OutputPath, + [string]$WorkingDirectory + ) + + if (-not (Test-Path -Path $OutputPath)) { + New-Item -ItemType Directory -Path $OutputPath -Force | Out-Null + } + + Invoke-DotnetCommand -Arguments @('new', $TemplateShortName, '-n', $ProjectName, '-o', $OutputPath, '--force', '--no-update-check') -WorkingDirectory $WorkingDirectory -Description "create $TemplateShortName template" +} + +function Test-WinUiProjectTemplate { + param( + [string]$TemplateShortName, + [ValidateSet('App', 'Library', 'Test')] + [string]$Kind, + [string]$Platform, + [string]$WorkingRoot + ) + + $projectName = '{0}_{1}_{2}' -f $TemplateShortName, $Platform, ([Guid]::NewGuid().ToString('N').Substring(0, 8)) + $projectPath = Join-Path -Path $WorkingRoot -ChildPath $projectName + New-ProjectFromTemplate -TemplateShortName $TemplateShortName -ProjectName $projectName -OutputPath $projectPath -WorkingDirectory $WorkingRoot + Add-Result -Template $TemplateShortName -Platform $Platform -Step 'create' -Status 'Succeeded' -Path $projectPath + + $projectFile = Join-Path -Path $projectPath -ChildPath "$projectName.csproj" + + switch ($Kind) { + 'App' { + Invoke-DotnetCommand -Arguments @('build', $projectFile, '-p:Configuration=Debug', "-p:Platform=$Platform", '-p:WindowsPackageType=None') -WorkingDirectory $projectPath -Description 'build app template' + Add-Result -Template $TemplateShortName -Platform $Platform -Step 'build' -Status 'Succeeded' -Path $projectFile + + $exePath = Get-AppExecutablePath -ProjectPath $projectPath -ProjectName $projectName + if ($exePath) { + $appExecutables.Add([pscustomobject]@{ + Template = $TemplateShortName + Platform = $Platform + Path = $exePath + }) | Out-Null + } + else { + Write-Warning "Unable to locate executable for template '$TemplateShortName' at '$projectPath'." + } + } + 'Library' { + Invoke-DotnetCommand -Arguments @('build', $projectFile, '-c', 'Debug') -WorkingDirectory $projectPath -Description 'build library template' + Add-Result -Template $TemplateShortName -Platform 'AnyCPU' -Step 'build' -Status 'Succeeded' -Path $projectFile + } + 'Test' { + Invoke-DotnetCommand -Arguments @('test', $projectFile, '-p:Configuration=Debug', "-p:Platform=$Platform") -WorkingDirectory $projectPath -Description 'test packaged test template' + Add-Result -Template $TemplateShortName -Platform $Platform -Step 'test' -Status 'Succeeded' -Path $projectFile + } + } +} + +function Test-ItemTemplates { + param( + [string]$WorkingRoot, + [string]$Platform + ) + + $hostName = 'ItemHost_{0}' -f ([Guid]::NewGuid().ToString('N').Substring(0, 8)) + $hostPath = Join-Path -Path $WorkingRoot -ChildPath $hostName + New-ProjectFromTemplate -TemplateShortName 'winui' -ProjectName $hostName -OutputPath $hostPath -WorkingDirectory $WorkingRoot + Add-Result -Template 'winui (item host)' -Platform $Platform -Step 'create' -Status 'Succeeded' -Path $hostPath + + $projectFile = Join-Path -Path $hostPath -ChildPath "$hostName.csproj" + $itemTemplates = @( + @{ ShortName = 'winui-page'; Name = 'SettingsPage' }, + @{ ShortName = 'winui-window'; Name = 'SecondaryWindow' }, + @{ ShortName = 'winui-usercontrol'; Name = 'ProfileCard' }, + @{ ShortName = 'winui-templatedcontrol'; Name = 'DashboardControl' }, + @{ ShortName = 'winui-resourcedictionary'; Name = 'Colors' }, + @{ ShortName = 'winui-resw'; Name = 'Strings' }, + @{ ShortName = 'winui-dialog'; Name = 'ConfirmationDialog' } + ) + + foreach ($item in $itemTemplates) { + $args = @('new', $item.ShortName, '-n', $item.Name, '--project', $projectFile, '--force', '--no-update-check') + Invoke-DotnetCommand -Arguments $args -WorkingDirectory $hostPath -Description "create item template $($item.ShortName)" + Add-Result -Template $item.ShortName -Platform $Platform -Step 'add item' -Status 'Succeeded' -Path $projectFile + } + + Invoke-DotnetCommand -Arguments @('build', $projectFile, '-p:Configuration=Debug', "-p:Platform=$Platform", '-p:WindowsPackageType=None') -WorkingDirectory $hostPath -Description 'build item host' + Add-Result -Template 'winui (item host)' -Platform $Platform -Step 'build' -Status 'Succeeded' -Path $projectFile +} + +try { + $repoRoot = (Resolve-Path -Path (Join-Path -Path $PSScriptRoot -ChildPath '..\..\..')).Path + $templateProject = Join-Path -Path $repoRoot -ChildPath 'dev\Templates\Dotnet\WinAppSdk.CSharp.DotnetNewTemplates.csproj' + $tempBase = Join-Path -Path ([System.IO.Path]::GetTempPath()) -ChildPath 'DotnetNewTemplateValidation' + $workingRoot = Join-Path -Path $tempBase -ChildPath ([Guid]::NewGuid().ToString('N')) + + if (Test-Path -Path $workingRoot) { + Remove-Item -Path $workingRoot -Recurse -Force + } + New-Item -ItemType Directory -Path $workingRoot -Force | Out-Null + + $nugetFallback = Join-Path -Path $workingRoot -ChildPath '.nuget' + New-Item -ItemType Directory -Path $nugetFallback -Force | Out-Null + $env:NUGET_PACKAGES = $nugetFallback + + # Disable the MSBuild server to avoid lingering processes on CI agents. + $env:DOTNET_CLI_DO_NOT_USE_MSBUILD_SERVER = 'true' + + # Generate a NuGet.config so scaffolded projects resolve packages from + # internal feeds only. The repo's NuGet.config has relative local-source + # paths (tools/nuget, localpackages) that don't exist under the temp + # directory, and nuget.org is blocked by OneBranch network isolation. + # We extract only the remote (https) feeds from the repo config. + $repoNugetConfig = Join-Path -Path $repoRoot -ChildPath 'NuGet.config' + $workNugetConfig = Join-Path -Path $workingRoot -ChildPath 'NuGet.config' + if (Test-Path -Path $repoNugetConfig -PathType Leaf) { + [xml]$srcConfig = Get-Content -Path $repoNugetConfig + $remoteSources = $srcConfig.configuration.packageSources.add | + Where-Object { $_.value -match '^https?://' } + + if (-not $remoteSources) { + throw "No remote (https) NuGet sources found in $repoNugetConfig." + } + + $configLines = @( + '' + '' + ' ' + ' ' + ) + foreach ($src in $remoteSources) { + $configLines += ' ' -f $src.key, $src.value + } + $configLines += @( + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + ' ' + '' + ) + $configLines | Set-Content -Path $workNugetConfig -Encoding UTF8 + Write-Step "Generated NuGet.config with remote feeds in working directory" + } + + $packageToInstall = Get-TemplatePackagePath -PackagePathOverride $PackagePath -ProjectPath $templateProject -Configuration $Configuration -PackOutputDirectory $PackOutputDirectory -RepoRoot $repoRoot + Write-Step "Using template package '$packageToInstall'" + + Remove-TemplatePackIfPresent -RepoRoot $repoRoot + Install-TemplatePack -RepoRoot $repoRoot -PackageToInstall $packageToInstall + + $projectTemplates = @( + @{ ShortName = 'winui'; Kind = 'App' }, + @{ ShortName = 'winui-navview'; Kind = 'App' }, + @{ ShortName = 'winui-lib'; Kind = 'Library' }, + # winui-unittest is a self-hosted packaged test runner: tests run + # from inside UnitTestApp.OnLaunched (which sets DispatcherQueue and + # acquires package identity) via UnitTestClient.Run(), not via + # `dotnet test`. Validate it as an App so we still confirm the + # template builds cleanly. + @{ ShortName = 'winui-unittest'; Kind = 'App' } + ) + + foreach ($template in $projectTemplates) { + foreach ($platform in $Platforms) { + Test-WinUiProjectTemplate -TemplateShortName $template.ShortName -Kind $template.Kind -Platform $platform -WorkingRoot $workingRoot + } + } + + Test-ItemTemplates -WorkingRoot $workingRoot -Platform $Platforms[0] + + if ($appExecutables.Count -gt 0) { + if ($SkipAppLaunch.IsPresent) { + Write-Step 'SkipAppLaunch specified; WinUI apps were not started automatically.' + } + else { + Launch-AppExecutables -TimeoutSeconds $RunTimeoutSeconds + } + } + + Write-Step 'All templates validated successfully.' +} +catch { + $script:exitCode = 1 + Write-Error $_ +} +finally { + if ($null -ne $originalNugetPackages) { + $env:NUGET_PACKAGES = $originalNugetPackages + } + else { + Remove-Item Env:NUGET_PACKAGES -ErrorAction SilentlyContinue + } + + Remove-Item Env:DOTNET_CLI_DO_NOT_USE_MSBUILD_SERVER -ErrorAction SilentlyContinue + + if (-not $KeepWorkingDirectory.IsPresent -and (Test-Path -Path $workingRoot)) { + Write-Step "Cleaning up '$workingRoot'" + Remove-Item -Path $workingRoot -Recurse -Force -ErrorAction SilentlyContinue + } + elseif ($KeepWorkingDirectory.IsPresent -and $workingRoot) { + Write-Step "Preserving working directory at '$workingRoot'" + } + + if ($results.Count -gt 0) { + Write-Host "`nTemplate Validation Summary" -ForegroundColor Green + $results | Format-Table Template, Platform, Step, Status, Path -AutoSize | Out-String | Write-Host + } +} + +exit $script:exitCode \ No newline at end of file diff --git a/dev/Templates/Dotnet/WinAppSdk.CSharp.DotnetNewTemplates.csproj b/dev/Templates/Dotnet/WinAppSdk.CSharp.DotnetNewTemplates.csproj new file mode 100644 index 0000000000..2e6c1b5931 --- /dev/null +++ b/dev/Templates/Dotnet/WinAppSdk.CSharp.DotnetNewTemplates.csproj @@ -0,0 +1,175 @@ + + + + + + net8.0 + false + disable + false + false + true + Template + Microsoft.WindowsAppSDK.WinUI.CSharp.Templates + 0.0.6-alpha + WinUI 3 C# Templates + Microsoft + Microsoft + Official WinUI 3 project and item templates. Install this pack to use dotnet new for different types of apps, class libraries, unit tests and common WinUI controls. + windows;winappsdk;winui;winui3;desktop;dotnet-new;templates;csharp + https://learn.microsoft.com/windows/apps/windows-app-sdk/ + https://github.com/microsoft/WindowsAppSDK + git + MIT + README.md + © Microsoft Corporation. All rights reserved. + false + See https://github.com/microsoft/WindowsAppSDK/releases for release notes. + true + $(NoWarn);NU5128;CS2008 + $([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)..\..\..\localpackages')) + + + + + + + + + <_GitignoreSource>templates\gitignore.txt + + + + + + + + + + + + + + + + +(); +var commonExcludeNames = new HashSet(StringComparer.OrdinalIgnoreCase) { "bin", "obj" }; + +// Add one file -> one packed entry. Sets Pack/PackagePath so NuGet picks it up. +void Emit(string sourcePath, string packagePath) +{ + var item = new TaskItem(sourcePath); + item.SetMetadata("Pack", "true"); + item.SetMetadata("PackagePath", packagePath); + output.Add(item); +} + +// Recursively pack every file under fromDir into toRelRoot, optionally skipping +// files whose path relative to fromDir matches `skipRelative`. +void EmitTree(string fromDir, string toRelRoot, Func skipRelative = null) +{ + if (!Directory.Exists(fromDir)) { return; } + foreach (var file in Directory.EnumerateFiles(fromDir, "*", SearchOption.AllDirectories)) + { + string rel = file.Substring(fromDir.Length).TrimStart('\\', '/'); + if (skipRelative != null && skipRelative(rel)) { continue; } + Emit(file, toRelRoot + "/" + rel.Replace('\\', '/')); + } +} + +foreach (var t in Templates) +{ + string srcDir = t.GetMetadata("SourceDir"); + string configDir = t.GetMetadata("DotnetConfigDir"); + string baseName = t.GetMetadata("BaseName"); + string renameFrom = t.GetMetadata("RenameManifestFrom"); + string contentRoot = "content/" + t.ItemSpec; + + // Files in the Source tree that are VSIX-only sidecars (excluded from the dotnet-new pack). + // The Source-named manifest, if any, is excluded here and re-emitted under the reserved name below. + var sidecars = new HashSet(StringComparer.OrdinalIgnoreCase) + { + baseName + ".csproj", + baseName + ".ico", + baseName + ".png", + baseName + ".vstemplate", + }; + if (!string.IsNullOrEmpty(renameFrom)) { sidecars.Add(renameFrom); } + + // 1. Template source tree, minus bin/obj and the VSIX-only sidecars. + EmitTree(srcDir, contentRoot, rel => + { + var parts = rel.Split(new[] { '\\', '/' }, 2); + return commonExcludeNames.Contains(parts[0]) + || (parts.Length == 1 && sidecars.Contains(parts[0])); + }); + + // 2. Source-named manifest -> reserved Package.appxmanifest, if requested. + // An empty/unset RenameManifestFrom means the template has no manifest (e.g. class library) + // and is allowed. A non-empty value MUST resolve to a real file -- otherwise it's almost + // certainly a typo in templates.props that would silently ship a manifest-less template. + if (!string.IsNullOrEmpty(renameFrom)) + { + string manifestPath = Path.Combine(srcDir, renameFrom); + if (!File.Exists(manifestPath)) + { + Log.LogError( + "Template '{0}': RenameManifestFrom='{1}' but '{2}' does not exist. " + + "Fix the filename in templates.props, add the manifest under SourceDir, " + + "or clear RenameManifestFrom if this template has no manifest.", + t.ItemSpec, renameFrom, manifestPath); + continue; + } + Emit(manifestPath, contentRoot + "/Package.appxmanifest"); + } + + // 3. dotnet-new template configuration. + EmitTree(Path.Combine(configDir, ".template.config"), contentRoot + "/.template.config"); + + // 4. Shared .gitignore (one copy per template). + if (!string.IsNullOrEmpty(GitignoreSource) && File.Exists(GitignoreSource)) + { + Emit(GitignoreSource, contentRoot + "/gitignore.txt"); + } +} + +ExpandedItems = output.ToArray(); +]]> + + + + + + + + + + + + + + + + diff --git a/dev/Templates/Dotnet/templates/blank-app/.template.config/dotnetcli.host.json b/dev/Templates/Dotnet/templates/blank-app/.template.config/dotnetcli.host.json new file mode 100644 index 0000000000..481c8098eb --- /dev/null +++ b/dev/Templates/Dotnet/templates/blank-app/.template.config/dotnetcli.host.json @@ -0,0 +1,25 @@ +{ + "$schema": "https://json.schemastore.org/dotnetcli.host", + "symbolInfo": { + "dotnetVersion": { + "longName": "dotnet-version", + "shortName": "tfm", + "description": "Base TFM for the WinUI project (for example net10.0)." + }, + "targetPlatformMinVersion": { + "longName": "target-platform-min-version", + "shortName": "tpmv", + "description": "Minimum supported Windows version." + }, + "publisherDn": { + "longName": "publisher-dn", + "shortName": "publisher", + "description": "Publisher distinguished name stored in Package.appxmanifest." + }, + "publisherDisplay": { + "longName": "publisher-display", + "shortName": "publisherName", + "description": "Publisher display name stored in Package.appxmanifest." + } + } +} diff --git a/dev/Templates/Dotnet/templates/blank-app/.template.config/icon.png b/dev/Templates/Dotnet/templates/blank-app/.template.config/icon.png new file mode 100644 index 0000000000..1e450cb9b3 Binary files /dev/null and b/dev/Templates/Dotnet/templates/blank-app/.template.config/icon.png differ diff --git a/dev/Templates/Dotnet/templates/blank-app/.template.config/ide.host.json b/dev/Templates/Dotnet/templates/blank-app/.template.config/ide.host.json new file mode 100644 index 0000000000..cf34697102 --- /dev/null +++ b/dev/Templates/Dotnet/templates/blank-app/.template.config/ide.host.json @@ -0,0 +1,47 @@ +{ + "icon": "icon.png", + "requiredComponents": [ + { + "id": "Microsoft.VisualStudio.Workload.ManagedDesktop", + "hostId": "vs", + "componentType": "setupComponent" + } + ], + "symbolInfo": [ + { + "id": "dotnetVersion", + "name": { + "text": "Framework" + }, + "isVisible": "true" + }, + { + "id": "targetPlatformMinVersion", + "name": { + "text": "Target Platform Minimum Version" + }, + "isVisible": "true" + }, + { + "id": "publisherDn", + "name": { + "text": "Publisher Distinguished Name" + }, + "isVisible": "true" + }, + { + "id": "publisherDisplay", + "name": { + "text": "Publisher Display Name" + }, + "isVisible": "true" + }, + { + "id": "UseLatestWindowsAppSDK", + "name": { + "text": "Use latest Windows App SDK version" + }, + "isVisible": "true" + } + ] +} diff --git a/dev/Templates/Dotnet/templates/blank-app/.template.config/template.json b/dev/Templates/Dotnet/templates/blank-app/.template.config/template.json new file mode 100644 index 0000000000..84cf724979 --- /dev/null +++ b/dev/Templates/Dotnet/templates/blank-app/.template.config/template.json @@ -0,0 +1,235 @@ +{ + "$schema": "https://json.schemastore.org/template", + "author": "Microsoft", + "classifications": [ "Windows", "WinUI", "Desktop", "XAML" ], + "tags": { + "language": "C#", + "type": "project" + }, + "identity": "Microsoft.WindowsAppSDK.WinUI.CSharp.BlankApp", + "groupIdentity": "Microsoft.WindowsAppSDK.WinUI.CSharp.BlankApp", + "name": "WinUI Blank App", + "shortName": ["winui", "winui3", "wasdk-single"], + "sourceName": "ProjectTemplate", + "defaultName": "WinUIApp", + "description": "Creates a blank WinUI 3 desktop app with MSIX packaging.", + "preferNameDirectory": true, + "constraints": { + "windows-only": { + "type": "os", + "args": "Windows" + }, + "sdk-version": { + "type": "sdk-version", + "args": [ "[8.0,)" ] + } + }, + "symbols": { + "safeProjectName": { + "type": "derived", + "valueSource": "name", + "valueTransform": "safe_name", + "replaces": "$safeprojectname$" + }, + "projectName": { + "type": "derived", + "valueSource": "name", + "valueTransform": "identity", + "replaces": "$projectname$" + }, + "cliVersion": { + "type": "bind", + "binding": "host:dotnet-cli-version", + "defaultValue": "10.0.100" + }, + "autoDetectedTfm": { + "type": "generated", + "generator": "regex", + "datatype": "string", + "parameters": { + "source": "cliVersion", + "steps": [ + { + "regex": "^(\\d+)\\..*$", + "replacement": "net${1}.0" + } + ] + } + }, + "dotnetVersion": { + "type": "parameter", + "datatype": "choice", + "description": "Base target framework moniker (TFM) for the WinUI project. Defaults to the installed SDK version.", + "choices": [ + { "choice": "net8.0", "description": "Target .NET 8" }, + { "choice": "net9.0", "description": "Target .NET 9" }, + { "choice": "net10.0", "description": "Target .NET 10" } + ], + "defaultValue": "net10.0" + }, + "resolvedDotnetVersion": { + "type": "generated", + "generator": "coalesce", + "parameters": { + "sourceVariableName": "dotnetVersion", + "fallbackVariableName": "autoDetectedTfm" + }, + "replaces": "$DotNetVersion$" + }, + "targetPlatformMinVersion": { + "type": "parameter", + "datatype": "choice", + "replaces": "$targetplatformminversion$", + "defaultValue": "10.0.26100.0", + "choices": [ + { + "choice": "10.0.17763.0", + "description": "10.0.17763.0" + }, + { + "choice": "10.0.19041.0", + "description": "10.0.19041.0" + }, + { + "choice": "10.0.22000.0", + "description": "10.0.22000.0" + }, + { + "choice": "10.0.22621.0", + "description": "10.0.22621.0" + }, + { + "choice": "10.0.26100.0", + "description": "10.0.26100.0" + }, + { + "choice": "10.0.26200.0", + "description": "10.0.26200.0" + }, + { + "choice": "10.0.28000.0", + "description": "10.0.28000.0" + } + ], + "description": "Minimum supported Windows version." + }, + "publisherDn": { + "type": "parameter", + "datatype": "text", + "replaces": "$XmlEscapedPublisherDistinguishedName$", + "defaultValue": "CN=AppPublisher", + "description": "Publisher distinguished name used inside Package.appxmanifest." + }, + "publisherDisplay": { + "type": "parameter", + "datatype": "text", + "replaces": "$XmlEscapedPublisher$", + "defaultValue": "AppPublisher", + "description": "Publisher display name shown in the manifest and Settings page." + }, + "guid9": { + "type": "generated", + "generator": "guid", + "parameters": { + "format": "D" + }, + "replaces": "$guid9$" + }, + "UseLatestWindowsAppSDK":{ + "type": "parameter", + "datatype": "bool", + "defaultValue": "true" + }, + "windowsAppSdkVersion": { + "type": "parameter", + "datatype": "text", + "replaces": "$WindowsAppSdkVersion$", + "defaultValue": "1.8.260317003", + "description": "Version of the Microsoft.WindowsAppSDK NuGet package." + }, + "windowsSdkBuildToolsVersion": { + "type": "parameter", + "datatype": "text", + "replaces": "$WindowsSdkBuildToolsVersion$", + "defaultValue": "10.0.26100.7705", + "description": "Version of the Microsoft.Windows.SDK.BuildTools NuGet package." + }, + "windowsSdkBuildToolsWinAppVersion": { + "type": "parameter", + "datatype": "text", + "replaces": "$WindowsSdkBuildToolsWinAppVersion$", + "defaultValue": "0.3.1", + "description": "Version of the Microsoft.Windows.SDK.BuildTools.WinApp NuGet package, which adds `dotnet run` support for packaged WinUI apps via the winapp CLI." + } + }, + "sources": [ + { + "modifiers": [ + { + "replacements": [ + { + "before": "$targetnametoken$", + "after": "{{safeProjectName}}" + }, + { + "before": "$targetentrypoint$", + "after": "{{safeProjectName}}.App" + } + ] + } + ], + "rename": { + "gitignore.txt": ".gitignore" + } + } + ], + "primaryOutputs": [ + { "path": "ProjectTemplate.csproj" } + ], + "forms": { + "safe_name": { + "identifier": "safe_name" + }, + "identity": { + "identifier": "identity" + } + }, + "postActions": [ + { + "actionId": "B17581D1-C5C9-4489-8F0A-004BE667B814", + "continueOnError": true, + "description": "Update Microsoft.WindowsAppSDK to the latest stable version.", + "args": { + "referenceType": "package", + "reference": "Microsoft.WindowsAppSDK" + }, + "manualInstructions": [{ "text": "Run 'dotnet add package Microsoft.WindowsAppSDK'" }] + }, + { + "actionId": "B17581D1-C5C9-4489-8F0A-004BE667B814", + "continueOnError": true, + "description": "Update Microsoft.Windows.SDK.BuildTools to the latest stable version.", + "args": { + "referenceType": "package", + "reference": "Microsoft.Windows.SDK.BuildTools" + }, + "manualInstructions": [{ "text": "Run 'dotnet add package Microsoft.Windows.SDK.BuildTools'" }] + }, + { + "actionId": "B17581D1-C5C9-4489-8F0A-004BE667B814", + "continueOnError": true, + "description": "Update Microsoft.Windows.SDK.BuildTools.WinApp to the latest stable version (enables `dotnet run` for packaged WinUI apps).", + "args": { + "referenceType": "package", + "reference": "Microsoft.Windows.SDK.BuildTools.WinApp" + }, + "manualInstructions": [{ "text": "Run 'dotnet add package Microsoft.Windows.SDK.BuildTools.WinApp'" }] + }, + { + "actionId": "210D431B-A78B-4D2F-B762-4ED3E3EA9025", + "continueOnError": true, + "description": "Restore NuGet packages required by this project.", + "manualInstructions": [{ "text": "Run 'dotnet restore'" }] + } + ] +} diff --git a/dev/Templates/Dotnet/templates/class-library/.template.config/dotnetcli.host.json b/dev/Templates/Dotnet/templates/class-library/.template.config/dotnetcli.host.json new file mode 100644 index 0000000000..33517743fd --- /dev/null +++ b/dev/Templates/Dotnet/templates/class-library/.template.config/dotnetcli.host.json @@ -0,0 +1,10 @@ +{ + "$schema": "https://json.schemastore.org/dotnetcli.host", + "symbolInfo": { + "dotnetVersion": { + "longName": "dotnet-version", + "shortName": "tfm", + "description": "Base TFM for the WinUI project (for example net10.0)." + } + } +} diff --git a/dev/Templates/Dotnet/templates/class-library/.template.config/icon.png b/dev/Templates/Dotnet/templates/class-library/.template.config/icon.png new file mode 100644 index 0000000000..6cae8b54f8 Binary files /dev/null and b/dev/Templates/Dotnet/templates/class-library/.template.config/icon.png differ diff --git a/dev/Templates/Dotnet/templates/class-library/.template.config/ide.host.json b/dev/Templates/Dotnet/templates/class-library/.template.config/ide.host.json new file mode 100644 index 0000000000..2d4b488c9b --- /dev/null +++ b/dev/Templates/Dotnet/templates/class-library/.template.config/ide.host.json @@ -0,0 +1,19 @@ +{ + "icon": "icon.png", + "requiredComponents": [ + { + "id": "Microsoft.VisualStudio.Workload.ManagedDesktop", + "hostId": "vs", + "componentType": "setupComponent" + } + ], + "symbolInfo": [ + { + "id": "dotnetVersion", + "name": { + "text": "Framework" + }, + "isVisible": "true" + } + ] +} diff --git a/dev/Templates/Dotnet/templates/class-library/.template.config/template.json b/dev/Templates/Dotnet/templates/class-library/.template.config/template.json new file mode 100644 index 0000000000..d2091eac15 --- /dev/null +++ b/dev/Templates/Dotnet/templates/class-library/.template.config/template.json @@ -0,0 +1,106 @@ +{ + "$schema": "https://json.schemastore.org/template", + "author": "Microsoft", + "classifications": ["Windows", "WinUI", "Library"], + "tags": { + "language": "C#", + "type": "project" + }, + "identity": "Microsoft.WindowsAppSDK.WinUI.CSharp.ClassLibrary", + "groupIdentity": "Microsoft.WindowsAppSDK.WinUI.CSharp.ClassLibrary", + "name": "WinUI Class Library", + "shortName": ["winui-lib", "winui3-lib", "wasdk-classlib"], + "sourceName": "ProjectTemplate", + "defaultName": "WinUILibrary", + "description": "Creates a WinUI 3 class library for sharing UI components.", + "preferNameDirectory": true, + "constraints": { + "windows-only": { + "type": "os", + "args": "Windows" + }, + "sdk-version": { + "type": "sdk-version", + "args": [ "[8.0,)" ] + } + }, + "symbols": { + "safeProjectName": { + "type": "derived", + "valueSource": "name", + "valueTransform": "safe_name", + "replaces": "$safeprojectname$" + }, + "projectName": { + "type": "derived", + "valueSource": "name", + "valueTransform": "identity", + "replaces": "$projectname$" + }, + "cliVersion": { + "type": "bind", + "binding": "host:dotnet-cli-version", + "defaultValue": "10.0.100" + }, + "autoDetectedTfm": { + "type": "generated", + "generator": "regex", + "datatype": "string", + "parameters": { + "source": "cliVersion", + "steps": [ + { + "regex": "^(\\d+)\\..*$", + "replacement": "net${1}.0" + } + ] + } + }, + "dotnetVersion": { + "type": "parameter", + "datatype": "choice", + "description": "Base target framework moniker (TFM) for the WinUI project. Defaults to the installed SDK version.", + "choices": [ + { "choice": "net8.0", "description": "Target .NET 8" }, + { "choice": "net9.0", "description": "Target .NET 9" }, + { "choice": "net10.0", "description": "Target .NET 10" } + ], + "defaultValue": "net10.0" + }, + "resolvedDotnetVersion": { + "type": "generated", + "generator": "coalesce", + "parameters": { + "sourceVariableName": "dotnetVersion", + "fallbackVariableName": "autoDetectedTfm" + }, + "replaces": "$DotNetVersion$" + } + }, + "sources": [ + { + "rename": { + "gitignore.txt": ".gitignore" + } + } + ], + "primaryOutputs": [ + { "path": "ProjectTemplate.csproj" } + ], + "forms": { + "safe_name": { + "identifier": "safe_name" + }, + "identity": { + "identifier": "identity" + } + }, + "postActions": [ + { + "actionId": "210D431B-A78B-4D2F-B762-4ED3E3EA9025", + "continueOnError": true, + "description": "Restore NuGet packages required by this project.", + "manualInstructions": [{ "text": "Run 'dotnet restore'" }] + } + ] +} diff --git a/dev/Templates/Dotnet/templates/gitignore.txt b/dev/Templates/Dotnet/templates/gitignore.txt new file mode 100644 index 0000000000..dd393563d9 --- /dev/null +++ b/dev/Templates/Dotnet/templates/gitignore.txt @@ -0,0 +1,54 @@ +## .NET / Visual Studio +[Bb]in/ +[Oo]bj/ +[Dd]ebug/ +[Rr]elease/ +.vs/ +*.user +*.suo +*.userosscache +*.sln.docstates +artifacts/ + +# Build logs +[Ll]og/ +[Ll]ogs/ +*.log +*.binlog + +# Test results +[Tt]est[Rr]esult*/ +*.trx +*.coverage +*.coveragexml + +# NuGet +*.nupkg +*.snupkg +*.nuget.props +*.nuget.targets +project.lock.json + +# MSIX packaging output +AppPackages/ +BundleArtifacts/ +*.msix +*.msixupload +*.appx +*.appxbundle +*.appxupload + +# Publish output +publish/ +*.pubxml +PublishScripts/ + +# Code analysis and tooling +_ReSharper*/ +*.DotSettings.user +*.dotCover +.idea/ + +# Generated files +Generated\ Files/ +*_wpftmp.csproj diff --git a/dev/Templates/Dotnet/templates/item-blank-page/.template.config/dotnetcli.host.json b/dev/Templates/Dotnet/templates/item-blank-page/.template.config/dotnetcli.host.json new file mode 100644 index 0000000000..07c0730f73 --- /dev/null +++ b/dev/Templates/Dotnet/templates/item-blank-page/.template.config/dotnetcli.host.json @@ -0,0 +1,9 @@ +{ + "$schema": "http://json.schemastore.org/dotnetcli.host", + "symbolInfo": { + "rootNamespace": { + "longName": "root-namespace", + "shortName": "ns" + } + } +} diff --git a/dev/Templates/Dotnet/templates/item-blank-page/.template.config/template.json b/dev/Templates/Dotnet/templates/item-blank-page/.template.config/template.json new file mode 100644 index 0000000000..80af991e23 --- /dev/null +++ b/dev/Templates/Dotnet/templates/item-blank-page/.template.config/template.json @@ -0,0 +1,62 @@ +{ + "$schema": "https://json.schemastore.org/template", + "author": "Microsoft", + "classifications": ["Windows", "WinUI", "Item", "Page"], + "tags": { + "language": "C#", + "type": "item" + }, + "identity": "Microsoft.WindowsAppSDK.WinUI.CSharp.Item.Page", + "groupIdentity": "Microsoft.WindowsAppSDK.WinUI.CSharp.Item.Page", + "name": "WinUI Blank Page (Item)", + "shortName": ["winui-page", "winui3-page"], + "sourceName": "BlankPage", + "defaultName": "BlankPage", + "description": "Adds a WinUI 3 Page with XAML markup and code-behind.", + "preferNameDirectory": false, + "symbols": { + "rootNamespace": { + "type": "bind", + "binding": "msbuild:RootNamespace", + "replaces": "$rootnamespace$", + "defaultValue": "AppNamespace", + "description": "Namespace for the generated item." + }, + "safeItemName": { + "type": "derived", + "valueSource": "name", + "valueTransform": "safe_name", + "replaces": "$safeitemname$" + }, + "itemName": { + "type": "derived", + "valueSource": "name", + "valueTransform": "identity", + "replaces": "$itemname$" + }, + "fileInputName": { + "type": "derived", + "valueSource": "name", + "valueTransform": "identity", + "replaces": "$fileinputname$" + } + }, + "constraints": { + "winuiProject": { + "type": "project-capability", + "args": "CSharp & Msix" + } + }, + "primaryOutputs": [ + { "path": "BlankPage.xaml" }, + { "path": "BlankPage.xaml.cs" } + ], + "forms": { + "safe_name": { + "identifier": "safe_name" + }, + "identity": { + "identifier": "identity" + } + } +} diff --git a/dev/Templates/Dotnet/templates/item-blank-window/.template.config/dotnetcli.host.json b/dev/Templates/Dotnet/templates/item-blank-window/.template.config/dotnetcli.host.json new file mode 100644 index 0000000000..f5ea9a9bd0 --- /dev/null +++ b/dev/Templates/Dotnet/templates/item-blank-window/.template.config/dotnetcli.host.json @@ -0,0 +1,10 @@ +{ + "$schema": "https://json.schemastore.org/dotnetcli.host", + "symbolInfo": { + "rootNamespace": { + "longName": "root-namespace", + "shortName": "ns", + "description": "Namespace for the generated item." + } + } +} diff --git a/dev/Templates/Dotnet/templates/item-blank-window/.template.config/template.json b/dev/Templates/Dotnet/templates/item-blank-window/.template.config/template.json new file mode 100644 index 0000000000..5845179f18 --- /dev/null +++ b/dev/Templates/Dotnet/templates/item-blank-window/.template.config/template.json @@ -0,0 +1,80 @@ +{ + "$schema": "https://json.schemastore.org/template", + "author": "Microsoft", + "classifications": ["Windows", "WinUI", "Item"], + "tags": { + "language": "C#", + "type": "item" + }, + "identity": "Microsoft.WindowsAppSDK.WinUI.CSharp.Item.Window", + "groupIdentity": "Microsoft.WindowsAppSDK.WinUI.CSharp.Item.Window", + "name": "WinUI Blank Window (Item)", + "shortName": ["winui-window", "winui3-window", "wasdk-item-blankwin"], + "sourceName": "BlankWindow", + "defaultName": "BlankWindow", + "description": "Adds a WinUI 3 Window with XAML markup and code-behind.", + "tags": { + "language": "C#", + "type": "item" + }, + "preferNameDirectory": false, + "constraints": { + "windows-only": { + "type": "os", + "args": "Windows" + }, + "csharp-only": { + "type": "project-capability", + "args": "CSharp" + }, + "sdk-version": { + "type": "sdk-version", + "args": [ "[8.0,)" ] + } + }, + "symbols": { + "rootNamespace": { + "type": "bind", + "binding": "msbuild:RootNamespace", + "replaces": "$rootnamespace$", + "defaultValue": "AppNamespace", + "description": "Namespace for the generated item." + }, + "safeItemName": { + "type": "derived", + "valueSource": "name", + "valueTransform": "safe_name", + "replaces": "$safeitemname$" + }, + "itemName": { + "type": "derived", + "valueSource": "name", + "valueTransform": "identity", + "replaces": "$itemname$" + }, + "fileInputName": { + "type": "derived", + "valueSource": "name", + "valueTransform": "identity", + "replaces": "$fileinputname$" + } + }, + "constraints": { + "winuiProject": { + "type": "project-capability", + "args": "CSharp & Msix" + } + }, + "primaryOutputs": [ + { "path": "BlankWindow.xaml" }, + { "path": "BlankWindow.xaml.cs" } + ], + "forms": { + "safe_name": { + "identifier": "safe_name" + }, + "identity": { + "identifier": "identity" + } + } +} diff --git a/dev/Templates/Dotnet/templates/item-content-dialog/.template.config/dotnetcli.host.json b/dev/Templates/Dotnet/templates/item-content-dialog/.template.config/dotnetcli.host.json new file mode 100644 index 0000000000..07c0730f73 --- /dev/null +++ b/dev/Templates/Dotnet/templates/item-content-dialog/.template.config/dotnetcli.host.json @@ -0,0 +1,9 @@ +{ + "$schema": "http://json.schemastore.org/dotnetcli.host", + "symbolInfo": { + "rootNamespace": { + "longName": "root-namespace", + "shortName": "ns" + } + } +} diff --git a/dev/Templates/Dotnet/templates/item-content-dialog/.template.config/template.json b/dev/Templates/Dotnet/templates/item-content-dialog/.template.config/template.json new file mode 100644 index 0000000000..b5ec18c922 --- /dev/null +++ b/dev/Templates/Dotnet/templates/item-content-dialog/.template.config/template.json @@ -0,0 +1,86 @@ +{ + "$schema": "https://json.schemastore.org/template", + "author": "Microsoft", + "classifications": ["Windows", "WinUI", "Item", "Dialog"], + "tags": { + "language": "C#", + "type": "item" + }, + "identity": "Microsoft.WindowsAppSDK.WinUI.CSharp.Item.ContentDialog", + "groupIdentity": "Microsoft.WindowsAppSDK.WinUI.CSharp.Item.ContentDialog", + "name": "WinUI Content Dialog (Item)", + "shortName": ["winui-dialog", "winui3-dialog"], + "sourceName": "ContentDialog", + "defaultName": "ContentDialog", + "description": "Adds a WinUI 3 ContentDialog with markup and code-behind.", + "preferNameDirectory": false, + "symbols": { + "rootNamespace": { + "type": "bind", + "binding": "msbuild:RootNamespace", + "replaces": "$rootnamespace$", + "defaultValue": "AppNamespace", + "description": "Namespace for the generated item." + }, + "safeItemName": { + "type": "derived", + "valueSource": "name", + "valueTransform": "safe_name", + "replaces": "$safeitemname$" + }, + "itemName": { + "type": "derived", + "valueSource": "name", + "valueTransform": "identity", + "replaces": "$itemname$" + }, + "fileInputName": { + "type": "derived", + "valueSource": "name", + "valueTransform": "identity", + "replaces": "$fileinputname$" + }, + "contentDialogType": { + "type": "generated", + "generator": "constant", + "parameters": { + "value": "ContentDialog" + }, + "replaces": "__WINUI_CONTENT_DIALOG__" + }, + "contentDialogButtonClickEventArgsType": { + "type": "generated", + "generator": "constant", + "parameters": { + "value": "ContentDialogButtonClickEventArgs" + }, + "replaces": "__WINUI_CONTENT_DIALOG_BUTTON_CLICK_EVENT_ARGS__" + }, + "defaultContentDialogStyleResourceKey": { + "type": "generated", + "generator": "constant", + "parameters": { + "value": "DefaultContentDialogStyle" + }, + "replaces": "__WINUI_DEFAULT_CONTENT_DIALOG_STYLE__" + } + }, + "constraints": { + "winuiProject": { + "type": "project-capability", + "args": "CSharp & Msix" + } + }, + "primaryOutputs": [ + { "path": "ContentDialog.xaml" }, + { "path": "ContentDialog.xaml.cs" } + ], + "forms": { + "safe_name": { + "identifier": "safe_name" + }, + "identity": { + "identifier": "identity" + } + } +} diff --git a/dev/Templates/Dotnet/templates/item-resource-dictionary/.template.config/dotnetcli.host.json b/dev/Templates/Dotnet/templates/item-resource-dictionary/.template.config/dotnetcli.host.json new file mode 100644 index 0000000000..07c0730f73 --- /dev/null +++ b/dev/Templates/Dotnet/templates/item-resource-dictionary/.template.config/dotnetcli.host.json @@ -0,0 +1,9 @@ +{ + "$schema": "http://json.schemastore.org/dotnetcli.host", + "symbolInfo": { + "rootNamespace": { + "longName": "root-namespace", + "shortName": "ns" + } + } +} diff --git a/dev/Templates/Dotnet/templates/item-resource-dictionary/.template.config/template.json b/dev/Templates/Dotnet/templates/item-resource-dictionary/.template.config/template.json new file mode 100644 index 0000000000..85a6963a3e --- /dev/null +++ b/dev/Templates/Dotnet/templates/item-resource-dictionary/.template.config/template.json @@ -0,0 +1,69 @@ +{ + "$schema": "https://json.schemastore.org/template", + "author": "Microsoft", + "classifications": ["Windows", "WinUI", "Item", "Resource"], + "tags": { + "language": "C#", + "type": "item" + }, + "identity": "Microsoft.WindowsAppSDK.WinUI.CSharp.Item.ResourceDictionary", + "groupIdentity": "Microsoft.WindowsAppSDK.WinUI.CSharp.Item.ResourceDictionary", + "name": "WinUI Resource Dictionary (Item)", + "shortName": ["winui-resourcedictionary", "winui3-resourcedictionary"], + "sourceName": "ResourceDictionary", + "defaultName": "ResourceDictionary", + "description": "Adds a WinUI 3 ResourceDictionary for sharing styles and resources.", + "preferNameDirectory": false, + "symbols": { + "rootNamespace": { + "type": "bind", + "binding": "msbuild:RootNamespace", + "replaces": "$rootnamespace$", + "defaultValue": "AppNamespace", + "description": "Namespace for the generated item." + }, + "safeItemName": { + "type": "derived", + "valueSource": "name", + "valueTransform": "safe_name", + "replaces": "$safeitemname$" + }, + "itemName": { + "type": "derived", + "valueSource": "name", + "valueTransform": "identity", + "replaces": "$itemname$" + }, + "fileInputName": { + "type": "derived", + "valueSource": "name", + "valueTransform": "identity", + "replaces": "$fileinputname$" + }, + "resourceDictionaryType": { + "type": "generated", + "generator": "constant", + "parameters": { + "value": "ResourceDictionary" + }, + "replaces": "__WINUI_RESOURCE_DICTIONARY__" + } + }, + "constraints": { + "winuiProject": { + "type": "project-capability", + "args": "CSharp & Msix" + } + }, + "primaryOutputs": [ + { "path": "ResourceDictionary.xaml" } + ], + "forms": { + "safe_name": { + "identifier": "safe_name" + }, + "identity": { + "identifier": "identity" + } + } +} diff --git a/dev/Templates/Dotnet/templates/item-resw/.template.config/dotnetcli.host.json b/dev/Templates/Dotnet/templates/item-resw/.template.config/dotnetcli.host.json new file mode 100644 index 0000000000..94f4ee1014 --- /dev/null +++ b/dev/Templates/Dotnet/templates/item-resw/.template.config/dotnetcli.host.json @@ -0,0 +1,3 @@ +{ + "$schema": "http://json.schemastore.org/dotnetcli.host" +} diff --git a/dev/Templates/Dotnet/templates/item-resw/.template.config/template.json b/dev/Templates/Dotnet/templates/item-resw/.template.config/template.json new file mode 100644 index 0000000000..f1bfb76767 --- /dev/null +++ b/dev/Templates/Dotnet/templates/item-resw/.template.config/template.json @@ -0,0 +1,63 @@ +{ + "$schema": "https://json.schemastore.org/template", + "author": "Microsoft", + "classifications": ["Windows", "WinUI", "Item", "Resource"], + "tags": { + "language": "C#", + "type": "item" + }, + "identity": "Microsoft.WindowsAppSDK.WinUI.CSharp.Item.Resw", + "groupIdentity": "Microsoft.WindowsAppSDK.WinUI.CSharp.Item.Resw", + "name": "WinUI Resources File (Item)", + "shortName": ["winui-resw", "winui3-resw"], + "sourceName": "Resources", + "defaultName": "Resources", + "description": "Adds a RESW resources file for localized strings.", + "preferNameDirectory": false, + "symbols": { + "safeItemName": { + "type": "derived", + "valueSource": "name", + "valueTransform": "safe_name", + "replaces": "$safeitemname$" + }, + "itemName": { + "type": "derived", + "valueSource": "name", + "valueTransform": "identity", + "replaces": "$itemname$" + }, + "fileInputName": { + "type": "derived", + "valueSource": "name", + "valueTransform": "identity", + "replaces": "$fileinputname$" + } + }, + "constraints": { + "winuiProject": { + "type": "project-capability", + "args": "CSharp & Msix" + } + }, + "sources": [ + { + "modifiers": [ + { + "copyOnly": [ "**/*.resw" ] + } + ] + } + ], + "primaryOutputs": [ + { "path": "Resources.resw" } + ], + "forms": { + "safe_name": { + "identifier": "safe_name" + }, + "identity": { + "identifier": "identity" + } + } +} diff --git a/dev/Templates/Dotnet/templates/item-templated-control/.template.config/dotnetcli.host.json b/dev/Templates/Dotnet/templates/item-templated-control/.template.config/dotnetcli.host.json new file mode 100644 index 0000000000..07c0730f73 --- /dev/null +++ b/dev/Templates/Dotnet/templates/item-templated-control/.template.config/dotnetcli.host.json @@ -0,0 +1,9 @@ +{ + "$schema": "http://json.schemastore.org/dotnetcli.host", + "symbolInfo": { + "rootNamespace": { + "longName": "root-namespace", + "shortName": "ns" + } + } +} diff --git a/dev/Templates/Dotnet/templates/item-templated-control/.template.config/template.json b/dev/Templates/Dotnet/templates/item-templated-control/.template.config/template.json new file mode 100644 index 0000000000..c851c3ce83 --- /dev/null +++ b/dev/Templates/Dotnet/templates/item-templated-control/.template.config/template.json @@ -0,0 +1,78 @@ +{ + "$schema": "https://json.schemastore.org/template", + "author": "Microsoft", + "classifications": ["Windows", "WinUI", "Item", "Control"], + "tags": { + "language": "C#", + "type": "item" + }, + "identity": "Microsoft.WindowsAppSDK.WinUI.CSharp.Item.TemplatedControl", + "groupIdentity": "Microsoft.WindowsAppSDK.WinUI.CSharp.Item.TemplatedControl", + "name": "WinUI Templated Control (Item)", + "shortName": ["winui-templatedcontrol", "winui3-templatedcontrol"], + "sourceName": "CustomControl", + "defaultName": "CustomControl", + "description": "Adds a WinUI 3 templated control. By default also creates Themes\\Generic.xaml with a minimal default style. If your project already has a Themes\\Generic.xaml, pass --IncludeDefaultStyle false and manually add a + + diff --git a/dev/VSIX/ItemTemplates/Neutral/CSharp/TemplatedControl/WinUI.Neutral.Cs.TemplatedControl.csproj b/dev/Templates/Source/ItemTemplates/Neutral/CSharp/TemplatedControl/WinUI.Neutral.Cs.TemplatedControl.csproj similarity index 100% rename from dev/VSIX/ItemTemplates/Neutral/CSharp/TemplatedControl/WinUI.Neutral.Cs.TemplatedControl.csproj rename to dev/Templates/Source/ItemTemplates/Neutral/CSharp/TemplatedControl/WinUI.Neutral.Cs.TemplatedControl.csproj diff --git a/dev/VSIX/ItemTemplates/Neutral/CSharp/TemplatedControl/WinUI.Neutral.Cs.TemplatedControl.ico b/dev/Templates/Source/ItemTemplates/Neutral/CSharp/TemplatedControl/WinUI.Neutral.Cs.TemplatedControl.ico similarity index 100% rename from dev/VSIX/ItemTemplates/Neutral/CSharp/TemplatedControl/WinUI.Neutral.Cs.TemplatedControl.ico rename to dev/Templates/Source/ItemTemplates/Neutral/CSharp/TemplatedControl/WinUI.Neutral.Cs.TemplatedControl.ico diff --git a/dev/VSIX/ItemTemplates/Neutral/CSharp/TemplatedControl/WinUI.Neutral.Cs.TemplatedControl.vstemplate b/dev/Templates/Source/ItemTemplates/Neutral/CSharp/TemplatedControl/WinUI.Neutral.Cs.TemplatedControl.vstemplate similarity index 100% rename from dev/VSIX/ItemTemplates/Neutral/CSharp/TemplatedControl/WinUI.Neutral.Cs.TemplatedControl.vstemplate rename to dev/Templates/Source/ItemTemplates/Neutral/CSharp/TemplatedControl/WinUI.Neutral.Cs.TemplatedControl.vstemplate diff --git a/dev/VSIX/ItemTemplates/Neutral/CSharp/UserControl/UserControl.xaml b/dev/Templates/Source/ItemTemplates/Neutral/CSharp/UserControl/UserControl.xaml similarity index 90% rename from dev/VSIX/ItemTemplates/Neutral/CSharp/UserControl/UserControl.xaml rename to dev/Templates/Source/ItemTemplates/Neutral/CSharp/UserControl/UserControl.xaml index a4827ebfaa..2266654ed8 100644 --- a/dev/VSIX/ItemTemplates/Neutral/CSharp/UserControl/UserControl.xaml +++ b/dev/Templates/Source/ItemTemplates/Neutral/CSharp/UserControl/UserControl.xaml @@ -1,5 +1,5 @@ - - + diff --git a/dev/VSIX/ItemTemplates/Neutral/CSharp/UserControl/UserControl.xaml.cs b/dev/Templates/Source/ItemTemplates/Neutral/CSharp/UserControl/UserControl.xaml.cs similarity index 90% rename from dev/VSIX/ItemTemplates/Neutral/CSharp/UserControl/UserControl.xaml.cs rename to dev/Templates/Source/ItemTemplates/Neutral/CSharp/UserControl/UserControl.xaml.cs index 3134a41a44..ff7f2afb3e 100644 --- a/dev/VSIX/ItemTemplates/Neutral/CSharp/UserControl/UserControl.xaml.cs +++ b/dev/Templates/Source/ItemTemplates/Neutral/CSharp/UserControl/UserControl.xaml.cs @@ -18,7 +18,7 @@ namespace $rootnamespace$; -public sealed partial class $safeitemname$ : UserControl +public sealed partial class $safeitemname$ : __WINUI_USERCONTROL__ { public $safeitemname$() { diff --git a/dev/VSIX/ItemTemplates/Neutral/CSharp/UserControl/WinUI.Neutral.Cs.UserControl.csproj b/dev/Templates/Source/ItemTemplates/Neutral/CSharp/UserControl/WinUI.Neutral.Cs.UserControl.csproj similarity index 100% rename from dev/VSIX/ItemTemplates/Neutral/CSharp/UserControl/WinUI.Neutral.Cs.UserControl.csproj rename to dev/Templates/Source/ItemTemplates/Neutral/CSharp/UserControl/WinUI.Neutral.Cs.UserControl.csproj diff --git a/dev/VSIX/ItemTemplates/Neutral/CSharp/UserControl/WinUI.Neutral.Cs.UserControl.ico b/dev/Templates/Source/ItemTemplates/Neutral/CSharp/UserControl/WinUI.Neutral.Cs.UserControl.ico similarity index 100% rename from dev/VSIX/ItemTemplates/Neutral/CSharp/UserControl/WinUI.Neutral.Cs.UserControl.ico rename to dev/Templates/Source/ItemTemplates/Neutral/CSharp/UserControl/WinUI.Neutral.Cs.UserControl.ico diff --git a/dev/VSIX/ItemTemplates/Neutral/CSharp/UserControl/WinUI.Neutral.Cs.UserControl.vstemplate b/dev/Templates/Source/ItemTemplates/Neutral/CSharp/UserControl/WinUI.Neutral.Cs.UserControl.vstemplate similarity index 100% rename from dev/VSIX/ItemTemplates/Neutral/CSharp/UserControl/WinUI.Neutral.Cs.UserControl.vstemplate rename to dev/Templates/Source/ItemTemplates/Neutral/CSharp/UserControl/WinUI.Neutral.Cs.UserControl.vstemplate diff --git a/dev/VSIX/ItemTemplates/Neutral/CppWinRT/BlankPage/BlankPage.cpp b/dev/Templates/Source/ItemTemplates/Neutral/CppWinRT/BlankPage/BlankPage.cpp similarity index 100% rename from dev/VSIX/ItemTemplates/Neutral/CppWinRT/BlankPage/BlankPage.cpp rename to dev/Templates/Source/ItemTemplates/Neutral/CppWinRT/BlankPage/BlankPage.cpp diff --git a/dev/VSIX/ItemTemplates/Neutral/CppWinRT/BlankPage/BlankPage.h b/dev/Templates/Source/ItemTemplates/Neutral/CppWinRT/BlankPage/BlankPage.h similarity index 100% rename from dev/VSIX/ItemTemplates/Neutral/CppWinRT/BlankPage/BlankPage.h rename to dev/Templates/Source/ItemTemplates/Neutral/CppWinRT/BlankPage/BlankPage.h diff --git a/dev/VSIX/ItemTemplates/Neutral/CppWinRT/BlankPage/BlankPage.idl b/dev/Templates/Source/ItemTemplates/Neutral/CppWinRT/BlankPage/BlankPage.idl similarity index 100% rename from dev/VSIX/ItemTemplates/Neutral/CppWinRT/BlankPage/BlankPage.idl rename to dev/Templates/Source/ItemTemplates/Neutral/CppWinRT/BlankPage/BlankPage.idl diff --git a/dev/VSIX/ItemTemplates/Neutral/CppWinRT/BlankPage/BlankPage.xaml b/dev/Templates/Source/ItemTemplates/Neutral/CppWinRT/BlankPage/BlankPage.xaml similarity index 100% rename from dev/VSIX/ItemTemplates/Neutral/CppWinRT/BlankPage/BlankPage.xaml rename to dev/Templates/Source/ItemTemplates/Neutral/CppWinRT/BlankPage/BlankPage.xaml diff --git a/dev/VSIX/ItemTemplates/Neutral/CppWinRT/BlankPage/WinUI.Neutral.CppWinRT.BlankPage.csproj b/dev/Templates/Source/ItemTemplates/Neutral/CppWinRT/BlankPage/WinUI.Neutral.CppWinRT.BlankPage.csproj similarity index 100% rename from dev/VSIX/ItemTemplates/Neutral/CppWinRT/BlankPage/WinUI.Neutral.CppWinRT.BlankPage.csproj rename to dev/Templates/Source/ItemTemplates/Neutral/CppWinRT/BlankPage/WinUI.Neutral.CppWinRT.BlankPage.csproj diff --git a/dev/VSIX/ItemTemplates/Neutral/CppWinRT/BlankPage/WinUI.Neutral.CppWinRT.BlankPage.ico b/dev/Templates/Source/ItemTemplates/Neutral/CppWinRT/BlankPage/WinUI.Neutral.CppWinRT.BlankPage.ico similarity index 100% rename from dev/VSIX/ItemTemplates/Neutral/CppWinRT/BlankPage/WinUI.Neutral.CppWinRT.BlankPage.ico rename to dev/Templates/Source/ItemTemplates/Neutral/CppWinRT/BlankPage/WinUI.Neutral.CppWinRT.BlankPage.ico diff --git a/dev/VSIX/ItemTemplates/Neutral/CppWinRT/BlankPage/WinUI.Neutral.CppWinRT.BlankPage.vstemplate b/dev/Templates/Source/ItemTemplates/Neutral/CppWinRT/BlankPage/WinUI.Neutral.CppWinRT.BlankPage.vstemplate similarity index 100% rename from dev/VSIX/ItemTemplates/Neutral/CppWinRT/BlankPage/WinUI.Neutral.CppWinRT.BlankPage.vstemplate rename to dev/Templates/Source/ItemTemplates/Neutral/CppWinRT/BlankPage/WinUI.Neutral.CppWinRT.BlankPage.vstemplate diff --git a/dev/VSIX/ItemTemplates/Neutral/CSharp/ResourceDictionary/ResourceDictionary.xaml b/dev/Templates/Source/ItemTemplates/Neutral/CppWinRT/ResourceDictionary/ResourceDictionary.xaml similarity index 100% rename from dev/VSIX/ItemTemplates/Neutral/CSharp/ResourceDictionary/ResourceDictionary.xaml rename to dev/Templates/Source/ItemTemplates/Neutral/CppWinRT/ResourceDictionary/ResourceDictionary.xaml diff --git a/dev/VSIX/ItemTemplates/Neutral/CppWinRT/ResourceDictionary/WinUI.Neutral.CppWinRT.ResourceDictionary.csproj b/dev/Templates/Source/ItemTemplates/Neutral/CppWinRT/ResourceDictionary/WinUI.Neutral.CppWinRT.ResourceDictionary.csproj similarity index 100% rename from dev/VSIX/ItemTemplates/Neutral/CppWinRT/ResourceDictionary/WinUI.Neutral.CppWinRT.ResourceDictionary.csproj rename to dev/Templates/Source/ItemTemplates/Neutral/CppWinRT/ResourceDictionary/WinUI.Neutral.CppWinRT.ResourceDictionary.csproj diff --git a/dev/VSIX/ItemTemplates/Neutral/CppWinRT/ResourceDictionary/WinUI.Neutral.CppWinRT.ResourceDictionary.ico b/dev/Templates/Source/ItemTemplates/Neutral/CppWinRT/ResourceDictionary/WinUI.Neutral.CppWinRT.ResourceDictionary.ico similarity index 100% rename from dev/VSIX/ItemTemplates/Neutral/CppWinRT/ResourceDictionary/WinUI.Neutral.CppWinRT.ResourceDictionary.ico rename to dev/Templates/Source/ItemTemplates/Neutral/CppWinRT/ResourceDictionary/WinUI.Neutral.CppWinRT.ResourceDictionary.ico diff --git a/dev/VSIX/ItemTemplates/Neutral/CppWinRT/ResourceDictionary/WinUI.Neutral.CppWinRT.ResourceDictionary.vstemplate b/dev/Templates/Source/ItemTemplates/Neutral/CppWinRT/ResourceDictionary/WinUI.Neutral.CppWinRT.ResourceDictionary.vstemplate similarity index 100% rename from dev/VSIX/ItemTemplates/Neutral/CppWinRT/ResourceDictionary/WinUI.Neutral.CppWinRT.ResourceDictionary.vstemplate rename to dev/Templates/Source/ItemTemplates/Neutral/CppWinRT/ResourceDictionary/WinUI.Neutral.CppWinRT.ResourceDictionary.vstemplate diff --git a/dev/VSIX/ItemTemplates/Neutral/CppWinRT/Resw/Resources.resw b/dev/Templates/Source/ItemTemplates/Neutral/CppWinRT/Resw/Resources.resw similarity index 100% rename from dev/VSIX/ItemTemplates/Neutral/CppWinRT/Resw/Resources.resw rename to dev/Templates/Source/ItemTemplates/Neutral/CppWinRT/Resw/Resources.resw diff --git a/dev/VSIX/ItemTemplates/Neutral/CppWinRT/Resw/WinUI.Neutral.CppWinRT.Resw.csproj b/dev/Templates/Source/ItemTemplates/Neutral/CppWinRT/Resw/WinUI.Neutral.CppWinRT.Resw.csproj similarity index 100% rename from dev/VSIX/ItemTemplates/Neutral/CppWinRT/Resw/WinUI.Neutral.CppWinRT.Resw.csproj rename to dev/Templates/Source/ItemTemplates/Neutral/CppWinRT/Resw/WinUI.Neutral.CppWinRT.Resw.csproj diff --git a/dev/VSIX/ItemTemplates/Neutral/CppWinRT/Resw/WinUI.Neutral.CppWinRT.Resw.ico b/dev/Templates/Source/ItemTemplates/Neutral/CppWinRT/Resw/WinUI.Neutral.CppWinRT.Resw.ico similarity index 100% rename from dev/VSIX/ItemTemplates/Neutral/CppWinRT/Resw/WinUI.Neutral.CppWinRT.Resw.ico rename to dev/Templates/Source/ItemTemplates/Neutral/CppWinRT/Resw/WinUI.Neutral.CppWinRT.Resw.ico diff --git a/dev/VSIX/ItemTemplates/Neutral/CppWinRT/Resw/WinUI.Neutral.CppWinRT.Resw.vstemplate b/dev/Templates/Source/ItemTemplates/Neutral/CppWinRT/Resw/WinUI.Neutral.CppWinRT.Resw.vstemplate similarity index 100% rename from dev/VSIX/ItemTemplates/Neutral/CppWinRT/Resw/WinUI.Neutral.CppWinRT.Resw.vstemplate rename to dev/Templates/Source/ItemTemplates/Neutral/CppWinRT/Resw/WinUI.Neutral.CppWinRT.Resw.vstemplate diff --git a/dev/VSIX/ItemTemplates/Neutral/CppWinRT/TemplatedControl/TemplatedControl.cpp b/dev/Templates/Source/ItemTemplates/Neutral/CppWinRT/TemplatedControl/TemplatedControl.cpp similarity index 100% rename from dev/VSIX/ItemTemplates/Neutral/CppWinRT/TemplatedControl/TemplatedControl.cpp rename to dev/Templates/Source/ItemTemplates/Neutral/CppWinRT/TemplatedControl/TemplatedControl.cpp diff --git a/dev/VSIX/ItemTemplates/Neutral/CppWinRT/TemplatedControl/TemplatedControl.h b/dev/Templates/Source/ItemTemplates/Neutral/CppWinRT/TemplatedControl/TemplatedControl.h similarity index 100% rename from dev/VSIX/ItemTemplates/Neutral/CppWinRT/TemplatedControl/TemplatedControl.h rename to dev/Templates/Source/ItemTemplates/Neutral/CppWinRT/TemplatedControl/TemplatedControl.h diff --git a/dev/VSIX/ItemTemplates/Neutral/CppWinRT/TemplatedControl/TemplatedControl.idl b/dev/Templates/Source/ItemTemplates/Neutral/CppWinRT/TemplatedControl/TemplatedControl.idl similarity index 100% rename from dev/VSIX/ItemTemplates/Neutral/CppWinRT/TemplatedControl/TemplatedControl.idl rename to dev/Templates/Source/ItemTemplates/Neutral/CppWinRT/TemplatedControl/TemplatedControl.idl diff --git a/dev/VSIX/ItemTemplates/Neutral/CppWinRT/TemplatedControl/WinUI.Neutral.CppWinRT.TemplatedControl.csproj b/dev/Templates/Source/ItemTemplates/Neutral/CppWinRT/TemplatedControl/WinUI.Neutral.CppWinRT.TemplatedControl.csproj similarity index 100% rename from dev/VSIX/ItemTemplates/Neutral/CppWinRT/TemplatedControl/WinUI.Neutral.CppWinRT.TemplatedControl.csproj rename to dev/Templates/Source/ItemTemplates/Neutral/CppWinRT/TemplatedControl/WinUI.Neutral.CppWinRT.TemplatedControl.csproj diff --git a/dev/VSIX/ItemTemplates/Neutral/CppWinRT/TemplatedControl/WinUI.Neutral.CppWinRT.TemplatedControl.ico b/dev/Templates/Source/ItemTemplates/Neutral/CppWinRT/TemplatedControl/WinUI.Neutral.CppWinRT.TemplatedControl.ico similarity index 100% rename from dev/VSIX/ItemTemplates/Neutral/CppWinRT/TemplatedControl/WinUI.Neutral.CppWinRT.TemplatedControl.ico rename to dev/Templates/Source/ItemTemplates/Neutral/CppWinRT/TemplatedControl/WinUI.Neutral.CppWinRT.TemplatedControl.ico diff --git a/dev/VSIX/ItemTemplates/Neutral/CppWinRT/TemplatedControl/WinUI.Neutral.CppWinRT.TemplatedControl.vstemplate b/dev/Templates/Source/ItemTemplates/Neutral/CppWinRT/TemplatedControl/WinUI.Neutral.CppWinRT.TemplatedControl.vstemplate similarity index 100% rename from dev/VSIX/ItemTemplates/Neutral/CppWinRT/TemplatedControl/WinUI.Neutral.CppWinRT.TemplatedControl.vstemplate rename to dev/Templates/Source/ItemTemplates/Neutral/CppWinRT/TemplatedControl/WinUI.Neutral.CppWinRT.TemplatedControl.vstemplate diff --git a/dev/VSIX/ItemTemplates/Neutral/CppWinRT/UserControl/UserControl.cpp b/dev/Templates/Source/ItemTemplates/Neutral/CppWinRT/UserControl/UserControl.cpp similarity index 100% rename from dev/VSIX/ItemTemplates/Neutral/CppWinRT/UserControl/UserControl.cpp rename to dev/Templates/Source/ItemTemplates/Neutral/CppWinRT/UserControl/UserControl.cpp diff --git a/dev/VSIX/ItemTemplates/Neutral/CppWinRT/UserControl/UserControl.h b/dev/Templates/Source/ItemTemplates/Neutral/CppWinRT/UserControl/UserControl.h similarity index 100% rename from dev/VSIX/ItemTemplates/Neutral/CppWinRT/UserControl/UserControl.h rename to dev/Templates/Source/ItemTemplates/Neutral/CppWinRT/UserControl/UserControl.h diff --git a/dev/VSIX/ItemTemplates/Neutral/CppWinRT/UserControl/UserControl.idl b/dev/Templates/Source/ItemTemplates/Neutral/CppWinRT/UserControl/UserControl.idl similarity index 100% rename from dev/VSIX/ItemTemplates/Neutral/CppWinRT/UserControl/UserControl.idl rename to dev/Templates/Source/ItemTemplates/Neutral/CppWinRT/UserControl/UserControl.idl diff --git a/dev/VSIX/ItemTemplates/Neutral/CppWinRT/UserControl/UserControl.xaml b/dev/Templates/Source/ItemTemplates/Neutral/CppWinRT/UserControl/UserControl.xaml similarity index 100% rename from dev/VSIX/ItemTemplates/Neutral/CppWinRT/UserControl/UserControl.xaml rename to dev/Templates/Source/ItemTemplates/Neutral/CppWinRT/UserControl/UserControl.xaml diff --git a/dev/VSIX/ItemTemplates/Neutral/CppWinRT/UserControl/WinUI.Neutral.CppWinRT.UserControl.csproj b/dev/Templates/Source/ItemTemplates/Neutral/CppWinRT/UserControl/WinUI.Neutral.CppWinRT.UserControl.csproj similarity index 100% rename from dev/VSIX/ItemTemplates/Neutral/CppWinRT/UserControl/WinUI.Neutral.CppWinRT.UserControl.csproj rename to dev/Templates/Source/ItemTemplates/Neutral/CppWinRT/UserControl/WinUI.Neutral.CppWinRT.UserControl.csproj diff --git a/dev/VSIX/ItemTemplates/Neutral/CppWinRT/UserControl/WinUI.Neutral.CppWinRT.UserControl.ico b/dev/Templates/Source/ItemTemplates/Neutral/CppWinRT/UserControl/WinUI.Neutral.CppWinRT.UserControl.ico similarity index 100% rename from dev/VSIX/ItemTemplates/Neutral/CppWinRT/UserControl/WinUI.Neutral.CppWinRT.UserControl.ico rename to dev/Templates/Source/ItemTemplates/Neutral/CppWinRT/UserControl/WinUI.Neutral.CppWinRT.UserControl.ico diff --git a/dev/VSIX/ItemTemplates/Neutral/CppWinRT/UserControl/WinUI.Neutral.CppWinRT.UserControl.vstemplate b/dev/Templates/Source/ItemTemplates/Neutral/CppWinRT/UserControl/WinUI.Neutral.CppWinRT.UserControl.vstemplate similarity index 100% rename from dev/VSIX/ItemTemplates/Neutral/CppWinRT/UserControl/WinUI.Neutral.CppWinRT.UserControl.vstemplate rename to dev/Templates/Source/ItemTemplates/Neutral/CppWinRT/UserControl/WinUI.Neutral.CppWinRT.UserControl.vstemplate diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/ClassLibrary/Class1.cs b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/ClassLibrary/Class1.cs similarity index 63% rename from dev/VSIX/ProjectTemplates/Desktop/CSharp/ClassLibrary/Class1.cs rename to dev/Templates/Source/ProjectTemplates/Desktop/CSharp/ClassLibrary/Class1.cs index 805fc0ab24..26970a3c16 100644 --- a/dev/VSIX/ProjectTemplates/Desktop/CSharp/ClassLibrary/Class1.cs +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/ClassLibrary/Class1.cs @@ -1,9 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - // To learn more about WinUI, the WinUI project structure, // and more about our project templates, see: http://aka.ms/winui-project-info. diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/ClassLibrary/ProjectTemplate.csproj b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/ClassLibrary/ProjectTemplate.csproj similarity index 77% rename from dev/VSIX/ProjectTemplates/Desktop/CSharp/ClassLibrary/ProjectTemplate.csproj rename to dev/Templates/Source/ProjectTemplates/Desktop/CSharp/ClassLibrary/ProjectTemplate.csproj index 5440c6391b..15d7a5bc50 100644 --- a/dev/VSIX/ProjectTemplates/Desktop/CSharp/ClassLibrary/ProjectTemplate.csproj +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/ClassLibrary/ProjectTemplate.csproj @@ -1,10 +1,11 @@ - $DotNetVersion$-windows10.0.19041.0 + $DotNetVersion$-windows10.0.26100.0 10.0.17763.0 $safeprojectname$ true false + enable false \ No newline at end of file diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/ClassLibrary/WinUI.Desktop.Cs.ClassLibrary.csproj b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/ClassLibrary/WinUI.Desktop.Cs.ClassLibrary.csproj similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CSharp/ClassLibrary/WinUI.Desktop.Cs.ClassLibrary.csproj rename to dev/Templates/Source/ProjectTemplates/Desktop/CSharp/ClassLibrary/WinUI.Desktop.Cs.ClassLibrary.csproj diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/ClassLibrary/WinUI.Desktop.Cs.ClassLibrary.ico b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/ClassLibrary/WinUI.Desktop.Cs.ClassLibrary.ico similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CSharp/ClassLibrary/WinUI.Desktop.Cs.ClassLibrary.ico rename to dev/Templates/Source/ProjectTemplates/Desktop/CSharp/ClassLibrary/WinUI.Desktop.Cs.ClassLibrary.ico diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/ClassLibrary/WinUI.Desktop.Cs.ClassLibrary.png b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/ClassLibrary/WinUI.Desktop.Cs.ClassLibrary.png similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CSharp/ClassLibrary/WinUI.Desktop.Cs.ClassLibrary.png rename to dev/Templates/Source/ProjectTemplates/Desktop/CSharp/ClassLibrary/WinUI.Desktop.Cs.ClassLibrary.png diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/ClassLibrary/WinUI.Desktop.Cs.ClassLibrary.vstemplate b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/ClassLibrary/WinUI.Desktop.Cs.ClassLibrary.vstemplate similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CSharp/ClassLibrary/WinUI.Desktop.Cs.ClassLibrary.vstemplate rename to dev/Templates/Source/ProjectTemplates/Desktop/CSharp/ClassLibrary/WinUI.Desktop.Cs.ClassLibrary.vstemplate diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/App.xaml b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/MvvmApp/App.xaml similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/App.xaml rename to dev/Templates/Source/ProjectTemplates/Desktop/CSharp/MvvmApp/App.xaml diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/MvvmApp/App.xaml.cs b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/MvvmApp/App.xaml.cs new file mode 100644 index 0000000000..8470b455b7 --- /dev/null +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/MvvmApp/App.xaml.cs @@ -0,0 +1,57 @@ +using Microsoft.UI.Xaml; +using Microsoft.UI.Xaml.Controls; +using Microsoft.UI.Xaml.Data; +using Microsoft.UI.Xaml.Input; +using Microsoft.UI.Xaml.Media; +using Microsoft.UI.Xaml.Navigation; + +// To learn more about WinUI, the WinUI project structure, +// and more about our project templates, see: http://aka.ms/winui-project-info. + +namespace $safeprojectname$; + +/// +/// Provides application-specific behavior to supplement the default Application class. +/// +public partial class App : Application +{ + /// + /// The main application window. Use App.Window from any class that needs + /// the window reference (for dialogs, pickers, interop, etc.). + /// + public static Window Window { get; private set; } = null!; + + /// + /// The UI thread dispatcher. Use App.DispatcherQueue to marshal calls + /// to the UI thread. Fully qualified to avoid CS0104 ambiguity with + /// . + /// + public static Microsoft.UI.Dispatching.DispatcherQueue DispatcherQueue { get; private set; } = null!; + + /// + /// The native window handle (HWND). Use for file pickers, + /// DataTransferManager, and any WinRT interop that requires + /// InitializeWithWindow. + /// + public static nint WindowHandle => + WinRT.Interop.WindowNative.GetWindowHandle(Window); + + /// + /// Initializes the singleton application object. + /// + public App() + { + InitializeComponent(); + } + + /// + /// Invoked when the application is launched. + /// + /// Details about the launch request and process. + protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs args) + { + Window = new MainWindow(); + DispatcherQueue = Microsoft.UI.Dispatching.DispatcherQueue.GetForCurrentThread(); + Window.Activate(); + } +} diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/MvvmApp/Assets/AppIcon.ico b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/MvvmApp/Assets/AppIcon.ico new file mode 100644 index 0000000000..235dad2c56 Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/MvvmApp/Assets/AppIcon.ico differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/MvvmApp/Assets/LockScreenLogo.scale-200.png b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/MvvmApp/Assets/LockScreenLogo.scale-200.png new file mode 100644 index 0000000000..33f889e106 Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/MvvmApp/Assets/LockScreenLogo.scale-200.png differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/MvvmApp/Assets/SplashScreen.scale-200.png b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/MvvmApp/Assets/SplashScreen.scale-200.png new file mode 100644 index 0000000000..802c79d6d7 Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/MvvmApp/Assets/SplashScreen.scale-200.png differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/MvvmApp/Assets/Square150x150Logo.scale-200.png b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/MvvmApp/Assets/Square150x150Logo.scale-200.png new file mode 100644 index 0000000000..ddba42adbb Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/MvvmApp/Assets/Square150x150Logo.scale-200.png differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/MvvmApp/Assets/Square44x44Logo.scale-200.png b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/MvvmApp/Assets/Square44x44Logo.scale-200.png new file mode 100644 index 0000000000..9327dd748e Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/MvvmApp/Assets/Square44x44Logo.scale-200.png differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/MvvmApp/Assets/Square44x44Logo.targetsize-24_altform-unplated.png b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/MvvmApp/Assets/Square44x44Logo.targetsize-24_altform-unplated.png new file mode 100644 index 0000000000..e51416a8e4 Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/MvvmApp/Assets/Square44x44Logo.targetsize-24_altform-unplated.png differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/MvvmApp/Assets/Square44x44Logo.targetsize-48_altform-lightunplated.png b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/MvvmApp/Assets/Square44x44Logo.targetsize-48_altform-lightunplated.png new file mode 100644 index 0000000000..bf063eb4d6 Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/MvvmApp/Assets/Square44x44Logo.targetsize-48_altform-lightunplated.png differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/MvvmApp/Assets/StoreLogo.png b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/MvvmApp/Assets/StoreLogo.png new file mode 100644 index 0000000000..be865f0c37 Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/MvvmApp/Assets/StoreLogo.png differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/MvvmApp/Assets/Wide310x150Logo.scale-200.png b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/MvvmApp/Assets/Wide310x150Logo.scale-200.png new file mode 100644 index 0000000000..314d297f20 Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/MvvmApp/Assets/Wide310x150Logo.scale-200.png differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/MvvmApp/MainPage.xaml b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/MvvmApp/MainPage.xaml new file mode 100644 index 0000000000..b3a273509f --- /dev/null +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/MvvmApp/MainPage.xaml @@ -0,0 +1,30 @@ + + + + + + + + + + + + diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/MvvmApp/MainPage.xaml.cs b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/MvvmApp/MainPage.xaml.cs new file mode 100644 index 0000000000..352f251a18 --- /dev/null +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/MvvmApp/MainPage.xaml.cs @@ -0,0 +1,20 @@ +using Microsoft.UI.Xaml.Controls; +using $safeprojectname$.ViewModels; + +// To learn more about WinUI, the WinUI project structure, +// and more about our project templates, see: http://aka.ms/winui-project-info. + +namespace $safeprojectname$; + +/// +/// The main content page displayed inside the application window. +/// +public sealed partial class MainPage : Page +{ + public MainPageViewModel ViewModel { get; } = new(); + + public MainPage() + { + InitializeComponent(); + } +} diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/MvvmApp/MainWindow.xaml b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/MvvmApp/MainWindow.xaml new file mode 100644 index 0000000000..29974c45fd --- /dev/null +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/MvvmApp/MainWindow.xaml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/MvvmApp/MainWindow.xaml.cs b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/MvvmApp/MainWindow.xaml.cs new file mode 100644 index 0000000000..fc24f9ed43 --- /dev/null +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/MvvmApp/MainWindow.xaml.cs @@ -0,0 +1,27 @@ +using Microsoft.UI.Xaml; + +// To learn more about WinUI, the WinUI project structure, +// and more about our project templates, see: http://aka.ms/winui-project-info. + +namespace $safeprojectname$; + +/// +/// The application window. This hosts a Frame that displays pages. Add your +/// UI and logic to MainPage.xaml / MainPage.xaml.cs instead of here so you +/// can use Page features such as navigation events and the Loaded lifecycle. +/// +public sealed partial class MainWindow : Window +{ + public MainWindow() + { + InitializeComponent(); + + ExtendsContentIntoTitleBar = true; + SetTitleBar(AppTitleBar); + + AppWindow.SetIcon("Assets/AppIcon.ico"); + + // Navigate the root frame to the main page on startup. + RootFrame.Navigate(typeof(MainPage)); + } +} diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Package-managed.appxmanifest b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/MvvmApp/Package-managed.appxmanifest similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Package-managed.appxmanifest rename to dev/Templates/Source/ProjectTemplates/Desktop/CSharp/MvvmApp/Package-managed.appxmanifest diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/MvvmApp/ProjectTemplate.csproj b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/MvvmApp/ProjectTemplate.csproj new file mode 100644 index 0000000000..a4beb3c1d9 --- /dev/null +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/MvvmApp/ProjectTemplate.csproj @@ -0,0 +1,76 @@ + + + WinExe + $DotNetVersion$-windows10.0.26100.0 + 10.0.17763.0 + $safeprojectname$ + app.manifest + x86;x64;ARM64 + win-$([System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture.ToString().ToLowerInvariant()) + win-$(Platform).pubxml + true + false + true + enable + enable + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + + + False + True + False + True + + diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/Properties/PublishProfiles/win-arm64.pubxml b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/MvvmApp/Properties/PublishProfiles/win-arm64.pubxml similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/Properties/PublishProfiles/win-arm64.pubxml rename to dev/Templates/Source/ProjectTemplates/Desktop/CSharp/MvvmApp/Properties/PublishProfiles/win-arm64.pubxml diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/Properties/PublishProfiles/win-x64.pubxml b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/MvvmApp/Properties/PublishProfiles/win-x64.pubxml similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/Properties/PublishProfiles/win-x64.pubxml rename to dev/Templates/Source/ProjectTemplates/Desktop/CSharp/MvvmApp/Properties/PublishProfiles/win-x64.pubxml diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/Properties/PublishProfiles/win-x86.pubxml b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/MvvmApp/Properties/PublishProfiles/win-x86.pubxml similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/Properties/PublishProfiles/win-x86.pubxml rename to dev/Templates/Source/ProjectTemplates/Desktop/CSharp/MvvmApp/Properties/PublishProfiles/win-x86.pubxml diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Properties/launchSettings.json b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/MvvmApp/Properties/launchSettings.json similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Properties/launchSettings.json rename to dev/Templates/Source/ProjectTemplates/Desktop/CSharp/MvvmApp/Properties/launchSettings.json diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/MvvmApp/ViewModels/MainPageViewModel.cs b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/MvvmApp/ViewModels/MainPageViewModel.cs new file mode 100644 index 0000000000..8bb9363346 --- /dev/null +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/MvvmApp/ViewModels/MainPageViewModel.cs @@ -0,0 +1,30 @@ +using CommunityToolkit.Mvvm.ComponentModel; +using CommunityToolkit.Mvvm.Input; + +namespace $safeprojectname$.ViewModels; + +/// +/// Sample ViewModel using CommunityToolkit.Mvvm partial property syntax. +/// Uses for change notification and +/// for command binding. +/// +public partial class MainPageViewModel : ObservableObject +{ + [ObservableProperty] + public partial string Greeting { get; set; } = "Hello, WinUI!"; + + [ObservableProperty] + public partial int Counter { get; set; } + + [RelayCommand] + private void Increment() + { + Counter++; + } + + [RelayCommand] + private void Decrement() + { + Counter--; + } +} diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/MvvmApp/WinUI.Desktop.Cs.MvvmApp.csproj b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/MvvmApp/WinUI.Desktop.Cs.MvvmApp.csproj new file mode 100644 index 0000000000..ce99462535 --- /dev/null +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/MvvmApp/WinUI.Desktop.Cs.MvvmApp.csproj @@ -0,0 +1,91 @@ + + + + 15.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + Debug + AnyCPU + {82b43b9b-a64c-4715-b499-d71e9ca2bd60};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + {C3D4E5F6-3333-4C7D-BE0F-3A4B5C6D7E8F} + Library + Properties + WinUI.Desktop.Cs.MvvmApp + WinUI.Desktop.Cs.MvvmApp + v4.7.2 + 512 + false + false + false + false + false + false + false + false + false + false + SHA256 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + Designer + + + + + + + Designer + + + Designer + + + + + Designer + + + + + + + + + + + + + + + + + + + diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/WinUI.Desktop.Cs.BlankApp.ico b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/MvvmApp/WinUI.Desktop.Cs.MvvmApp.ico similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/WinUI.Desktop.Cs.BlankApp.ico rename to dev/Templates/Source/ProjectTemplates/Desktop/CSharp/MvvmApp/WinUI.Desktop.Cs.MvvmApp.ico diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/WinUI.Desktop.Cs.BlankApp.png b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/MvvmApp/WinUI.Desktop.Cs.MvvmApp.png similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/WinUI.Desktop.Cs.BlankApp.png rename to dev/Templates/Source/ProjectTemplates/Desktop/CSharp/MvvmApp/WinUI.Desktop.Cs.MvvmApp.png diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/MvvmApp/WinUI.Desktop.Cs.MvvmApp.vstemplate b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/MvvmApp/WinUI.Desktop.Cs.MvvmApp.vstemplate new file mode 100644 index 0000000000..57bca3d069 --- /dev/null +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/MvvmApp/WinUI.Desktop.Cs.MvvmApp.vstemplate @@ -0,0 +1,73 @@ + + + + + + WinUI.Desktop.Cs.MvvmApp.ico + Microsoft.WinUI.Desktop.Cs.MvvmApp + WinRT-Managed + CSharp + true + App + true + Enabled + true + 2 + Windows + true + WinUI.Desktop.Cs.MvvmApp.png + true + csharp + XAML + windows + desktop + WinUI + + + + + + + + + Properties\launchSettings.json + Properties\PublishProfiles\win-arm64.pubxml + Properties\PublishProfiles\win-x64.pubxml + Properties\PublishProfiles\win-x86.pubxml + app.manifest + App.xaml + App.xaml.cs + MainWindow.xaml + MainWindow.xaml.cs + MainPage.xaml + MainPage.xaml.cs + Package-managed.appxmanifest + + MainPageViewModel.cs + + + SplashScreen.scale-200.png + LockScreenLogo.scale-200.png + Square150x150Logo.scale-200.png + Square44x44Logo.scale-200.png + Square44x44Logo.targetsize-24_altform-unplated.png + Square44x44Logo.targetsize-48_altform-lightunplated.png + StoreLogo.png + AppIcon.ico + Wide310x150Logo.scale-200.png + + + + + + + + + Microsoft.VisualStudio.WinRT.TemplateWizards, Version=16.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + Microsoft.VisualStudio.WinRT.TemplateWizards.UpdatePublisherInManifestWizard + + + WindowsAppSDK.Cs.Extension.Dev17, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + WindowsAppSDK.TemplateUtilities.NuGetPackageInstaller + + diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/app.manifest b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/MvvmApp/app.manifest similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/app.manifest rename to dev/Templates/Source/ProjectTemplates/Desktop/CSharp/MvvmApp/app.manifest diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/App.xaml b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/App.xaml similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/App.xaml rename to dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/App.xaml diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/App.xaml.cs b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/App.xaml.cs new file mode 100644 index 0000000000..9b38e0006b --- /dev/null +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/App.xaml.cs @@ -0,0 +1,38 @@ +using Microsoft.UI.Xaml; +using Microsoft.UI.Xaml.Controls; +using Microsoft.UI.Xaml.Data; +using Microsoft.UI.Xaml.Input; +using Microsoft.UI.Xaml.Media; +using Microsoft.UI.Xaml.Navigation; + +// To learn more about WinUI, the WinUI project structure, +// and more about our project templates, see: http://aka.ms/winui-project-info. + +namespace $safeprojectname$; + +/// +/// Provides application-specific behavior to supplement the default Application class. +/// +public partial class App : Application +{ + private Window? _window; + + /// + /// Initializes the singleton application object. This is the first line of authored code + /// executed, and as such is the logical equivalent of main() or WinMain(). + /// + public App() + { + InitializeComponent(); + } + + /// + /// Invoked when the application is launched. + /// + /// Details about the launch request and process. + protected override void OnLaunched(Microsoft.UI.Xaml.LaunchActivatedEventArgs args) + { + _window = new MainWindow(); + _window.Activate(); + } +} diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/Assets/AppIcon.ico b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/Assets/AppIcon.ico new file mode 100644 index 0000000000..235dad2c56 Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/Assets/AppIcon.ico differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/Assets/LockScreenLogo.scale-200.png b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/Assets/LockScreenLogo.scale-200.png new file mode 100644 index 0000000000..33f889e106 Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/Assets/LockScreenLogo.scale-200.png differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/Assets/SplashScreen.scale-200.png b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/Assets/SplashScreen.scale-200.png new file mode 100644 index 0000000000..802c79d6d7 Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/Assets/SplashScreen.scale-200.png differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/Assets/Square150x150Logo.scale-200.png b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/Assets/Square150x150Logo.scale-200.png new file mode 100644 index 0000000000..ddba42adbb Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/Assets/Square150x150Logo.scale-200.png differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/Assets/Square44x44Logo.scale-200.png b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/Assets/Square44x44Logo.scale-200.png new file mode 100644 index 0000000000..9327dd748e Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/Assets/Square44x44Logo.scale-200.png differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/Assets/Square44x44Logo.targetsize-24_altform-unplated.png b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/Assets/Square44x44Logo.targetsize-24_altform-unplated.png new file mode 100644 index 0000000000..e51416a8e4 Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/Assets/Square44x44Logo.targetsize-24_altform-unplated.png differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/Assets/Square44x44Logo.targetsize-48_altform-lightunplated.png b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/Assets/Square44x44Logo.targetsize-48_altform-lightunplated.png new file mode 100644 index 0000000000..bf063eb4d6 Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/Assets/Square44x44Logo.targetsize-48_altform-lightunplated.png differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/Assets/StoreLogo.png b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/Assets/StoreLogo.png new file mode 100644 index 0000000000..be865f0c37 Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/Assets/StoreLogo.png differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/Assets/Wide310x150Logo.scale-200.png b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/Assets/Wide310x150Logo.scale-200.png new file mode 100644 index 0000000000..314d297f20 Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/Assets/Wide310x150Logo.scale-200.png differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/MainWindow.xaml b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/MainWindow.xaml new file mode 100644 index 0000000000..d67314deb1 --- /dev/null +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/MainWindow.xaml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/MainWindow.xaml.cs b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/MainWindow.xaml.cs new file mode 100644 index 0000000000..7fa6bb2664 --- /dev/null +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/MainWindow.xaml.cs @@ -0,0 +1,54 @@ +using Microsoft.UI.Windowing; +using Microsoft.UI.Xaml; +using Microsoft.UI.Xaml.Controls; +using $safeprojectname$.Pages; + +// To learn more about WinUI, the WinUI project structure, +// and more about our project templates, see: http://aka.ms/winui-project-info. + +namespace $safeprojectname$; + +public sealed partial class MainWindow : Window +{ + public MainWindow() + { + InitializeComponent(); + + ExtendsContentIntoTitleBar = true; + SetTitleBar(AppTitleBar); + AppWindow.TitleBar.PreferredHeightOption = TitleBarHeightOption.Tall; + AppWindow.SetIcon("Assets/AppIcon.ico"); + } + + private void TitleBar_PaneToggleRequested(TitleBar sender, object args) + { + NavView.IsPaneOpen = !NavView.IsPaneOpen; + } + + private void TitleBar_BackRequested(TitleBar sender, object args) + { + NavFrame.GoBack(); + } + + private void NavView_SelectionChanged(NavigationView sender, NavigationViewSelectionChangedEventArgs args) + { + if (args.IsSettingsSelected) + { + NavFrame.Navigate(typeof(SettingsPage)); + } + else if (args.SelectedItem is NavigationViewItem item) + { + switch (item.Tag) + { + case "home": + NavFrame.Navigate(typeof(HomePage)); + break; + case "about": + NavFrame.Navigate(typeof(AboutPage)); + break; + default: + throw new InvalidOperationException($"Unknown navigation item tag: {item.Tag}"); + } + } + } +} diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/Package-managed.appxmanifest b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/Package-managed.appxmanifest similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/Package-managed.appxmanifest rename to dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/Package-managed.appxmanifest diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/Pages/AboutPage.xaml b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/Pages/AboutPage.xaml new file mode 100644 index 0000000000..9077189545 --- /dev/null +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/Pages/AboutPage.xaml @@ -0,0 +1,19 @@ + + + + + + + + + + + + diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/Pages/AboutPage.xaml.cs b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/Pages/AboutPage.xaml.cs new file mode 100644 index 0000000000..895e6396bf --- /dev/null +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/Pages/AboutPage.xaml.cs @@ -0,0 +1,14 @@ +using Microsoft.UI.Xaml.Controls; + +// To learn more about WinUI, the WinUI project structure, +// and more about our project templates, see: http://aka.ms/winui-project-info. + +namespace $safeprojectname$.Pages; + +public sealed partial class AboutPage : Page +{ + public AboutPage() + { + InitializeComponent(); + } +} diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/Pages/HomePage.xaml b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/Pages/HomePage.xaml new file mode 100644 index 0000000000..ab4b74135e --- /dev/null +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/Pages/HomePage.xaml @@ -0,0 +1,19 @@ + + + + + + + + + + + + diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/Pages/HomePage.xaml.cs b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/Pages/HomePage.xaml.cs new file mode 100644 index 0000000000..3c546496b8 --- /dev/null +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/Pages/HomePage.xaml.cs @@ -0,0 +1,14 @@ +using Microsoft.UI.Xaml.Controls; + +// To learn more about WinUI, the WinUI project structure, +// and more about our project templates, see: http://aka.ms/winui-project-info. + +namespace $safeprojectname$.Pages; + +public sealed partial class HomePage : Page +{ + public HomePage() + { + InitializeComponent(); + } +} diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/Pages/SettingsPage.xaml b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/Pages/SettingsPage.xaml new file mode 100644 index 0000000000..7dca11a1c5 --- /dev/null +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/Pages/SettingsPage.xaml @@ -0,0 +1,19 @@ + + + + + + + + + + + + diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/Pages/SettingsPage.xaml.cs b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/Pages/SettingsPage.xaml.cs new file mode 100644 index 0000000000..e2b1112ba2 --- /dev/null +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/Pages/SettingsPage.xaml.cs @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +using Microsoft.UI.Xaml.Controls; + +// To learn more about WinUI, the WinUI project structure, +// and more about our project templates, see: http://aka.ms/winui-project-info. + +namespace $safeprojectname$.Pages; + +public sealed partial class SettingsPage : Page +{ + public SettingsPage() + { + InitializeComponent(); + } +} diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/ProjectTemplate.csproj b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/ProjectTemplate.csproj new file mode 100644 index 0000000000..7589d99c4c --- /dev/null +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/ProjectTemplate.csproj @@ -0,0 +1,75 @@ + + + WinExe + $DotNetVersion$-windows10.0.26100.0 + 10.0.17763.0 + $safeprojectname$ + app.manifest + x86;x64;ARM64 + win-$([System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture.ToString().ToLowerInvariant()) + win-$(Platform).pubxml + true + false + true + enable + enable + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + + + False + True + False + True + + diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Properties/PublishProfiles/win-arm64.pubxml b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/Properties/PublishProfiles/win-arm64.pubxml similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Properties/PublishProfiles/win-arm64.pubxml rename to dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/Properties/PublishProfiles/win-arm64.pubxml diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Properties/PublishProfiles/win-x64.pubxml b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/Properties/PublishProfiles/win-x64.pubxml similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Properties/PublishProfiles/win-x64.pubxml rename to dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/Properties/PublishProfiles/win-x64.pubxml diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Properties/PublishProfiles/win-x86.pubxml b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/Properties/PublishProfiles/win-x86.pubxml similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Properties/PublishProfiles/win-x86.pubxml rename to dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/Properties/PublishProfiles/win-x86.pubxml diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/Properties/launchSettings.json b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/Properties/launchSettings.json similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/Properties/launchSettings.json rename to dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/Properties/launchSettings.json diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/WinUI.Desktop.Cs.NavigationApp.csproj b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/WinUI.Desktop.Cs.NavigationApp.csproj new file mode 100644 index 0000000000..de1bc9cf8c --- /dev/null +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/WinUI.Desktop.Cs.NavigationApp.csproj @@ -0,0 +1,98 @@ + + + + 15.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + Debug + AnyCPU + {82b43b9b-a64c-4715-b499-d71e9ca2bd60};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + {B2C3D4E5-2222-4B6C-AD9E-2F3A4B5C6D7E} + Library + Properties + WinUI.Desktop.Cs.NavigationApp + WinUI.Desktop.Cs.NavigationApp + v4.7.2 + 512 + false + false + false + false + false + false + false + false + false + false + SHA256 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + Designer + + + + + + + Designer + + + Designer + + + + + Designer + + + + Designer + + + + Designer + + + + + + + + + + + + + + + + + + diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/WinUI.Desktop.Cs.NavigationApp.ico b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/WinUI.Desktop.Cs.NavigationApp.ico new file mode 100644 index 0000000000..624c2be0d1 Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/WinUI.Desktop.Cs.NavigationApp.ico differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/WinUI.Desktop.Cs.NavigationApp.png b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/WinUI.Desktop.Cs.NavigationApp.png new file mode 100644 index 0000000000..211e75744b Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/WinUI.Desktop.Cs.NavigationApp.png differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/WinUI.Desktop.Cs.NavigationApp.vstemplate b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/WinUI.Desktop.Cs.NavigationApp.vstemplate new file mode 100644 index 0000000000..9e4ad75d31 --- /dev/null +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/WinUI.Desktop.Cs.NavigationApp.vstemplate @@ -0,0 +1,76 @@ + + + + + + WinUI.Desktop.Cs.NavigationApp.ico + Microsoft.WinUI.Desktop.Cs.NavigationApp + WinRT-Managed + CSharp + true + App + true + Enabled + true + 2 + Windows + true + WinUI.Desktop.Cs.NavigationApp.png + true + csharp + XAML + windows + desktop + WinUI + + + + + + + + + Properties\launchSettings.json + Properties\PublishProfiles\win-arm64.pubxml + Properties\PublishProfiles\win-x64.pubxml + Properties\PublishProfiles\win-x86.pubxml + app.manifest + App.xaml + App.xaml.cs + MainWindow.xaml + MainWindow.xaml.cs + Package-managed.appxmanifest + + HomePage.xaml + HomePage.xaml.cs + AboutPage.xaml + AboutPage.xaml.cs + SettingsPage.xaml + SettingsPage.xaml.cs + + + SplashScreen.scale-200.png + LockScreenLogo.scale-200.png + Square150x150Logo.scale-200.png + Square44x44Logo.scale-200.png + Square44x44Logo.targetsize-24_altform-unplated.png + Square44x44Logo.targetsize-48_altform-lightunplated.png + StoreLogo.png + AppIcon.ico + Wide310x150Logo.scale-200.png + + + + + + + + + Microsoft.VisualStudio.WinRT.TemplateWizards, Version=16.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + Microsoft.VisualStudio.WinRT.TemplateWizards.UpdatePublisherInManifestWizard + + + WindowsAppSDK.Cs.Extension.Dev17, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + WindowsAppSDK.TemplateUtilities.NuGetPackageInstaller + + diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/app.manifest b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/app.manifest similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/app.manifest rename to dev/Templates/Source/ProjectTemplates/Desktop/CSharp/NavigationApp/app.manifest diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/App.xaml b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/App.xaml similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/App.xaml rename to dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/App.xaml diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/App.xaml.cs b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/App.xaml.cs similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/App.xaml.cs rename to dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/App.xaml.cs diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/AppIcon.ico b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/AppIcon.ico new file mode 100644 index 0000000000..235dad2c56 Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/AppIcon.ico differ diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/MainWindow.xaml b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/MainWindow.xaml similarity index 50% rename from dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/MainWindow.xaml rename to dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/MainWindow.xaml index 5c061d1cbf..2dde673831 100644 --- a/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/MainWindow.xaml +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/MainWindow.xaml @@ -1,19 +1,29 @@ - + - + Title="$projectname$" + mc:Ignorable="d"> + + + + + + + + + + + diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/MainWindow.xaml.cs b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/MainWindow.xaml.cs similarity index 85% rename from dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/MainWindow.xaml.cs rename to dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/MainWindow.xaml.cs index ef074a16f3..4b2e0e2eb5 100644 --- a/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/MainWindow.xaml.cs +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/MainWindow.xaml.cs @@ -18,13 +18,15 @@ namespace $safeprojectname$; -/// -/// An empty window that can be used on its own or navigated to within a Frame. -/// public sealed partial class MainWindow : Window { public MainWindow() { InitializeComponent(); + + ExtendsContentIntoTitleBar = true; + SetTitleBar(AppTitleBar); + + AppWindow.SetIcon("AppIcon.ico"); } } diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/ProjectTemplate.csproj b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/ProjectTemplate.csproj similarity index 94% rename from dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/ProjectTemplate.csproj rename to dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/ProjectTemplate.csproj index 2ad24222f0..67cd6291fd 100644 --- a/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/ProjectTemplate.csproj +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/ProjectTemplate.csproj @@ -12,6 +12,10 @@ enable + + + + diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/Properties/PublishProfiles/win-arm64.pubxml b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/Properties/PublishProfiles/win-arm64.pubxml similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/Properties/PublishProfiles/win-arm64.pubxml rename to dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/Properties/PublishProfiles/win-arm64.pubxml diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/Properties/PublishProfiles/win-x64.pubxml b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/Properties/PublishProfiles/win-x64.pubxml similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/Properties/PublishProfiles/win-x64.pubxml rename to dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/Properties/PublishProfiles/win-x64.pubxml diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/Properties/PublishProfiles/win-x86.pubxml b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/Properties/PublishProfiles/win-x86.pubxml similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/Properties/PublishProfiles/win-x86.pubxml rename to dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/Properties/PublishProfiles/win-x86.pubxml diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/WinUI.Desktop.Cs.PackagedApp.ico b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/WinUI.Desktop.Cs.BlankApp.ico similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/WinUI.Desktop.Cs.PackagedApp.ico rename to dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/WinUI.Desktop.Cs.BlankApp.ico diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/WinUI.Desktop.Cs.PackagedApp.png b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/WinUI.Desktop.Cs.BlankApp.png similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/WinUI.Desktop.Cs.PackagedApp.png rename to dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/WinUI.Desktop.Cs.BlankApp.png diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/WinUI.Desktop.Cs.BlankApp.vstemplate b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/WinUI.Desktop.Cs.BlankApp.vstemplate similarity index 96% rename from dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/WinUI.Desktop.Cs.BlankApp.vstemplate rename to dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/WinUI.Desktop.Cs.BlankApp.vstemplate index 6f714e53a2..eb8de9fc02 100644 --- a/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/WinUI.Desktop.Cs.BlankApp.vstemplate +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/WinUI.Desktop.Cs.BlankApp.vstemplate @@ -34,6 +34,7 @@ App.xaml.cs MainWindow.xaml MainWindow.xaml.cs + AppIcon.ico diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/app.manifest b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/app.manifest similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/app.manifest rename to dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/app.manifest diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/WapProj/LockScreenLogo.scale-200.png b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/WapProj/LockScreenLogo.scale-200.png new file mode 100644 index 0000000000..33f889e106 Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/WapProj/LockScreenLogo.scale-200.png differ diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/WapProj/Package-managed.appxmanifest b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/WapProj/Package-managed.appxmanifest similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/WapProj/Package-managed.appxmanifest rename to dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/WapProj/Package-managed.appxmanifest diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/WapProj/SplashScreen.scale-200.png b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/WapProj/SplashScreen.scale-200.png new file mode 100644 index 0000000000..802c79d6d7 Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/WapProj/SplashScreen.scale-200.png differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/WapProj/Square150x150Logo.scale-200.png b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/WapProj/Square150x150Logo.scale-200.png new file mode 100644 index 0000000000..ddba42adbb Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/WapProj/Square150x150Logo.scale-200.png differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/WapProj/Square44x44Logo.scale-200.png b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/WapProj/Square44x44Logo.scale-200.png new file mode 100644 index 0000000000..9327dd748e Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/WapProj/Square44x44Logo.scale-200.png differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/WapProj/Square44x44Logo.targetsize-24_altform-unplated.png b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/WapProj/Square44x44Logo.targetsize-24_altform-unplated.png new file mode 100644 index 0000000000..e51416a8e4 Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/WapProj/Square44x44Logo.targetsize-24_altform-unplated.png differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/WapProj/Square44x44Logo.targetsize-48_altform-lightunplated.png b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/WapProj/Square44x44Logo.targetsize-48_altform-lightunplated.png new file mode 100644 index 0000000000..bf063eb4d6 Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/WapProj/Square44x44Logo.targetsize-48_altform-lightunplated.png differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/WapProj/StoreLogo.png b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/WapProj/StoreLogo.png new file mode 100644 index 0000000000..be865f0c37 Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/WapProj/StoreLogo.png differ diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/WapProj/WapProjTemplate.ico b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/WapProj/WapProjTemplate.ico similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/WapProj/WapProjTemplate.ico rename to dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/WapProj/WapProjTemplate.ico diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/WapProj/WapProjTemplate.wapproj b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/WapProj/WapProjTemplate.wapproj similarity index 97% rename from dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/WapProj/WapProjTemplate.wapproj rename to dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/WapProj/WapProjTemplate.wapproj index 2147dfdcd2..4f99481659 100644 --- a/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/WapProj/WapProjTemplate.wapproj +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/WapProj/WapProjTemplate.wapproj @@ -67,6 +67,7 @@ + diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/WapProj/Wide310x150Logo.scale-200.png b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/WapProj/Wide310x150Logo.scale-200.png new file mode 100644 index 0000000000..314d297f20 Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/WapProj/Wide310x150Logo.scale-200.png differ diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/WapProj/WinUI.Desktop.Cs.WapProj.vstemplate b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/WapProj/WinUI.Desktop.Cs.WapProj.vstemplate similarity index 95% rename from dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/WapProj/WinUI.Desktop.Cs.WapProj.vstemplate rename to dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/WapProj/WinUI.Desktop.Cs.WapProj.vstemplate index 92384a2337..b622aec714 100644 --- a/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/WapProj/WinUI.Desktop.Cs.WapProj.vstemplate +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/WapProj/WinUI.Desktop.Cs.WapProj.vstemplate @@ -35,6 +35,7 @@ Square150x150Logo.scale-200.png Square44x44Logo.scale-200.png Square44x44Logo.targetsize-24_altform-unplated.png + Square44x44Logo.targetsize-48_altform-lightunplated.png StoreLogo.png Wide310x150Logo.scale-200.png diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/WinUI.Desktop.Cs.PackagedApp.csproj b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/WinUI.Desktop.Cs.PackagedApp.csproj similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/WinUI.Desktop.Cs.PackagedApp.csproj rename to dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/WinUI.Desktop.Cs.PackagedApp.csproj diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/WinUI.Desktop.Cs.SingleProjectPackagedApp.ico b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/WinUI.Desktop.Cs.PackagedApp.ico similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/WinUI.Desktop.Cs.SingleProjectPackagedApp.ico rename to dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/WinUI.Desktop.Cs.PackagedApp.ico diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/WinUI.Desktop.Cs.SingleProjectPackagedApp.png b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/WinUI.Desktop.Cs.PackagedApp.png similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/WinUI.Desktop.Cs.SingleProjectPackagedApp.png rename to dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/WinUI.Desktop.Cs.PackagedApp.png diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/WinUI.Desktop.Cs.PackagedApp.vstemplate b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/WinUI.Desktop.Cs.PackagedApp.vstemplate similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/WinUI.Desktop.Cs.PackagedApp.vstemplate rename to dev/Templates/Source/ProjectTemplates/Desktop/CSharp/PackagedApp/WinUI.Desktop.Cs.PackagedApp.vstemplate diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/App.xaml b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/App.xaml similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/App.xaml rename to dev/Templates/Source/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/App.xaml diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/App.xaml.cs b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/App.xaml.cs similarity index 88% rename from dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/App.xaml.cs rename to dev/Templates/Source/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/App.xaml.cs index f2a43695a2..c61137c92f 100644 --- a/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/App.xaml.cs +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/App.xaml.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Runtime.InteropServices.WindowsRuntime; -using Windows.ApplicationModel; +using Windows.ApplicationModel; using Windows.ApplicationModel.Activation; using Windows.Foundation; using Windows.Foundation.Collections; diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Assets/AppIcon.ico b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Assets/AppIcon.ico new file mode 100644 index 0000000000..235dad2c56 Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Assets/AppIcon.ico differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Assets/LockScreenLogo.scale-200.png b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Assets/LockScreenLogo.scale-200.png new file mode 100644 index 0000000000..33f889e106 Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Assets/LockScreenLogo.scale-200.png differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Assets/SplashScreen.scale-200.png b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Assets/SplashScreen.scale-200.png new file mode 100644 index 0000000000..802c79d6d7 Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Assets/SplashScreen.scale-200.png differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Assets/Square150x150Logo.scale-200.png b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Assets/Square150x150Logo.scale-200.png new file mode 100644 index 0000000000..ddba42adbb Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Assets/Square150x150Logo.scale-200.png differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Assets/Square44x44Logo.scale-200.png b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Assets/Square44x44Logo.scale-200.png new file mode 100644 index 0000000000..9327dd748e Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Assets/Square44x44Logo.scale-200.png differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Assets/Square44x44Logo.targetsize-24_altform-unplated.png b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Assets/Square44x44Logo.targetsize-24_altform-unplated.png new file mode 100644 index 0000000000..e51416a8e4 Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Assets/Square44x44Logo.targetsize-24_altform-unplated.png differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Assets/Square44x44Logo.targetsize-48_altform-lightunplated.png b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Assets/Square44x44Logo.targetsize-48_altform-lightunplated.png new file mode 100644 index 0000000000..bf063eb4d6 Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Assets/Square44x44Logo.targetsize-48_altform-lightunplated.png differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Assets/StoreLogo.png b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Assets/StoreLogo.png new file mode 100644 index 0000000000..be865f0c37 Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Assets/StoreLogo.png differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Assets/Wide310x150Logo.scale-200.png b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Assets/Wide310x150Logo.scale-200.png new file mode 100644 index 0000000000..314d297f20 Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Assets/Wide310x150Logo.scale-200.png differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/MainPage.xaml b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/MainPage.xaml new file mode 100644 index 0000000000..c7c89c7238 --- /dev/null +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/MainPage.xaml @@ -0,0 +1,18 @@ + + + + + + diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/MainPage.xaml.cs b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/MainPage.xaml.cs new file mode 100644 index 0000000000..6fc70d7281 --- /dev/null +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/MainPage.xaml.cs @@ -0,0 +1,20 @@ +using Microsoft.UI.Xaml.Controls; + +// To learn more about WinUI, the WinUI project structure, +// and more about our project templates, see: http://aka.ms/winui-project-info. + +namespace $safeprojectname$; + +/// +/// The main content page displayed inside the application window. +/// Add your UI logic, event handlers, and data binding here. +/// +public sealed partial class MainPage : Page +{ + public MainPage() + { + InitializeComponent(); + + // TODO: Add your initialization logic here. + } +} diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/MainWindow.xaml b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/MainWindow.xaml new file mode 100644 index 0000000000..29974c45fd --- /dev/null +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/MainWindow.xaml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/MainWindow.xaml.cs b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/MainWindow.xaml.cs new file mode 100644 index 0000000000..fc24f9ed43 --- /dev/null +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/MainWindow.xaml.cs @@ -0,0 +1,27 @@ +using Microsoft.UI.Xaml; + +// To learn more about WinUI, the WinUI project structure, +// and more about our project templates, see: http://aka.ms/winui-project-info. + +namespace $safeprojectname$; + +/// +/// The application window. This hosts a Frame that displays pages. Add your +/// UI and logic to MainPage.xaml / MainPage.xaml.cs instead of here so you +/// can use Page features such as navigation events and the Loaded lifecycle. +/// +public sealed partial class MainWindow : Window +{ + public MainWindow() + { + InitializeComponent(); + + ExtendsContentIntoTitleBar = true; + SetTitleBar(AppTitleBar); + + AppWindow.SetIcon("Assets/AppIcon.ico"); + + // Navigate the root frame to the main page on startup. + RootFrame.Navigate(typeof(MainPage)); + } +} diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/Package-native.appxmanifest b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Package-managed.appxmanifest similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/Package-native.appxmanifest rename to dev/Templates/Source/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Package-managed.appxmanifest diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/ProjectTemplate.csproj b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/ProjectTemplate.csproj similarity index 63% rename from dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/ProjectTemplate.csproj rename to dev/Templates/Source/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/ProjectTemplate.csproj index 4c6b8df175..5cfe00875a 100644 --- a/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/ProjectTemplate.csproj +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/ProjectTemplate.csproj @@ -1,16 +1,17 @@ WinExe - $DotNetVersion$-windows10.0.19041.0 + $DotNetVersion$-windows10.0.26100.0 10.0.17763.0 $safeprojectname$ app.manifest x86;x64;ARM64 - win-x86;win-x64;win-arm64 - win-$(Platform).pubxml + win-$([System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture.ToString().ToLowerInvariant()) + win-$(Platform).pubxml true false true + enable enable @@ -20,7 +21,9 @@ + + @@ -37,6 +40,22 @@ + + + + + + FileSystem + ARM64 + win-arm64 + bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\ + true + False + + \ No newline at end of file diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Properties/PublishProfiles/win-x64.pubxml b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Properties/PublishProfiles/win-x64.pubxml new file mode 100644 index 0000000000..cd995617c0 --- /dev/null +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Properties/PublishProfiles/win-x64.pubxml @@ -0,0 +1,14 @@ + + + + + FileSystem + x64 + win-x64 + bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\ + true + False + + \ No newline at end of file diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Properties/PublishProfiles/win-x86.pubxml b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Properties/PublishProfiles/win-x86.pubxml new file mode 100644 index 0000000000..a70c69425f --- /dev/null +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Properties/PublishProfiles/win-x86.pubxml @@ -0,0 +1,14 @@ + + + + + FileSystem + x86 + win-x86 + bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\ + true + False + + \ No newline at end of file diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Properties/launchSettings.json b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Properties/launchSettings.json new file mode 100644 index 0000000000..e25cd6a4f8 --- /dev/null +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Properties/launchSettings.json @@ -0,0 +1,10 @@ +{ + "profiles": { + "$projectname$ (Package)": { + "commandName": "MsixPackage" + }, + "$projectname$ (Unpackaged)": { + "commandName": "Project" + } + } +} \ No newline at end of file diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/WinUI.Desktop.Cs.SingleProjectPackagedApp.csproj b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/WinUI.Desktop.Cs.SingleProjectPackagedApp.csproj similarity index 98% rename from dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/WinUI.Desktop.Cs.SingleProjectPackagedApp.csproj rename to dev/Templates/Source/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/WinUI.Desktop.Cs.SingleProjectPackagedApp.csproj index 7051d6815b..9641aaf7f3 100644 --- a/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/WinUI.Desktop.Cs.SingleProjectPackagedApp.csproj +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/WinUI.Desktop.Cs.SingleProjectPackagedApp.csproj @@ -73,6 +73,7 @@ + diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/WinUI.Desktop.Cs.SingleProjectPackagedApp.ico b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/WinUI.Desktop.Cs.SingleProjectPackagedApp.ico new file mode 100644 index 0000000000..293c93c712 Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/WinUI.Desktop.Cs.SingleProjectPackagedApp.ico differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/WinUI.Desktop.Cs.SingleProjectPackagedApp.png b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/WinUI.Desktop.Cs.SingleProjectPackagedApp.png new file mode 100644 index 0000000000..491faf7065 Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/WinUI.Desktop.Cs.SingleProjectPackagedApp.png differ diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/WinUI.Desktop.Cs.SingleProjectPackagedApp.vstemplate b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/WinUI.Desktop.Cs.SingleProjectPackagedApp.vstemplate similarity index 88% rename from dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/WinUI.Desktop.Cs.SingleProjectPackagedApp.vstemplate rename to dev/Templates/Source/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/WinUI.Desktop.Cs.SingleProjectPackagedApp.vstemplate index 2a1fb70704..dca0c580ce 100644 --- a/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/WinUI.Desktop.Cs.SingleProjectPackagedApp.vstemplate +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/WinUI.Desktop.Cs.SingleProjectPackagedApp.vstemplate @@ -39,6 +39,8 @@ App.xaml.cs MainWindow.xaml MainWindow.xaml.cs + MainPage.xaml + MainPage.xaml.cs Package-managed.appxmanifest SplashScreen.scale-200.png @@ -46,12 +48,14 @@ Square150x150Logo.scale-200.png Square44x44Logo.scale-200.png Square44x44Logo.targetsize-24_altform-unplated.png + Square44x44Logo.targetsize-48_altform-lightunplated.png + AppIcon.ico StoreLogo.png Wide310x150Logo.scale-200.png - + diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/app.manifest b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/app.manifest similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/app.manifest rename to dev/Templates/Source/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/app.manifest diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/App.xaml b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/App.xaml similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/App.xaml rename to dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/App.xaml diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/App.xaml.cs b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/App.xaml.cs new file mode 100644 index 0000000000..8caa9b0f1d --- /dev/null +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/App.xaml.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +using Microsoft.UI.Xaml; + +namespace $safeprojectname$; + +/// +/// Provides application-specific behavior to supplement the default Application class. +/// +public partial class App : Application +{ + private Window? _window; + + /// + /// Initializes the singleton application object. + /// + public App() + { + InitializeComponent(); + } + + /// + /// Invoked when the application is launched. + /// + /// Details about the launch request and process. + protected override void OnLaunched(LaunchActivatedEventArgs args) + { + _window = new MainWindow(); + _window.Activate(); + } +} diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/Assets/AppIcon.ico b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/Assets/AppIcon.ico new file mode 100644 index 0000000000..235dad2c56 Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/Assets/AppIcon.ico differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/Assets/LockScreenLogo.scale-200.png b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/Assets/LockScreenLogo.scale-200.png new file mode 100644 index 0000000000..33f889e106 Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/Assets/LockScreenLogo.scale-200.png differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/Assets/SplashScreen.scale-200.png b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/Assets/SplashScreen.scale-200.png new file mode 100644 index 0000000000..802c79d6d7 Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/Assets/SplashScreen.scale-200.png differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/Assets/Square150x150Logo.scale-200.png b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/Assets/Square150x150Logo.scale-200.png new file mode 100644 index 0000000000..ddba42adbb Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/Assets/Square150x150Logo.scale-200.png differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/Assets/Square44x44Logo.scale-200.png b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/Assets/Square44x44Logo.scale-200.png new file mode 100644 index 0000000000..9327dd748e Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/Assets/Square44x44Logo.scale-200.png differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/Assets/Square44x44Logo.targetsize-24_altform-unplated.png b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/Assets/Square44x44Logo.targetsize-24_altform-unplated.png new file mode 100644 index 0000000000..e51416a8e4 Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/Assets/Square44x44Logo.targetsize-24_altform-unplated.png differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/Assets/Square44x44Logo.targetsize-48_altform-lightunplated.png b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/Assets/Square44x44Logo.targetsize-48_altform-lightunplated.png new file mode 100644 index 0000000000..bf063eb4d6 Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/Assets/Square44x44Logo.targetsize-48_altform-lightunplated.png differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/Assets/StoreLogo.png b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/Assets/StoreLogo.png new file mode 100644 index 0000000000..be865f0c37 Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/Assets/StoreLogo.png differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/Assets/Wide310x150Logo.scale-200.png b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/Assets/Wide310x150Logo.scale-200.png new file mode 100644 index 0000000000..314d297f20 Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/Assets/Wide310x150Logo.scale-200.png differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/MainWindow.xaml b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/MainWindow.xaml new file mode 100644 index 0000000000..aebd1f83f0 --- /dev/null +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/MainWindow.xaml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/MainWindow.xaml.cs b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/MainWindow.xaml.cs new file mode 100644 index 0000000000..4f78cd1ff8 --- /dev/null +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/MainWindow.xaml.cs @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +using Microsoft.UI.Windowing; +using Microsoft.UI.Xaml; +using Microsoft.UI.Xaml.Controls; +using $safeprojectname$.Pages; + +namespace $safeprojectname$; + +public sealed partial class MainWindow : Window +{ + private int _tabCounter; + + public MainWindow() + { + InitializeComponent(); + + // Extend content into the title bar and use the TabView's + // drag region so the tab strip acts as the title bar area. + ExtendsContentIntoTitleBar = true; + SetTitleBar(CustomDragRegion); + AppWindow.SetIcon("Assets/AppIcon.ico"); + + // Reserve space at the right edge of the tab strip for the system + // caption buttons, scaled to the current DPI so they don't overlap + // tabs on high-DPI displays. + AppWindow.Changed += OnAppWindowChanged; + UpdateCaptionButtonInset(); + + // Add a few default tabs on startup. + AddTab("Home", typeof(HomePage)); + AddTab("About", typeof(AboutPage)); + TabControl.SelectedIndex = 0; + } + + private void OnAppWindowChanged(AppWindow sender, AppWindowChangedEventArgs args) + { + if (args.DidSizeChange || args.DidPositionChange) + { + UpdateCaptionButtonInset(); + } + } + + private void UpdateCaptionButtonInset() + { + // RightInset is in physical pixels; convert to DIPs. + double scale = (Content as FrameworkElement)?.XamlRoot?.RasterizationScale ?? 1.0; + if (scale <= 0) + { + scale = 1.0; + } + + CustomDragRegion.MinWidth = AppWindow.TitleBar.RightInset / scale; + } + + /// + /// Creates a new tab with the given header and navigates it to the specified page type. + /// + private TabViewItem AddTab(string header, System.Type pageType) + { + var tab = new TabViewItem + { + Header = header, + IconSource = new SymbolIconSource { Symbol = Symbol.Document } + }; + + var frame = new Frame(); + frame.Navigate(pageType); + tab.Content = frame; + + TabControl.TabItems.Add(tab); + return tab; + } + + /// + /// Called when the user clicks the "+" button to add a new tab. + /// + private void TabControl_AddTabButtonClick(TabView sender, object args) + { + _tabCounter++; + var tab = AddTab($"New Tab {_tabCounter}", typeof(HomePage)); + sender.SelectedItem = tab; + } + + /// + /// Called when a tab's close button is clicked. + /// Closes the window if the last tab is removed. + /// + private void TabControl_TabCloseRequested(TabView sender, TabViewTabCloseRequestedEventArgs args) + { + sender.TabItems.Remove(args.Tab); + + if (sender.TabItems.Count == 0) + { + Close(); + } + } +} diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/Package-managed.appxmanifest b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/Package-managed.appxmanifest new file mode 100644 index 0000000000..980d0b475c --- /dev/null +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/Package-managed.appxmanifest @@ -0,0 +1,53 @@ + + + + + + + + + + $projectname$ + $XmlEscapedPublisher$ + Assets\StoreLogo.png + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/Pages/AboutPage.xaml b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/Pages/AboutPage.xaml new file mode 100644 index 0000000000..5bd3b2e041 --- /dev/null +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/Pages/AboutPage.xaml @@ -0,0 +1,19 @@ + + + + + + + + + + + + diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/Pages/AboutPage.xaml.cs b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/Pages/AboutPage.xaml.cs new file mode 100644 index 0000000000..0b4934adcc --- /dev/null +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/Pages/AboutPage.xaml.cs @@ -0,0 +1,14 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +using Microsoft.UI.Xaml.Controls; + +namespace $safeprojectname$.Pages; + +public sealed partial class AboutPage : Page +{ + public AboutPage() + { + InitializeComponent(); + } +} diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/Pages/HomePage.xaml b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/Pages/HomePage.xaml new file mode 100644 index 0000000000..9db78fa9fe --- /dev/null +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/Pages/HomePage.xaml @@ -0,0 +1,19 @@ + + + + + + + + + + + + diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/Pages/HomePage.xaml.cs b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/Pages/HomePage.xaml.cs new file mode 100644 index 0000000000..c2cab60d76 --- /dev/null +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/Pages/HomePage.xaml.cs @@ -0,0 +1,14 @@ +// Copyright (c) Microsoft Corporation. +// Licensed under the MIT License. + +using Microsoft.UI.Xaml.Controls; + +namespace $safeprojectname$.Pages; + +public sealed partial class HomePage : Page +{ + public HomePage() + { + InitializeComponent(); + } +} diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/ProjectTemplate.csproj b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/ProjectTemplate.csproj new file mode 100644 index 0000000000..7589d99c4c --- /dev/null +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/ProjectTemplate.csproj @@ -0,0 +1,75 @@ + + + WinExe + $DotNetVersion$-windows10.0.26100.0 + 10.0.17763.0 + $safeprojectname$ + app.manifest + x86;x64;ARM64 + win-$([System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture.ToString().ToLowerInvariant()) + win-$(Platform).pubxml + true + false + true + enable + enable + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true + + + + + False + True + False + True + + diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/Properties/PublishProfiles/win-arm64.pubxml b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/Properties/PublishProfiles/win-arm64.pubxml new file mode 100644 index 0000000000..8953cce984 --- /dev/null +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/Properties/PublishProfiles/win-arm64.pubxml @@ -0,0 +1,14 @@ + + + + + FileSystem + ARM64 + win-arm64 + bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\ + true + False + + \ No newline at end of file diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/Properties/PublishProfiles/win-x64.pubxml b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/Properties/PublishProfiles/win-x64.pubxml new file mode 100644 index 0000000000..cd995617c0 --- /dev/null +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/Properties/PublishProfiles/win-x64.pubxml @@ -0,0 +1,14 @@ + + + + + FileSystem + x64 + win-x64 + bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\ + true + False + + \ No newline at end of file diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/Properties/PublishProfiles/win-x86.pubxml b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/Properties/PublishProfiles/win-x86.pubxml new file mode 100644 index 0000000000..a70c69425f --- /dev/null +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/Properties/PublishProfiles/win-x86.pubxml @@ -0,0 +1,14 @@ + + + + + FileSystem + x86 + win-x86 + bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\ + true + False + + \ No newline at end of file diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/Properties/launchSettings.json b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/Properties/launchSettings.json new file mode 100644 index 0000000000..e25cd6a4f8 --- /dev/null +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/Properties/launchSettings.json @@ -0,0 +1,10 @@ +{ + "profiles": { + "$projectname$ (Package)": { + "commandName": "MsixPackage" + }, + "$projectname$ (Unpackaged)": { + "commandName": "Project" + } + } +} \ No newline at end of file diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/WinUI.Desktop.Cs.TabViewApp.csproj b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/WinUI.Desktop.Cs.TabViewApp.csproj new file mode 100644 index 0000000000..c5979d7301 --- /dev/null +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/WinUI.Desktop.Cs.TabViewApp.csproj @@ -0,0 +1,94 @@ + + + + 15.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + Debug + AnyCPU + {82b43b9b-a64c-4715-b499-d71e9ca2bd60};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + {A1B2C3D4-1111-4A5B-9C8D-1E2F3A4B5C6D} + Library + Properties + WinUI.Desktop.Cs.TabViewApp + WinUI.Desktop.Cs.TabViewApp + v4.7.2 + 512 + false + false + false + false + false + false + false + false + false + false + SHA256 + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + + + + + + + + Designer + + + + + + + Designer + + + Designer + + + + + Designer + + + + Designer + + + + + + + + + + + + + + + + + + diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/WinUI.Desktop.Cs.TabViewApp.ico b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/WinUI.Desktop.Cs.TabViewApp.ico new file mode 100644 index 0000000000..bb2ced4899 Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/WinUI.Desktop.Cs.TabViewApp.ico differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/WinUI.Desktop.Cs.TabViewApp.png b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/WinUI.Desktop.Cs.TabViewApp.png new file mode 100644 index 0000000000..a112563b52 Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/WinUI.Desktop.Cs.TabViewApp.png differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/WinUI.Desktop.Cs.TabViewApp.vstemplate b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/WinUI.Desktop.Cs.TabViewApp.vstemplate new file mode 100644 index 0000000000..2b300d62ee --- /dev/null +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/WinUI.Desktop.Cs.TabViewApp.vstemplate @@ -0,0 +1,74 @@ + + + + + + WinUI.Desktop.Cs.TabViewApp.ico + Microsoft.WinUI.Desktop.Cs.TabViewApp + WinRT-Managed + CSharp + true + App + true + Enabled + true + 2 + Windows + true + WinUI.Desktop.Cs.TabViewApp.png + true + csharp + XAML + windows + desktop + WinUI + + + + + + + + + Properties\launchSettings.json + Properties\PublishProfiles\win-arm64.pubxml + Properties\PublishProfiles\win-x64.pubxml + Properties\PublishProfiles\win-x86.pubxml + app.manifest + App.xaml + App.xaml.cs + MainWindow.xaml + MainWindow.xaml.cs + Package-managed.appxmanifest + + HomePage.xaml + HomePage.xaml.cs + AboutPage.xaml + AboutPage.xaml.cs + + + SplashScreen.scale-200.png + LockScreenLogo.scale-200.png + Square150x150Logo.scale-200.png + Square44x44Logo.scale-200.png + Square44x44Logo.targetsize-24_altform-unplated.png + Square44x44Logo.targetsize-48_altform-lightunplated.png + StoreLogo.png + AppIcon.ico + Wide310x150Logo.scale-200.png + + + + + + + + + Microsoft.VisualStudio.WinRT.TemplateWizards, Version=16.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + Microsoft.VisualStudio.WinRT.TemplateWizards.UpdatePublisherInManifestWizard + + + WindowsAppSDK.Cs.Extension.Dev17, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null + WindowsAppSDK.TemplateUtilities.NuGetPackageInstaller + + diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/app.manifest b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/app.manifest similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/app.manifest rename to dev/Templates/Source/ProjectTemplates/Desktop/CSharp/TabViewApp/app.manifest diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/UnitTestApp/Assets/LockScreenLogo.scale-200.png b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/UnitTestApp/Assets/LockScreenLogo.scale-200.png new file mode 100644 index 0000000000..33f889e106 Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/UnitTestApp/Assets/LockScreenLogo.scale-200.png differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/UnitTestApp/Assets/SplashScreen.scale-200.png b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/UnitTestApp/Assets/SplashScreen.scale-200.png new file mode 100644 index 0000000000..802c79d6d7 Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/UnitTestApp/Assets/SplashScreen.scale-200.png differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/UnitTestApp/Assets/Square150x150Logo.scale-200.png b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/UnitTestApp/Assets/Square150x150Logo.scale-200.png new file mode 100644 index 0000000000..ddba42adbb Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/UnitTestApp/Assets/Square150x150Logo.scale-200.png differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/UnitTestApp/Assets/Square44x44Logo.scale-200.png b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/UnitTestApp/Assets/Square44x44Logo.scale-200.png new file mode 100644 index 0000000000..9327dd748e Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/UnitTestApp/Assets/Square44x44Logo.scale-200.png differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/UnitTestApp/Assets/Square44x44Logo.targetsize-24_altform-unplated.png b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/UnitTestApp/Assets/Square44x44Logo.targetsize-24_altform-unplated.png new file mode 100644 index 0000000000..e51416a8e4 Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/UnitTestApp/Assets/Square44x44Logo.targetsize-24_altform-unplated.png differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/UnitTestApp/Assets/Square44x44Logo.targetsize-48_altform-lightunplated.png b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/UnitTestApp/Assets/Square44x44Logo.targetsize-48_altform-lightunplated.png new file mode 100644 index 0000000000..bf063eb4d6 Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/UnitTestApp/Assets/Square44x44Logo.targetsize-48_altform-lightunplated.png differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/UnitTestApp/Assets/StoreLogo.png b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/UnitTestApp/Assets/StoreLogo.png new file mode 100644 index 0000000000..be865f0c37 Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/UnitTestApp/Assets/StoreLogo.png differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/UnitTestApp/Assets/Wide310x150Logo.scale-200.png b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/UnitTestApp/Assets/Wide310x150Logo.scale-200.png new file mode 100644 index 0000000000..314d297f20 Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/UnitTestApp/Assets/Wide310x150Logo.scale-200.png differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/UnitTestApp/Package-managed.appxmanifest b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/UnitTestApp/Package-managed.appxmanifest new file mode 100644 index 0000000000..980d0b475c --- /dev/null +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/UnitTestApp/Package-managed.appxmanifest @@ -0,0 +1,53 @@ + + + + + + + + + + $projectname$ + $XmlEscapedPublisher$ + Assets\StoreLogo.png + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/ProjectTemplate.csproj b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/UnitTestApp/ProjectTemplate.csproj similarity index 58% rename from dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/ProjectTemplate.csproj rename to dev/Templates/Source/ProjectTemplates/Desktop/CSharp/UnitTestApp/ProjectTemplate.csproj index 3d82c137a9..15e301fd44 100644 --- a/dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/ProjectTemplate.csproj +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/UnitTestApp/ProjectTemplate.csproj @@ -1,17 +1,19 @@ WinExe - $DotNetVersion$-windows10.0.19041.0 + $DotNetVersion$-windows10.0.26100.0 10.0.17763.0 $safeprojectname$ app.manifest x86;x64;ARM64 - win-x86;win-x64;win-arm64 - win-$(Platform).pubxml + win-$([System.Runtime.InteropServices.RuntimeInformation]::ProcessArchitecture.ToString().ToLowerInvariant()) + win-$(Platform).pubxml true false true + enable enable + false @@ -26,6 +28,7 @@ + @@ -43,6 +46,26 @@ + + + + + + FileSystem + ARM64 + win-arm64 + bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\ + true + False + + \ No newline at end of file diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/UnitTestApp/Properties/PublishProfiles/win-x64.pubxml b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/UnitTestApp/Properties/PublishProfiles/win-x64.pubxml new file mode 100644 index 0000000000..cd995617c0 --- /dev/null +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/UnitTestApp/Properties/PublishProfiles/win-x64.pubxml @@ -0,0 +1,14 @@ + + + + + FileSystem + x64 + win-x64 + bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\ + true + False + + \ No newline at end of file diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/UnitTestApp/Properties/PublishProfiles/win-x86.pubxml b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/UnitTestApp/Properties/PublishProfiles/win-x86.pubxml new file mode 100644 index 0000000000..a70c69425f --- /dev/null +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/UnitTestApp/Properties/PublishProfiles/win-x86.pubxml @@ -0,0 +1,14 @@ + + + + + FileSystem + x86 + win-x86 + bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\ + true + False + + \ No newline at end of file diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/UnitTestApp/Properties/launchSettings.json b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/UnitTestApp/Properties/launchSettings.json new file mode 100644 index 0000000000..e25cd6a4f8 --- /dev/null +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/UnitTestApp/Properties/launchSettings.json @@ -0,0 +1,10 @@ +{ + "profiles": { + "$projectname$ (Package)": { + "commandName": "MsixPackage" + }, + "$projectname$ (Unpackaged)": { + "commandName": "Project" + } + } +} \ No newline at end of file diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/UnitTestApp.xaml b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/UnitTestApp/UnitTestApp.xaml similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/UnitTestApp.xaml rename to dev/Templates/Source/ProjectTemplates/Desktop/CSharp/UnitTestApp/UnitTestApp.xaml diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/UnitTestApp.xaml.cs b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/UnitTestApp/UnitTestApp.xaml.cs similarity index 90% rename from dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/UnitTestApp.xaml.cs rename to dev/Templates/Source/ProjectTemplates/Desktop/CSharp/UnitTestApp/UnitTestApp.xaml.cs index b6eefff4f8..f403c53bbb 100644 --- a/dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/UnitTestApp.xaml.cs +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/UnitTestApp/UnitTestApp.xaml.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Runtime.InteropServices.WindowsRuntime; -using Windows.ApplicationModel; +using Windows.ApplicationModel; using Windows.ApplicationModel.Activation; using Windows.Foundation; using Windows.Foundation.Collections; diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/UnitTestAppWindow.xaml b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/UnitTestApp/UnitTestAppWindow.xaml similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/UnitTestAppWindow.xaml rename to dev/Templates/Source/ProjectTemplates/Desktop/CSharp/UnitTestApp/UnitTestAppWindow.xaml diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/UnitTestAppWindow.xaml.cs b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/UnitTestApp/UnitTestAppWindow.xaml.cs similarity index 81% rename from dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/UnitTestAppWindow.xaml.cs rename to dev/Templates/Source/ProjectTemplates/Desktop/CSharp/UnitTestApp/UnitTestAppWindow.xaml.cs index b3db8f9eda..b4a66a02eb 100644 --- a/dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/UnitTestAppWindow.xaml.cs +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/UnitTestApp/UnitTestAppWindow.xaml.cs @@ -1,8 +1,3 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Runtime.InteropServices.WindowsRuntime; using Windows.Foundation; using Windows.Foundation.Collections; using Microsoft.UI.Xaml; diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/UnitTests.cs b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/UnitTestApp/UnitTests.cs similarity index 88% rename from dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/UnitTests.cs rename to dev/Templates/Source/ProjectTemplates/Desktop/CSharp/UnitTestApp/UnitTests.cs index 58f0b468f9..3963e7486e 100644 --- a/dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/UnitTests.cs +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/UnitTestApp/UnitTests.cs @@ -1,9 +1,6 @@ using Microsoft.UI.Xaml.Controls; using Microsoft.VisualStudio.TestTools.UnitTesting; using Microsoft.VisualStudio.TestTools.UnitTesting.AppContainer; -using System; -using System.Collections.Generic; -using System.Linq; namespace $safeprojectname$; diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/WinUI.Desktop.Cs.UnitTestApp.csproj b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/UnitTestApp/WinUI.Desktop.Cs.UnitTestApp.csproj similarity index 98% rename from dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/WinUI.Desktop.Cs.UnitTestApp.csproj rename to dev/Templates/Source/ProjectTemplates/Desktop/CSharp/UnitTestApp/WinUI.Desktop.Cs.UnitTestApp.csproj index 4d7748e3c7..173cdd8a37 100644 --- a/dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/WinUI.Desktop.Cs.UnitTestApp.csproj +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/UnitTestApp/WinUI.Desktop.Cs.UnitTestApp.csproj @@ -74,6 +74,7 @@ + diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/WinUI.Desktop.Cs.UnitTestApp.ico b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/UnitTestApp/WinUI.Desktop.Cs.UnitTestApp.ico similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/WinUI.Desktop.Cs.UnitTestApp.ico rename to dev/Templates/Source/ProjectTemplates/Desktop/CSharp/UnitTestApp/WinUI.Desktop.Cs.UnitTestApp.ico diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/WinUI.Desktop.Cs.UnitTestApp.png b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/UnitTestApp/WinUI.Desktop.Cs.UnitTestApp.png similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/WinUI.Desktop.Cs.UnitTestApp.png rename to dev/Templates/Source/ProjectTemplates/Desktop/CSharp/UnitTestApp/WinUI.Desktop.Cs.UnitTestApp.png diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/WinUI.Desktop.Cs.UnitTestApp.vstemplate b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/UnitTestApp/WinUI.Desktop.Cs.UnitTestApp.vstemplate similarity index 96% rename from dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/WinUI.Desktop.Cs.UnitTestApp.vstemplate rename to dev/Templates/Source/ProjectTemplates/Desktop/CSharp/UnitTestApp/WinUI.Desktop.Cs.UnitTestApp.vstemplate index 90cdd3a246..d5fb8f612a 100644 --- a/dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/WinUI.Desktop.Cs.UnitTestApp.vstemplate +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/UnitTestApp/WinUI.Desktop.Cs.UnitTestApp.vstemplate @@ -46,6 +46,7 @@ Square150x150Logo.scale-200.png Square44x44Logo.scale-200.png Square44x44Logo.targetsize-24_altform-unplated.png + Square44x44Logo.targetsize-48_altform-lightunplated.png StoreLogo.png Wide310x150Logo.scale-200.png diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/app.manifest b/dev/Templates/Source/ProjectTemplates/Desktop/CSharp/UnitTestApp/app.manifest similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/app.manifest rename to dev/Templates/Source/ProjectTemplates/Desktop/CSharp/UnitTestApp/app.manifest diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/App.cpp b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/App.cpp similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/App.cpp rename to dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/App.cpp diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/App.h b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/App.h similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/App.h rename to dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/App.h diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/App.xaml b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/App.xaml new file mode 100644 index 0000000000..65073698c1 --- /dev/null +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/App.xaml @@ -0,0 +1,16 @@ + + + + + + + + + + + + diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/MainWindow.cpp b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/MainWindow.cpp similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/MainWindow.cpp rename to dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/MainWindow.cpp diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/MainWindow.h b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/MainWindow.h similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/MainWindow.h rename to dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/MainWindow.h diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/MainWindow.idl b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/MainWindow.idl similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/MainWindow.idl rename to dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/MainWindow.idl diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/MainWindow.xaml b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/MainWindow.xaml similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/MainWindow.xaml rename to dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/MainWindow.xaml diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/ProjectTemplate.vcxproj b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/ProjectTemplate.vcxproj similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/ProjectTemplate.vcxproj rename to dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/ProjectTemplate.vcxproj diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/ProjectTemplate.vcxproj.filters b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/ProjectTemplate.vcxproj.filters similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/ProjectTemplate.vcxproj.filters rename to dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/ProjectTemplate.vcxproj.filters diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/WinUI.Desktop.CppWinRT.BlankApp.ico b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/WinUI.Desktop.CppWinRT.BlankApp.ico similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/WinUI.Desktop.CppWinRT.BlankApp.ico rename to dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/WinUI.Desktop.CppWinRT.BlankApp.ico diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/WinUI.Desktop.CppWinRT.BlankApp.png b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/WinUI.Desktop.CppWinRT.BlankApp.png similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/WinUI.Desktop.CppWinRT.BlankApp.png rename to dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/WinUI.Desktop.CppWinRT.BlankApp.png diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/WinUI.Desktop.CppWinRT.BlankApp.vstemplate b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/WinUI.Desktop.CppWinRT.BlankApp.vstemplate similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/WinUI.Desktop.CppWinRT.BlankApp.vstemplate rename to dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/WinUI.Desktop.CppWinRT.BlankApp.vstemplate diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/app.manifest b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/app.manifest new file mode 100644 index 0000000000..0f7e64319f --- /dev/null +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/app.manifest @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + PerMonitorV2 + + + \ No newline at end of file diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/pch.cpp b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/pch.cpp similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/pch.cpp rename to dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/pch.cpp diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/pch.h b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/pch.h similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/pch.h rename to dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/pch.h diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/readme.txt b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/readme.txt similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/readme.txt rename to dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/BlankApp/readme.txt diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WapProj/LockScreenLogo.scale-200.png b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WapProj/LockScreenLogo.scale-200.png new file mode 100644 index 0000000000..33f889e106 Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WapProj/LockScreenLogo.scale-200.png differ diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WapProj/Package-managed.appxmanifest b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WapProj/Package-managed.appxmanifest similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WapProj/Package-managed.appxmanifest rename to dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WapProj/Package-managed.appxmanifest diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WapProj/SplashScreen.scale-200.png b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WapProj/SplashScreen.scale-200.png new file mode 100644 index 0000000000..802c79d6d7 Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WapProj/SplashScreen.scale-200.png differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WapProj/Square150x150Logo.scale-200.png b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WapProj/Square150x150Logo.scale-200.png new file mode 100644 index 0000000000..ddba42adbb Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WapProj/Square150x150Logo.scale-200.png differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WapProj/Square44x44Logo.scale-200.png b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WapProj/Square44x44Logo.scale-200.png new file mode 100644 index 0000000000..9327dd748e Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WapProj/Square44x44Logo.scale-200.png differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WapProj/Square44x44Logo.targetsize-24_altform-unplated.png b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WapProj/Square44x44Logo.targetsize-24_altform-unplated.png new file mode 100644 index 0000000000..e51416a8e4 Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WapProj/Square44x44Logo.targetsize-24_altform-unplated.png differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WapProj/Square44x44Logo.targetsize-48_altform-lightunplated.png b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WapProj/Square44x44Logo.targetsize-48_altform-lightunplated.png new file mode 100644 index 0000000000..bf063eb4d6 Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WapProj/Square44x44Logo.targetsize-48_altform-lightunplated.png differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WapProj/StoreLogo.png b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WapProj/StoreLogo.png new file mode 100644 index 0000000000..be865f0c37 Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WapProj/StoreLogo.png differ diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WapProj/WapProjTemplate.ico b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WapProj/WapProjTemplate.ico similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WapProj/WapProjTemplate.ico rename to dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WapProj/WapProjTemplate.ico diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WapProj/WapProjTemplate.wapproj b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WapProj/WapProjTemplate.wapproj similarity index 97% rename from dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WapProj/WapProjTemplate.wapproj rename to dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WapProj/WapProjTemplate.wapproj index 25d166c490..de6d40d79d 100644 --- a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WapProj/WapProjTemplate.wapproj +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WapProj/WapProjTemplate.wapproj @@ -67,6 +67,7 @@ + diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WapProj/Wide310x150Logo.scale-200.png b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WapProj/Wide310x150Logo.scale-200.png new file mode 100644 index 0000000000..314d297f20 Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WapProj/Wide310x150Logo.scale-200.png differ diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WapProj/WinUI.Desktop.CppWinRT.WapProj.vstemplate b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WapProj/WinUI.Desktop.CppWinRT.WapProj.vstemplate similarity index 95% rename from dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WapProj/WinUI.Desktop.CppWinRT.WapProj.vstemplate rename to dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WapProj/WinUI.Desktop.CppWinRT.WapProj.vstemplate index 11144c5d9f..1e8db89c9d 100644 --- a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WapProj/WinUI.Desktop.CppWinRT.WapProj.vstemplate +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WapProj/WinUI.Desktop.CppWinRT.WapProj.vstemplate @@ -31,6 +31,7 @@ Square150x150Logo.scale-200.png Square44x44Logo.scale-200.png Square44x44Logo.targetsize-24_altform-unplated.png + Square44x44Logo.targetsize-48_altform-lightunplated.png StoreLogo.png Wide310x150Logo.scale-200.png diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WinUI.Desktop.CppWinRT.PackagedApp.csproj b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WinUI.Desktop.CppWinRT.PackagedApp.csproj similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WinUI.Desktop.CppWinRT.PackagedApp.csproj rename to dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WinUI.Desktop.CppWinRT.PackagedApp.csproj diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WinUI.Desktop.CppWinRT.PackagedApp.ico b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WinUI.Desktop.CppWinRT.PackagedApp.ico similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WinUI.Desktop.CppWinRT.PackagedApp.ico rename to dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WinUI.Desktop.CppWinRT.PackagedApp.ico diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WinUI.Desktop.CppWinRT.PackagedApp.png b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WinUI.Desktop.CppWinRT.PackagedApp.png similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WinUI.Desktop.CppWinRT.PackagedApp.png rename to dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WinUI.Desktop.CppWinRT.PackagedApp.png diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WinUI.Desktop.CppWinRT.PackagedApp.vstemplate b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WinUI.Desktop.CppWinRT.PackagedApp.vstemplate similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WinUI.Desktop.CppWinRT.PackagedApp.vstemplate rename to dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WinUI.Desktop.CppWinRT.PackagedApp.vstemplate diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/App.cpp b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/App.cpp similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/App.cpp rename to dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/App.cpp diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/App.h b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/App.h similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/App.h rename to dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/App.h diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/App.xaml b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/App.xaml new file mode 100644 index 0000000000..65073698c1 --- /dev/null +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/App.xaml @@ -0,0 +1,16 @@ + + + + + + + + + + + + diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/Assets/LockScreenLogo.scale-200.png b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/Assets/LockScreenLogo.scale-200.png new file mode 100644 index 0000000000..33f889e106 Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/Assets/LockScreenLogo.scale-200.png differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/Assets/SplashScreen.scale-200.png b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/Assets/SplashScreen.scale-200.png new file mode 100644 index 0000000000..802c79d6d7 Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/Assets/SplashScreen.scale-200.png differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/Assets/Square150x150Logo.scale-200.png b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/Assets/Square150x150Logo.scale-200.png new file mode 100644 index 0000000000..ddba42adbb Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/Assets/Square150x150Logo.scale-200.png differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/Assets/Square44x44Logo.scale-200.png b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/Assets/Square44x44Logo.scale-200.png new file mode 100644 index 0000000000..9327dd748e Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/Assets/Square44x44Logo.scale-200.png differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/Assets/Square44x44Logo.targetsize-24_altform-unplated.png b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/Assets/Square44x44Logo.targetsize-24_altform-unplated.png new file mode 100644 index 0000000000..e51416a8e4 Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/Assets/Square44x44Logo.targetsize-24_altform-unplated.png differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/Assets/Square44x44Logo.targetsize-48_altform-lightunplated.png b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/Assets/Square44x44Logo.targetsize-48_altform-lightunplated.png new file mode 100644 index 0000000000..bf063eb4d6 Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/Assets/Square44x44Logo.targetsize-48_altform-lightunplated.png differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/Assets/StoreLogo.png b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/Assets/StoreLogo.png new file mode 100644 index 0000000000..be865f0c37 Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/Assets/StoreLogo.png differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/Assets/Wide310x150Logo.scale-200.png b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/Assets/Wide310x150Logo.scale-200.png new file mode 100644 index 0000000000..314d297f20 Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/Assets/Wide310x150Logo.scale-200.png differ diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/MainWindow.cpp b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/MainWindow.cpp similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/MainWindow.cpp rename to dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/MainWindow.cpp diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/MainWindow.h b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/MainWindow.h similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/MainWindow.h rename to dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/MainWindow.h diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/MainWindow.idl b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/MainWindow.idl similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/MainWindow.idl rename to dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/MainWindow.idl diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/MainWindow.xaml b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/MainWindow.xaml similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/MainWindow.xaml rename to dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/MainWindow.xaml diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/Package-native.appxmanifest b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/Package-native.appxmanifest new file mode 100644 index 0000000000..980d0b475c --- /dev/null +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/Package-native.appxmanifest @@ -0,0 +1,53 @@ + + + + + + + + + + $projectname$ + $XmlEscapedPublisher$ + Assets\StoreLogo.png + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/ProjectTemplate.vcxproj b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/ProjectTemplate.vcxproj similarity index 98% rename from dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/ProjectTemplate.vcxproj rename to dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/ProjectTemplate.vcxproj index 4e5ed00a7d..295fe353b4 100644 --- a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/ProjectTemplate.vcxproj +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/ProjectTemplate.vcxproj @@ -149,6 +149,7 @@ + diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/ProjectTemplate.vcxproj.filters b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/ProjectTemplate.vcxproj.filters similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/ProjectTemplate.vcxproj.filters rename to dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/ProjectTemplate.vcxproj.filters diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/WinUI.Desktop.CppWinRT.SingleProjectPackagedApp.csproj b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/WinUI.Desktop.CppWinRT.SingleProjectPackagedApp.csproj similarity index 98% rename from dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/WinUI.Desktop.CppWinRT.SingleProjectPackagedApp.csproj rename to dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/WinUI.Desktop.CppWinRT.SingleProjectPackagedApp.csproj index 49a8b9786f..ead9f40aeb 100644 --- a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/WinUI.Desktop.CppWinRT.SingleProjectPackagedApp.csproj +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/WinUI.Desktop.CppWinRT.SingleProjectPackagedApp.csproj @@ -59,6 +59,7 @@ + diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/WinUI.Desktop.CppWinRT.SingleProjectPackagedApp.ico b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/WinUI.Desktop.CppWinRT.SingleProjectPackagedApp.ico similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/WinUI.Desktop.CppWinRT.SingleProjectPackagedApp.ico rename to dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/WinUI.Desktop.CppWinRT.SingleProjectPackagedApp.ico diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/WinUI.Desktop.CppWinRT.SingleProjectPackagedApp.png b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/WinUI.Desktop.CppWinRT.SingleProjectPackagedApp.png similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/WinUI.Desktop.CppWinRT.SingleProjectPackagedApp.png rename to dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/WinUI.Desktop.CppWinRT.SingleProjectPackagedApp.png diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/WinUI.Desktop.CppWinRT.SingleProjectPackagedApp.vstemplate b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/WinUI.Desktop.CppWinRT.SingleProjectPackagedApp.vstemplate similarity index 96% rename from dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/WinUI.Desktop.CppWinRT.SingleProjectPackagedApp.vstemplate rename to dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/WinUI.Desktop.CppWinRT.SingleProjectPackagedApp.vstemplate index d7d3d37f24..3f5e070d2d 100644 --- a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/WinUI.Desktop.CppWinRT.SingleProjectPackagedApp.vstemplate +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/WinUI.Desktop.CppWinRT.SingleProjectPackagedApp.vstemplate @@ -42,6 +42,7 @@ Square150x150Logo.scale-200.png Square44x44Logo.scale-200.png Square44x44Logo.targetsize-24_altform-unplated.png + Square44x44Logo.targetsize-48_altform-lightunplated.png StoreLogo.png Wide310x150Logo.scale-200.png diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/app.manifest b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/app.manifest new file mode 100644 index 0000000000..0f7e64319f --- /dev/null +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/app.manifest @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + PerMonitorV2 + + + \ No newline at end of file diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/pch.cpp b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/pch.cpp similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/pch.cpp rename to dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/pch.cpp diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/pch.h b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/pch.h similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/pch.h rename to dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/pch.h diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/readme.txt b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/readme.txt similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/readme.txt rename to dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/readme.txt diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/App.cpp b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/App.cpp similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/App.cpp rename to dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/App.cpp diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/App.h b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/App.h similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/App.h rename to dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/App.h diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/App.xaml b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/App.xaml new file mode 100644 index 0000000000..65073698c1 --- /dev/null +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/App.xaml @@ -0,0 +1,16 @@ + + + + + + + + + + + + diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/Assets/LockScreenLogo.scale-200.png b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/Assets/LockScreenLogo.scale-200.png new file mode 100644 index 0000000000..33f889e106 Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/Assets/LockScreenLogo.scale-200.png differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/Assets/SplashScreen.scale-200.png b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/Assets/SplashScreen.scale-200.png new file mode 100644 index 0000000000..802c79d6d7 Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/Assets/SplashScreen.scale-200.png differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/Assets/Square150x150Logo.scale-200.png b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/Assets/Square150x150Logo.scale-200.png new file mode 100644 index 0000000000..ddba42adbb Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/Assets/Square150x150Logo.scale-200.png differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/Assets/Square44x44Logo.scale-200.png b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/Assets/Square44x44Logo.scale-200.png new file mode 100644 index 0000000000..9327dd748e Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/Assets/Square44x44Logo.scale-200.png differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/Assets/Square44x44Logo.targetsize-24_altform-unplated.png b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/Assets/Square44x44Logo.targetsize-24_altform-unplated.png new file mode 100644 index 0000000000..e51416a8e4 Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/Assets/Square44x44Logo.targetsize-24_altform-unplated.png differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/Assets/Square44x44Logo.targetsize-48_altform-lightunplated.png b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/Assets/Square44x44Logo.targetsize-48_altform-lightunplated.png new file mode 100644 index 0000000000..bf063eb4d6 Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/Assets/Square44x44Logo.targetsize-48_altform-lightunplated.png differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/Assets/StoreLogo.png b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/Assets/StoreLogo.png new file mode 100644 index 0000000000..be865f0c37 Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/Assets/StoreLogo.png differ diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/Assets/Wide310x150Logo.scale-200.png b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/Assets/Wide310x150Logo.scale-200.png new file mode 100644 index 0000000000..314d297f20 Binary files /dev/null and b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/Assets/Wide310x150Logo.scale-200.png differ diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/MainWindow.cpp b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/MainWindow.cpp similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/MainWindow.cpp rename to dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/MainWindow.cpp diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/MainWindow.h b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/MainWindow.h similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/MainWindow.h rename to dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/MainWindow.h diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/MainWindow.idl b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/MainWindow.idl similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/MainWindow.idl rename to dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/MainWindow.idl diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/MainWindow.xaml b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/MainWindow.xaml similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/MainWindow.xaml rename to dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/MainWindow.xaml diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/Package-native.appxmanifest b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/Package-native.appxmanifest similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/Package-native.appxmanifest rename to dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/Package-native.appxmanifest diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/ProjectTemplate.vcxproj b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/ProjectTemplate.vcxproj similarity index 98% rename from dev/VSIX/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/ProjectTemplate.vcxproj rename to dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/ProjectTemplate.vcxproj index 7f76e991c0..cd40c42c27 100644 --- a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/ProjectTemplate.vcxproj +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/ProjectTemplate.vcxproj @@ -166,6 +166,7 @@ + diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/ProjectTemplate.vcxproj.filters b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/ProjectTemplate.vcxproj.filters similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/ProjectTemplate.vcxproj.filters rename to dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/ProjectTemplate.vcxproj.filters diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/UnitTests.cpp b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/UnitTests.cpp similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/UnitTests.cpp rename to dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/UnitTests.cpp diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/WinUI.Desktop.CppWinRT.UnitTestApp.csproj b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/WinUI.Desktop.CppWinRT.UnitTestApp.csproj similarity index 98% rename from dev/VSIX/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/WinUI.Desktop.CppWinRT.UnitTestApp.csproj rename to dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/WinUI.Desktop.CppWinRT.UnitTestApp.csproj index c420157e2c..65c7a9ae5a 100644 --- a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/WinUI.Desktop.CppWinRT.UnitTestApp.csproj +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/WinUI.Desktop.CppWinRT.UnitTestApp.csproj @@ -59,6 +59,7 @@ + diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/WinUI.Desktop.CppWinRT.UnitTestApp.ico b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/WinUI.Desktop.CppWinRT.UnitTestApp.ico similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/WinUI.Desktop.CppWinRT.UnitTestApp.ico rename to dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/WinUI.Desktop.CppWinRT.UnitTestApp.ico diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/WinUI.Desktop.CppWinRT.UnitTestApp.png b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/WinUI.Desktop.CppWinRT.UnitTestApp.png similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/WinUI.Desktop.CppWinRT.UnitTestApp.png rename to dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/WinUI.Desktop.CppWinRT.UnitTestApp.png diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/WinUI.Desktop.CppWinRT.UnitTestApp.vstemplate b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/WinUI.Desktop.CppWinRT.UnitTestApp.vstemplate similarity index 96% rename from dev/VSIX/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/WinUI.Desktop.CppWinRT.UnitTestApp.vstemplate rename to dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/WinUI.Desktop.CppWinRT.UnitTestApp.vstemplate index f42e989a57..ff0b1c10bf 100644 --- a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/WinUI.Desktop.CppWinRT.UnitTestApp.vstemplate +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/WinUI.Desktop.CppWinRT.UnitTestApp.vstemplate @@ -44,6 +44,7 @@ Square150x150Logo.scale-200.png Square44x44Logo.scale-200.png Square44x44Logo.targetsize-24_altform-unplated.png + Square44x44Logo.targetsize-48_altform-lightunplated.png StoreLogo.png Wide310x150Logo.scale-200.png diff --git a/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/app.manifest b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/app.manifest new file mode 100644 index 0000000000..0f7e64319f --- /dev/null +++ b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/app.manifest @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + PerMonitorV2 + + + \ No newline at end of file diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/pch.cpp b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/pch.cpp similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/pch.cpp rename to dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/pch.cpp diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/pch.h b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/pch.h similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/pch.h rename to dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/pch.h diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/readme.txt b/dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/readme.txt similarity index 100% rename from dev/VSIX/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/readme.txt rename to dev/Templates/Source/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/readme.txt diff --git a/dev/VSIX/ProjectTemplates/Neutral/CppWinRT/RuntimeComponent/Class.cpp b/dev/Templates/Source/ProjectTemplates/Neutral/CppWinRT/RuntimeComponent/Class.cpp similarity index 100% rename from dev/VSIX/ProjectTemplates/Neutral/CppWinRT/RuntimeComponent/Class.cpp rename to dev/Templates/Source/ProjectTemplates/Neutral/CppWinRT/RuntimeComponent/Class.cpp diff --git a/dev/VSIX/ProjectTemplates/Neutral/CppWinRT/RuntimeComponent/Class.h b/dev/Templates/Source/ProjectTemplates/Neutral/CppWinRT/RuntimeComponent/Class.h similarity index 100% rename from dev/VSIX/ProjectTemplates/Neutral/CppWinRT/RuntimeComponent/Class.h rename to dev/Templates/Source/ProjectTemplates/Neutral/CppWinRT/RuntimeComponent/Class.h diff --git a/dev/VSIX/ProjectTemplates/Neutral/CppWinRT/RuntimeComponent/Class.idl b/dev/Templates/Source/ProjectTemplates/Neutral/CppWinRT/RuntimeComponent/Class.idl similarity index 100% rename from dev/VSIX/ProjectTemplates/Neutral/CppWinRT/RuntimeComponent/Class.idl rename to dev/Templates/Source/ProjectTemplates/Neutral/CppWinRT/RuntimeComponent/Class.idl diff --git a/dev/VSIX/ProjectTemplates/Neutral/CppWinRT/RuntimeComponent/ProjectTemplate.vcxproj b/dev/Templates/Source/ProjectTemplates/Neutral/CppWinRT/RuntimeComponent/ProjectTemplate.vcxproj similarity index 100% rename from dev/VSIX/ProjectTemplates/Neutral/CppWinRT/RuntimeComponent/ProjectTemplate.vcxproj rename to dev/Templates/Source/ProjectTemplates/Neutral/CppWinRT/RuntimeComponent/ProjectTemplate.vcxproj diff --git a/dev/VSIX/ProjectTemplates/Neutral/CppWinRT/RuntimeComponent/ProjectTemplate.vcxproj.filters b/dev/Templates/Source/ProjectTemplates/Neutral/CppWinRT/RuntimeComponent/ProjectTemplate.vcxproj.filters similarity index 100% rename from dev/VSIX/ProjectTemplates/Neutral/CppWinRT/RuntimeComponent/ProjectTemplate.vcxproj.filters rename to dev/Templates/Source/ProjectTemplates/Neutral/CppWinRT/RuntimeComponent/ProjectTemplate.vcxproj.filters diff --git a/dev/VSIX/ProjectTemplates/Neutral/CppWinRT/RuntimeComponent/RuntimeComponent.def b/dev/Templates/Source/ProjectTemplates/Neutral/CppWinRT/RuntimeComponent/RuntimeComponent.def similarity index 100% rename from dev/VSIX/ProjectTemplates/Neutral/CppWinRT/RuntimeComponent/RuntimeComponent.def rename to dev/Templates/Source/ProjectTemplates/Neutral/CppWinRT/RuntimeComponent/RuntimeComponent.def diff --git a/dev/VSIX/ProjectTemplates/Neutral/CppWinRT/RuntimeComponent/WinUI.Neutral.CppWinRT.RuntimeComponent.csproj b/dev/Templates/Source/ProjectTemplates/Neutral/CppWinRT/RuntimeComponent/WinUI.Neutral.CppWinRT.RuntimeComponent.csproj similarity index 100% rename from dev/VSIX/ProjectTemplates/Neutral/CppWinRT/RuntimeComponent/WinUI.Neutral.CppWinRT.RuntimeComponent.csproj rename to dev/Templates/Source/ProjectTemplates/Neutral/CppWinRT/RuntimeComponent/WinUI.Neutral.CppWinRT.RuntimeComponent.csproj diff --git a/dev/VSIX/ProjectTemplates/Neutral/CppWinRT/RuntimeComponent/WinUI.Neutral.CppWinRT.RuntimeComponent.ico b/dev/Templates/Source/ProjectTemplates/Neutral/CppWinRT/RuntimeComponent/WinUI.Neutral.CppWinRT.RuntimeComponent.ico similarity index 100% rename from dev/VSIX/ProjectTemplates/Neutral/CppWinRT/RuntimeComponent/WinUI.Neutral.CppWinRT.RuntimeComponent.ico rename to dev/Templates/Source/ProjectTemplates/Neutral/CppWinRT/RuntimeComponent/WinUI.Neutral.CppWinRT.RuntimeComponent.ico diff --git a/dev/VSIX/ProjectTemplates/Neutral/CppWinRT/RuntimeComponent/WinUI.Neutral.CppWinRT.RuntimeComponent.png b/dev/Templates/Source/ProjectTemplates/Neutral/CppWinRT/RuntimeComponent/WinUI.Neutral.CppWinRT.RuntimeComponent.png similarity index 100% rename from dev/VSIX/ProjectTemplates/Neutral/CppWinRT/RuntimeComponent/WinUI.Neutral.CppWinRT.RuntimeComponent.png rename to dev/Templates/Source/ProjectTemplates/Neutral/CppWinRT/RuntimeComponent/WinUI.Neutral.CppWinRT.RuntimeComponent.png diff --git a/dev/VSIX/ProjectTemplates/Neutral/CppWinRT/RuntimeComponent/WinUI.Neutral.CppWinRT.RuntimeComponent.vstemplate b/dev/Templates/Source/ProjectTemplates/Neutral/CppWinRT/RuntimeComponent/WinUI.Neutral.CppWinRT.RuntimeComponent.vstemplate similarity index 100% rename from dev/VSIX/ProjectTemplates/Neutral/CppWinRT/RuntimeComponent/WinUI.Neutral.CppWinRT.RuntimeComponent.vstemplate rename to dev/Templates/Source/ProjectTemplates/Neutral/CppWinRT/RuntimeComponent/WinUI.Neutral.CppWinRT.RuntimeComponent.vstemplate diff --git a/dev/VSIX/ProjectTemplates/Neutral/CppWinRT/RuntimeComponent/pch.cpp b/dev/Templates/Source/ProjectTemplates/Neutral/CppWinRT/RuntimeComponent/pch.cpp similarity index 100% rename from dev/VSIX/ProjectTemplates/Neutral/CppWinRT/RuntimeComponent/pch.cpp rename to dev/Templates/Source/ProjectTemplates/Neutral/CppWinRT/RuntimeComponent/pch.cpp diff --git a/dev/VSIX/ProjectTemplates/Neutral/CppWinRT/RuntimeComponent/pch.h b/dev/Templates/Source/ProjectTemplates/Neutral/CppWinRT/RuntimeComponent/pch.h similarity index 100% rename from dev/VSIX/ProjectTemplates/Neutral/CppWinRT/RuntimeComponent/pch.h rename to dev/Templates/Source/ProjectTemplates/Neutral/CppWinRT/RuntimeComponent/pch.h diff --git a/dev/VSIX/ProjectTemplates/Neutral/CppWinRT/RuntimeComponent/readme.txt b/dev/Templates/Source/ProjectTemplates/Neutral/CppWinRT/RuntimeComponent/readme.txt similarity index 100% rename from dev/VSIX/ProjectTemplates/Neutral/CppWinRT/RuntimeComponent/readme.txt rename to dev/Templates/Source/ProjectTemplates/Neutral/CppWinRT/RuntimeComponent/readme.txt diff --git a/dev/VSIX/Directory.Build.props b/dev/Templates/VSIX/Directory.Build.props similarity index 53% rename from dev/VSIX/Directory.Build.props rename to dev/Templates/VSIX/Directory.Build.props index fd28148549..7979540dcb 100644 --- a/dev/VSIX/Directory.Build.props +++ b/dev/Templates/VSIX/Directory.Build.props @@ -1,34 +1,22 @@ - + + - - 2.0.230706.1 - 10.0.26100.4654 - 1.0.220914.1 - - 1.0.0-preview1 - Standalone false - - true - + - $(MSBuildThisFileDirectory)..\..\ $(MSBuildThisFileDirectory) $(VSIXRootDir)Extension\ - $(VSIXRootDir)ItemTemplates\ - $(VSIXRootDir)ProjectTemplates\ Debug AnyCPU - false 17.0 $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) true @@ -36,7 +24,23 @@ $(MSBuildThisFileDirectory) $(SolutionDir)BuildOutput\ $(BuildOutput)obj\$(Platform)$(Configuration)\$(Deployment)\ - $(BuildOutputRoot)$(MSBuildProjectName)\ + + + + + <_VsixProjectFolderAlias>$(MSBuildProjectName) + <_VsixProjectFolderAlias Condition="'$(MSBuildProjectName)' == 'WindowsAppSDK.Cpp.Extension.Dev17'">Cpp17 + <_VsixProjectFolderAlias Condition="'$(MSBuildProjectName)' == 'WindowsAppSDK.Cs.Extension.Dev17'">Cs17 + + $(BuildOutputRoot)$(_VsixProjectFolderAlias)\ $(BaseIntermediateOutputPath) $(IntermediateOutputPath) $(OutputPath) diff --git a/dev/VSIX/Extension/Cpp/Common/VSPackage.Designer.cs b/dev/Templates/VSIX/Extension/Cpp/Common/VSPackage.Designer.cs similarity index 100% rename from dev/VSIX/Extension/Cpp/Common/VSPackage.Designer.cs rename to dev/Templates/VSIX/Extension/Cpp/Common/VSPackage.Designer.cs diff --git a/dev/VSIX/Extension/Cpp/Common/VSPackage.resx b/dev/Templates/VSIX/Extension/Cpp/Common/VSPackage.resx similarity index 100% rename from dev/VSIX/Extension/Cpp/Common/VSPackage.resx rename to dev/Templates/VSIX/Extension/Cpp/Common/VSPackage.resx diff --git a/dev/VSIX/Extension/Cpp/Common/cs-CZ/VSPackage.cs-CZ.resx b/dev/Templates/VSIX/Extension/Cpp/Common/cs-CZ/VSPackage.cs-CZ.resx similarity index 100% rename from dev/VSIX/Extension/Cpp/Common/cs-CZ/VSPackage.cs-CZ.resx rename to dev/Templates/VSIX/Extension/Cpp/Common/cs-CZ/VSPackage.cs-CZ.resx diff --git a/dev/VSIX/Extension/Cpp/Common/de-DE/VSPackage.de-DE.resx b/dev/Templates/VSIX/Extension/Cpp/Common/de-DE/VSPackage.de-DE.resx similarity index 100% rename from dev/VSIX/Extension/Cpp/Common/de-DE/VSPackage.de-DE.resx rename to dev/Templates/VSIX/Extension/Cpp/Common/de-DE/VSPackage.de-DE.resx diff --git a/dev/VSIX/Extension/Cpp/Common/en-US/VSPackage.en-US.resx b/dev/Templates/VSIX/Extension/Cpp/Common/en-US/VSPackage.en-US.resx similarity index 100% rename from dev/VSIX/Extension/Cpp/Common/en-US/VSPackage.en-US.resx rename to dev/Templates/VSIX/Extension/Cpp/Common/en-US/VSPackage.en-US.resx diff --git a/dev/VSIX/Extension/Cpp/Common/es-ES/VSPackage.es-ES.resx b/dev/Templates/VSIX/Extension/Cpp/Common/es-ES/VSPackage.es-ES.resx similarity index 100% rename from dev/VSIX/Extension/Cpp/Common/es-ES/VSPackage.es-ES.resx rename to dev/Templates/VSIX/Extension/Cpp/Common/es-ES/VSPackage.es-ES.resx diff --git a/dev/VSIX/Extension/Cpp/Common/fr-FR/VSPackage.fr-FR.resx b/dev/Templates/VSIX/Extension/Cpp/Common/fr-FR/VSPackage.fr-FR.resx similarity index 100% rename from dev/VSIX/Extension/Cpp/Common/fr-FR/VSPackage.fr-FR.resx rename to dev/Templates/VSIX/Extension/Cpp/Common/fr-FR/VSPackage.fr-FR.resx diff --git a/dev/VSIX/Extension/Cpp/Common/it-IT/VSPackage.it-IT.resx b/dev/Templates/VSIX/Extension/Cpp/Common/it-IT/VSPackage.it-IT.resx similarity index 100% rename from dev/VSIX/Extension/Cpp/Common/it-IT/VSPackage.it-IT.resx rename to dev/Templates/VSIX/Extension/Cpp/Common/it-IT/VSPackage.it-IT.resx diff --git a/dev/VSIX/Extension/Cpp/Common/ja-JP/VSPackage.ja-JP.resx b/dev/Templates/VSIX/Extension/Cpp/Common/ja-JP/VSPackage.ja-JP.resx similarity index 100% rename from dev/VSIX/Extension/Cpp/Common/ja-JP/VSPackage.ja-JP.resx rename to dev/Templates/VSIX/Extension/Cpp/Common/ja-JP/VSPackage.ja-JP.resx diff --git a/dev/VSIX/Extension/Cpp/Common/ko-KR/VSPackage.ko-KR.resx b/dev/Templates/VSIX/Extension/Cpp/Common/ko-KR/VSPackage.ko-KR.resx similarity index 100% rename from dev/VSIX/Extension/Cpp/Common/ko-KR/VSPackage.ko-KR.resx rename to dev/Templates/VSIX/Extension/Cpp/Common/ko-KR/VSPackage.ko-KR.resx diff --git a/dev/VSIX/Extension/Cpp/Common/pl-PL/VSPackage.pl-PL.resx b/dev/Templates/VSIX/Extension/Cpp/Common/pl-PL/VSPackage.pl-PL.resx similarity index 100% rename from dev/VSIX/Extension/Cpp/Common/pl-PL/VSPackage.pl-PL.resx rename to dev/Templates/VSIX/Extension/Cpp/Common/pl-PL/VSPackage.pl-PL.resx diff --git a/dev/VSIX/Extension/Cpp/Common/pt-BR/VSPackage.pt-BR.resx b/dev/Templates/VSIX/Extension/Cpp/Common/pt-BR/VSPackage.pt-BR.resx similarity index 100% rename from dev/VSIX/Extension/Cpp/Common/pt-BR/VSPackage.pt-BR.resx rename to dev/Templates/VSIX/Extension/Cpp/Common/pt-BR/VSPackage.pt-BR.resx diff --git a/dev/VSIX/Extension/Cpp/Common/ru-RU/VSPackage.ru-RU.resx b/dev/Templates/VSIX/Extension/Cpp/Common/ru-RU/VSPackage.ru-RU.resx similarity index 100% rename from dev/VSIX/Extension/Cpp/Common/ru-RU/VSPackage.ru-RU.resx rename to dev/Templates/VSIX/Extension/Cpp/Common/ru-RU/VSPackage.ru-RU.resx diff --git a/dev/VSIX/Extension/Cpp/Common/tr-TR/VSPackage.tr-TR.resx b/dev/Templates/VSIX/Extension/Cpp/Common/tr-TR/VSPackage.tr-TR.resx similarity index 100% rename from dev/VSIX/Extension/Cpp/Common/tr-TR/VSPackage.tr-TR.resx rename to dev/Templates/VSIX/Extension/Cpp/Common/tr-TR/VSPackage.tr-TR.resx diff --git a/dev/VSIX/Extension/Cpp/Common/zh-CN/VSPackage.zh-CN.resx b/dev/Templates/VSIX/Extension/Cpp/Common/zh-CN/VSPackage.zh-CN.resx similarity index 100% rename from dev/VSIX/Extension/Cpp/Common/zh-CN/VSPackage.zh-CN.resx rename to dev/Templates/VSIX/Extension/Cpp/Common/zh-CN/VSPackage.zh-CN.resx diff --git a/dev/VSIX/Extension/Cpp/Common/zh-TW/VSPackage.zh-TW.resx b/dev/Templates/VSIX/Extension/Cpp/Common/zh-TW/VSPackage.zh-TW.resx similarity index 100% rename from dev/VSIX/Extension/Cpp/Common/zh-TW/VSPackage.zh-TW.resx rename to dev/Templates/VSIX/Extension/Cpp/Common/zh-TW/VSPackage.zh-TW.resx diff --git a/dev/VSIX/Extension/Cpp/Dev17/Component/source.extension.vsixmanifest b/dev/Templates/VSIX/Extension/Cpp/Dev17/Component/source.extension.vsixmanifest similarity index 100% rename from dev/VSIX/Extension/Cpp/Dev17/Component/source.extension.vsixmanifest rename to dev/Templates/VSIX/Extension/Cpp/Dev17/Component/source.extension.vsixmanifest diff --git a/dev/VSIX/Extension/Cpp/Dev17/ExtensionPack.vsext b/dev/Templates/VSIX/Extension/Cpp/Dev17/ExtensionPack.vsext similarity index 100% rename from dev/VSIX/Extension/Cpp/Dev17/ExtensionPack.vsext rename to dev/Templates/VSIX/Extension/Cpp/Dev17/ExtensionPack.vsext diff --git a/dev/Templates/VSIX/Extension/Cpp/Dev17/LocalDev/source.extension.vsixmanifest b/dev/Templates/VSIX/Extension/Cpp/Dev17/LocalDev/source.extension.vsixmanifest new file mode 100644 index 0000000000..49c4398a9c --- /dev/null +++ b/dev/Templates/VSIX/Extension/Cpp/Dev17/LocalDev/source.extension.vsixmanifest @@ -0,0 +1,66 @@ + + + + + + Windows App SDK C++ VS Templates (LocalDev) + [LocalDev build] The Microsoft Windows App SDK Visual Studio extension adds C++ project and item templates to support building Windows apps and components in VS 2022-2026. This is a per-user dev-loop build that shadows any workload-shipped copy on the same machine. + https://github.com/microsoft/WindowsAppSDK/ + LICENSE + https://github.com/microsoft/WindowsAppSDK/ + https://github.com/microsoft/WindowsAppSDK/releases + WindowsAppSDK.png + WindowsAppSDK.png + WindowsAppSDK, WinAppSDK, WinUI, XAML, C++, C++/WinRT + + + + amd64 + + + amd64 + + + amd64 + + + arm64 + + + arm64 + + + arm64 + + + + + + + + + NuGet Package Manager + http://docs.microsoft.com/nuget/ + + + + + + + + + + + + + + + diff --git a/dev/VSIX/Extension/Cpp/Dev17/NuGetPackageList.cs b/dev/Templates/VSIX/Extension/Cpp/Dev17/NuGetPackageList.cs similarity index 100% rename from dev/VSIX/Extension/Cpp/Dev17/NuGetPackageList.cs rename to dev/Templates/VSIX/Extension/Cpp/Dev17/NuGetPackageList.cs diff --git a/dev/VSIX/Extension/Cpp/Dev17/Standalone/source.extension.vsixmanifest b/dev/Templates/VSIX/Extension/Cpp/Dev17/Standalone/source.extension.vsixmanifest similarity index 100% rename from dev/VSIX/Extension/Cpp/Dev17/Standalone/source.extension.vsixmanifest rename to dev/Templates/VSIX/Extension/Cpp/Dev17/Standalone/source.extension.vsixmanifest diff --git a/dev/VSIX/Extension/Cpp/Dev17/VSPackage.cs b/dev/Templates/VSIX/Extension/Cpp/Dev17/VSPackage.cs similarity index 100% rename from dev/VSIX/Extension/Cpp/Dev17/VSPackage.cs rename to dev/Templates/VSIX/Extension/Cpp/Dev17/VSPackage.cs diff --git a/dev/VSIX/Extension/Cpp/Dev17/WindowsAppSDK.Cpp.Extension.Dev17.csproj b/dev/Templates/VSIX/Extension/Cpp/Dev17/WindowsAppSDK.Cpp.Extension.Dev17.csproj similarity index 100% rename from dev/VSIX/Extension/Cpp/Dev17/WindowsAppSDK.Cpp.Extension.Dev17.csproj rename to dev/Templates/VSIX/Extension/Cpp/Dev17/WindowsAppSDK.Cpp.Extension.Dev17.csproj diff --git a/dev/VSIX/Extension/Cs/Common/VSPackage.Designer.cs b/dev/Templates/VSIX/Extension/Cs/Common/VSPackage.Designer.cs similarity index 89% rename from dev/VSIX/Extension/Cs/Common/VSPackage.Designer.cs rename to dev/Templates/VSIX/Extension/Cs/Common/VSPackage.Designer.cs index 1167253e0d..545d4e3a50 100644 --- a/dev/VSIX/Extension/Cs/Common/VSPackage.Designer.cs +++ b/dev/Templates/VSIX/Extension/Cs/Common/VSPackage.Designer.cs @@ -467,5 +467,59 @@ internal static string _1054 { return ResourceManager.GetString("1054", resourceCulture); } } + + /// + /// Looks up a localized string similar to WinUI TabView App. + /// + internal static string _1055 { + get { + return ResourceManager.GetString("1055", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [Experimental] WinUI TabView App. + /// + internal static string _1056 { + get { + return ResourceManager.GetString("1056", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A project template for creating a WinUI app with a TabView control for tabbed navigation.. + /// + internal static string _1057 { + get { + return ResourceManager.GetString("1057", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to WinUI Navigation App. + /// + internal static string _1059 { + get { + return ResourceManager.GetString("1059", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to [Experimental] WinUI Navigation App. + /// + internal static string _1060 { + get { + return ResourceManager.GetString("1060", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to A project template for creating a WinUI app with a NavigationView control for page navigation.. + /// + internal static string _1061 { + get { + return ResourceManager.GetString("1061", resourceCulture); + } + } } } diff --git a/dev/VSIX/Extension/Cs/Common/VSPackage.resx b/dev/Templates/VSIX/Extension/Cs/Common/VSPackage.resx similarity index 90% rename from dev/VSIX/Extension/Cs/Common/VSPackage.resx rename to dev/Templates/VSIX/Extension/Cs/Common/VSPackage.resx index 7ceb082481..9fa8cce5f3 100644 --- a/dev/VSIX/Extension/Cs/Common/VSPackage.resx +++ b/dev/Templates/VSIX/Extension/Cs/Common/VSPackage.resx @@ -252,4 +252,31 @@ No output information available. + + WinUI TabView App + + + [Experimental] WinUI TabView App + + + A project template for creating a WinUI app with a TabView control for tabbed navigation. + + + WinUI Navigation App + + + [Experimental] WinUI Navigation App + + + A project template for creating a WinUI app with a NavigationView control for page navigation. + + + WinUI MVVM App + + + [Experimental] WinUI MVVM App + + + A project template for creating a WinUI app structured with the MVVM pattern using the CommunityToolkit.Mvvm package. + \ No newline at end of file diff --git a/dev/VSIX/Extension/Cs/Common/cs-CZ/VSPackage.cs-CZ.resx b/dev/Templates/VSIX/Extension/Cs/Common/cs-CZ/VSPackage.cs-CZ.resx similarity index 100% rename from dev/VSIX/Extension/Cs/Common/cs-CZ/VSPackage.cs-CZ.resx rename to dev/Templates/VSIX/Extension/Cs/Common/cs-CZ/VSPackage.cs-CZ.resx diff --git a/dev/VSIX/Extension/Cs/Common/de-DE/VSPackage.de-DE.resx b/dev/Templates/VSIX/Extension/Cs/Common/de-DE/VSPackage.de-DE.resx similarity index 100% rename from dev/VSIX/Extension/Cs/Common/de-DE/VSPackage.de-DE.resx rename to dev/Templates/VSIX/Extension/Cs/Common/de-DE/VSPackage.de-DE.resx diff --git a/dev/VSIX/Extension/Cs/Common/en-US/VSPackage.en-US.resx b/dev/Templates/VSIX/Extension/Cs/Common/en-US/VSPackage.en-US.resx similarity index 100% rename from dev/VSIX/Extension/Cs/Common/en-US/VSPackage.en-US.resx rename to dev/Templates/VSIX/Extension/Cs/Common/en-US/VSPackage.en-US.resx diff --git a/dev/VSIX/Extension/Cs/Common/es-ES/VSPackage.es-ES.resx b/dev/Templates/VSIX/Extension/Cs/Common/es-ES/VSPackage.es-ES.resx similarity index 100% rename from dev/VSIX/Extension/Cs/Common/es-ES/VSPackage.es-ES.resx rename to dev/Templates/VSIX/Extension/Cs/Common/es-ES/VSPackage.es-ES.resx diff --git a/dev/VSIX/Extension/Cs/Common/fr-FR/VSPackage.fr-FR.resx b/dev/Templates/VSIX/Extension/Cs/Common/fr-FR/VSPackage.fr-FR.resx similarity index 100% rename from dev/VSIX/Extension/Cs/Common/fr-FR/VSPackage.fr-FR.resx rename to dev/Templates/VSIX/Extension/Cs/Common/fr-FR/VSPackage.fr-FR.resx diff --git a/dev/VSIX/Extension/Cs/Common/it-IT/VSPackage.it-IT.resx b/dev/Templates/VSIX/Extension/Cs/Common/it-IT/VSPackage.it-IT.resx similarity index 100% rename from dev/VSIX/Extension/Cs/Common/it-IT/VSPackage.it-IT.resx rename to dev/Templates/VSIX/Extension/Cs/Common/it-IT/VSPackage.it-IT.resx diff --git a/dev/VSIX/Extension/Cs/Common/ja-JP/VSPackage.ja-JP.resx b/dev/Templates/VSIX/Extension/Cs/Common/ja-JP/VSPackage.ja-JP.resx similarity index 100% rename from dev/VSIX/Extension/Cs/Common/ja-JP/VSPackage.ja-JP.resx rename to dev/Templates/VSIX/Extension/Cs/Common/ja-JP/VSPackage.ja-JP.resx diff --git a/dev/VSIX/Extension/Cs/Common/ko-KR/VSPackage.ko-KR.resx b/dev/Templates/VSIX/Extension/Cs/Common/ko-KR/VSPackage.ko-KR.resx similarity index 100% rename from dev/VSIX/Extension/Cs/Common/ko-KR/VSPackage.ko-KR.resx rename to dev/Templates/VSIX/Extension/Cs/Common/ko-KR/VSPackage.ko-KR.resx diff --git a/dev/VSIX/Extension/Cs/Common/pl-PL/VSPackage.pl-PL.resx b/dev/Templates/VSIX/Extension/Cs/Common/pl-PL/VSPackage.pl-PL.resx similarity index 100% rename from dev/VSIX/Extension/Cs/Common/pl-PL/VSPackage.pl-PL.resx rename to dev/Templates/VSIX/Extension/Cs/Common/pl-PL/VSPackage.pl-PL.resx diff --git a/dev/VSIX/Extension/Cs/Common/pt-BR/VSPackage.pt-BR.resx b/dev/Templates/VSIX/Extension/Cs/Common/pt-BR/VSPackage.pt-BR.resx similarity index 100% rename from dev/VSIX/Extension/Cs/Common/pt-BR/VSPackage.pt-BR.resx rename to dev/Templates/VSIX/Extension/Cs/Common/pt-BR/VSPackage.pt-BR.resx diff --git a/dev/VSIX/Extension/Cs/Common/ru-RU/VSPackage.ru-RU.resx b/dev/Templates/VSIX/Extension/Cs/Common/ru-RU/VSPackage.ru-RU.resx similarity index 100% rename from dev/VSIX/Extension/Cs/Common/ru-RU/VSPackage.ru-RU.resx rename to dev/Templates/VSIX/Extension/Cs/Common/ru-RU/VSPackage.ru-RU.resx diff --git a/dev/VSIX/Extension/Cs/Common/tr-TR/VSPackage.tr-TR.resx b/dev/Templates/VSIX/Extension/Cs/Common/tr-TR/VSPackage.tr-TR.resx similarity index 100% rename from dev/VSIX/Extension/Cs/Common/tr-TR/VSPackage.tr-TR.resx rename to dev/Templates/VSIX/Extension/Cs/Common/tr-TR/VSPackage.tr-TR.resx diff --git a/dev/VSIX/Extension/Cs/Common/zh-CN/VSPackage.zh-CN.resx b/dev/Templates/VSIX/Extension/Cs/Common/zh-CN/VSPackage.zh-CN.resx similarity index 100% rename from dev/VSIX/Extension/Cs/Common/zh-CN/VSPackage.zh-CN.resx rename to dev/Templates/VSIX/Extension/Cs/Common/zh-CN/VSPackage.zh-CN.resx diff --git a/dev/VSIX/Extension/Cs/Common/zh-TW/VSPackage.zh-TW.resx b/dev/Templates/VSIX/Extension/Cs/Common/zh-TW/VSPackage.zh-TW.resx similarity index 100% rename from dev/VSIX/Extension/Cs/Common/zh-TW/VSPackage.zh-TW.resx rename to dev/Templates/VSIX/Extension/Cs/Common/zh-TW/VSPackage.zh-TW.resx diff --git a/dev/VSIX/Extension/Cs/Dev17/Component/source.extension.vsixmanifest b/dev/Templates/VSIX/Extension/Cs/Dev17/Component/source.extension.vsixmanifest similarity index 77% rename from dev/VSIX/Extension/Cs/Dev17/Component/source.extension.vsixmanifest rename to dev/Templates/VSIX/Extension/Cs/Dev17/Component/source.extension.vsixmanifest index 1fb52bfa2e..1749810bc6 100644 --- a/dev/VSIX/Extension/Cs/Dev17/Component/source.extension.vsixmanifest +++ b/dev/Templates/VSIX/Extension/Cs/Dev17/Component/source.extension.vsixmanifest @@ -52,8 +52,14 @@ - + + + + + + + \ No newline at end of file diff --git a/dev/VSIX/Extension/Cs/Dev17/ExtensionPack.vsext b/dev/Templates/VSIX/Extension/Cs/Dev17/ExtensionPack.vsext similarity index 100% rename from dev/VSIX/Extension/Cs/Dev17/ExtensionPack.vsext rename to dev/Templates/VSIX/Extension/Cs/Dev17/ExtensionPack.vsext diff --git a/dev/Templates/VSIX/Extension/Cs/Dev17/LocalDev/source.extension.vsixmanifest b/dev/Templates/VSIX/Extension/Cs/Dev17/LocalDev/source.extension.vsixmanifest new file mode 100644 index 0000000000..ad1d752118 --- /dev/null +++ b/dev/Templates/VSIX/Extension/Cs/Dev17/LocalDev/source.extension.vsixmanifest @@ -0,0 +1,109 @@ + + + + + + Windows App SDK C# VS Templates (LocalDev) + [LocalDev build] The Microsoft Windows App SDK Visual Studio extension adds C# project and item templates to support building Windows apps and components in VS 2022-2026. This is a per-user dev-loop build that shadows any workload-shipped copy on the same machine. + https://github.com/microsoft/WindowsAppSDK/ + LICENSE + https://github.com/microsoft/WindowsAppSDK/ + https://github.com/microsoft/WindowsAppSDK/releases + WindowsAppSDK.png + WindowsAppSDK.png + WindowsAppSDK, WinAppSDK, WinUI, XAML, C#, Managed + + + + amd64 + + + amd64 + + + amd64 + + + arm64 + + + arm64 + + + arm64 + + + + + + + + + + + NuGet Package Manager + http://docs.microsoft.com/nuget/ + + + + + + + + + + + + + + + + + + + + + diff --git a/dev/VSIX/Extension/Cs/Dev17/Standalone/source.extension.vsixmanifest b/dev/Templates/VSIX/Extension/Cs/Dev17/Standalone/source.extension.vsixmanifest similarity index 78% rename from dev/VSIX/Extension/Cs/Dev17/Standalone/source.extension.vsixmanifest rename to dev/Templates/VSIX/Extension/Cs/Dev17/Standalone/source.extension.vsixmanifest index bcda1fcae6..9b706ee653 100644 --- a/dev/VSIX/Extension/Cs/Dev17/Standalone/source.extension.vsixmanifest +++ b/dev/Templates/VSIX/Extension/Cs/Dev17/Standalone/source.extension.vsixmanifest @@ -52,8 +52,14 @@ - + + + + + + + diff --git a/dev/VSIX/Extension/Cs/Dev17/VSPackage.cs b/dev/Templates/VSIX/Extension/Cs/Dev17/VSPackage.cs similarity index 100% rename from dev/VSIX/Extension/Cs/Dev17/VSPackage.cs rename to dev/Templates/VSIX/Extension/Cs/Dev17/VSPackage.cs diff --git a/dev/VSIX/Extension/Cs/Dev17/WindowsAppSDK.Cs.Extension.Dev17.csproj b/dev/Templates/VSIX/Extension/Cs/Dev17/WindowsAppSDK.Cs.Extension.Dev17.csproj similarity index 67% rename from dev/VSIX/Extension/Cs/Dev17/WindowsAppSDK.Cs.Extension.Dev17.csproj rename to dev/Templates/VSIX/Extension/Cs/Dev17/WindowsAppSDK.Cs.Extension.Dev17.csproj index 39348a4bd3..149c56638a 100644 --- a/dev/VSIX/Extension/Cs/Dev17/WindowsAppSDK.Cs.Extension.Dev17.csproj +++ b/dev/Templates/VSIX/Extension/Cs/Dev17/WindowsAppSDK.Cs.Extension.Dev17.csproj @@ -1,5 +1,7 @@  + + 2.0 {82b43b9b-a64c-4715-b499-d71e9ca2bd60};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} @@ -27,8 +29,8 @@ true {B0F1BA01-DE66-4EF9-9C8B-DBB99FB4DA4B} - - net8.0 + + net10.0 @@ -86,74 +88,27 @@ + - - {9DE11F03-73A8-4DCA-88B3-1623A718DFD1} - WinUI.Desktop.Cs.BlankWindow - ItemTemplates - false - TemplateProjectOutputGroup%3b - - - {C8DA9E71-2F7F-4E7C-8DC7-766FF0F67196} - WinUI.Neutral.Cs.ResourceDictionary - ItemTemplates - false - TemplateProjectOutputGroup%3b - - - {17320A27-C039-4973-95AA-ACB3EFA1D47E} - WinUI.Neutral.Cs.Resw - ItemTemplates - false - TemplateProjectOutputGroup%3b - - - {F19716E6-41A1-4320-A819-288172CE161C} - WinUI.Neutral.Cs.UserControl - ItemTemplates - false - TemplateProjectOutputGroup%3b - - - {2d9bd73d-5a5e-4113-aea9-53d059a79a41} - WinUI.Neutral.Cs.BlankPage - ItemTemplates - false - TemplateProjectOutputGroup%3b - - - {2C5873D8-E908-41F2-B861-80F95280FBCA} - WinUI.Neutral.Cs.TemplatedControl - ItemTemplates - false - TemplateProjectOutputGroup%3b - - - {33783A04-0CB4-4CE5-A9FE-82E2E7E06D1F} - WinUI.Desktop.Cs.ClassLibrary + + %(BaseName) ProjectTemplates false TemplateProjectOutputGroup%3b - - {938DD23E-270E-488B-AC4C-CA68A545A8F2} - WinUI.Desktop.Cs.PackagedApp - ProjectTemplates - false - TemplateProjectOutputGroup%3b - - - {D9C038B7-6A62-4945-A030-4AC7597F53CA} - WinUI.Desktop.Cs.SingleProjectPackagedApp - ProjectTemplates - false - TemplateProjectOutputGroup%3b - - - {45777B9F-9CC1-47D7-BD66-C3C194277902} - WinUI.Desktop.Cs.UnitTestApp - ProjectTemplates + + + %(BaseName) + ItemTemplates false TemplateProjectOutputGroup%3b diff --git a/dev/VSIX/Extension/Directory.Build.targets b/dev/Templates/VSIX/Extension/Directory.Build.targets similarity index 100% rename from dev/VSIX/Extension/Directory.Build.targets rename to dev/Templates/VSIX/Extension/Directory.Build.targets diff --git a/dev/VSIX/Extension/LICENSE b/dev/Templates/VSIX/Extension/LICENSE similarity index 100% rename from dev/VSIX/Extension/LICENSE rename to dev/Templates/VSIX/Extension/LICENSE diff --git a/dev/VSIX/Extension/WindowsAppSDK.png b/dev/Templates/VSIX/Extension/WindowsAppSDK.png similarity index 100% rename from dev/VSIX/Extension/WindowsAppSDK.png rename to dev/Templates/VSIX/Extension/WindowsAppSDK.png diff --git a/dev/VSIX/Shared/OutputWindowHelper.cs b/dev/Templates/VSIX/Shared/OutputWindowHelper.cs similarity index 97% rename from dev/VSIX/Shared/OutputWindowHelper.cs rename to dev/Templates/VSIX/Shared/OutputWindowHelper.cs index 631469130d..517da9f35b 100644 --- a/dev/VSIX/Shared/OutputWindowHelper.cs +++ b/dev/Templates/VSIX/Shared/OutputWindowHelper.cs @@ -7,7 +7,7 @@ // Although the strings are the same in the wizard for both extensions, // they are included with both their respective VSPackages. -// Strings for both extensions can be found in {PathToWindowsAppSDK}\dev\VSIX\Extension\Cs\Common\VSPackage.resx +// Strings for both extensions can be found in {PathToWindowsAppSDK}\dev\Templates\VSIX\Extension\Cs\Common\VSPackage.resx // Wizard strings are numbers 1044 and above. #if CSHARP_EXTENSION using Resources = WindowsAppSDK.Cs.Extension.Dev17.VSPackage; diff --git a/dev/VSIX/Shared/WizardImplementation.cs b/dev/Templates/VSIX/Shared/WizardImplementation.cs similarity index 99% rename from dev/VSIX/Shared/WizardImplementation.cs rename to dev/Templates/VSIX/Shared/WizardImplementation.cs index 58f11c0d46..9efc116f77 100644 --- a/dev/VSIX/Shared/WizardImplementation.cs +++ b/dev/Templates/VSIX/Shared/WizardImplementation.cs @@ -18,7 +18,7 @@ // Although the strings are the same in the wizard for both extensions, // they are included with both their respective VSPackages. -// Strings for both extensions can be found in {PathToWindowsAppSDK}\dev\VSIX\Extension\Cs\Common\VSPackage.resx +// Strings for both extensions can be found in {PathToWindowsAppSDK}\dev\Templates\VSIX\Extension\Cs\Common\VSPackage.resx // Wizard strings are numbers 1044 and above. #if CSHARP_EXTENSION using Resources = WindowsAppSDK.Cs.Extension.Dev17.VSPackage; diff --git a/dev/VSIX/Shared/WizardInfoBarEvents.cs b/dev/Templates/VSIX/Shared/WizardInfoBarEvents.cs similarity index 100% rename from dev/VSIX/Shared/WizardInfoBarEvents.cs rename to dev/Templates/VSIX/Shared/WizardInfoBarEvents.cs diff --git a/dev/VSIX/WindowsAppSDK.Extension.sln b/dev/Templates/VSIX/WindowsAppSDK.Extension.sln similarity index 69% rename from dev/VSIX/WindowsAppSDK.Extension.sln rename to dev/Templates/VSIX/WindowsAppSDK.Extension.sln index d74763eb35..4b5f35d0ea 100644 --- a/dev/VSIX/WindowsAppSDK.Extension.sln +++ b/dev/Templates/VSIX/WindowsAppSDK.Extension.sln @@ -1,11 +1,13 @@ - + Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 17 VisualStudioVersion = 17.0.31619.372 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinUI.Neutral.Cs.BlankPage", "ItemTemplates\Neutral\CSharp\BlankPage\WinUI.Neutral.Cs.BlankPage.csproj", "{2D9BD73D-5A5E-4113-AEA9-53D059A79A41}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinUI.Neutral.Cs.BlankPage", "..\Source\ItemTemplates\Neutral\CSharp\BlankPage\WinUI.Neutral.Cs.BlankPage.csproj", "{2D9BD73D-5A5E-4113-AEA9-53D059A79A41}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinUI.Neutral.Cs.UserControl", "ItemTemplates\Neutral\CSharp\UserControl\WinUI.Neutral.Cs.UserControl.csproj", "{F19716E6-41A1-4320-A819-288172CE161C}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinUI.Neutral.Cs.UserControl", "..\Source\ItemTemplates\Neutral\CSharp\UserControl\WinUI.Neutral.Cs.UserControl.csproj", "{F19716E6-41A1-4320-A819-288172CE161C}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinUI.Neutral.Cs.ContentDialog", "..\Source\ItemTemplates\Neutral\CSharp\ContentDialog\WinUI.Neutral.Cs.ContentDialog.csproj", "{E5209752-4CE6-413B-B3BE-61E33C106A5E}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ProjectTemplates", "ProjectTemplates", "{34272930-CFC7-4E33-9DB9-88E82AE2C046}" EndProject @@ -21,21 +23,21 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CppWinRT", "CppWinRT", "{CD EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CppWinRT", "CppWinRT", "{1F0ED7C6-3679-4288-9CEA-7B30437D3FA6}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinUI.Neutral.CppWinRT.BlankPage", "ItemTemplates\Neutral\CppWinRT\BlankPage\WinUI.Neutral.CppWinRT.BlankPage.csproj", "{1E071372-7CB7-47BC-9BA2-8235F9BB09C8}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinUI.Neutral.CppWinRT.BlankPage", "..\Source\ItemTemplates\Neutral\CppWinRT\BlankPage\WinUI.Neutral.CppWinRT.BlankPage.csproj", "{1E071372-7CB7-47BC-9BA2-8235F9BB09C8}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinUI.Neutral.CppWinRT.UserControl", "ItemTemplates\Neutral\CppWinRT\UserControl\WinUI.Neutral.CppWinRT.UserControl.csproj", "{99C19C7C-6472-44F6-89E2-389AB6534F42}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinUI.Neutral.CppWinRT.UserControl", "..\Source\ItemTemplates\Neutral\CppWinRT\UserControl\WinUI.Neutral.CppWinRT.UserControl.csproj", "{99C19C7C-6472-44F6-89E2-389AB6534F42}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinUI.Neutral.Cs.TemplatedControl", "ItemTemplates\Neutral\CSharp\TemplatedControl\WinUI.Neutral.Cs.TemplatedControl.csproj", "{2C5873D8-E908-41F2-B861-80F95280FBCA}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinUI.Neutral.Cs.TemplatedControl", "..\Source\ItemTemplates\Neutral\CSharp\TemplatedControl\WinUI.Neutral.Cs.TemplatedControl.csproj", "{2C5873D8-E908-41F2-B861-80F95280FBCA}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Desktop", "Desktop", "{F27A31A1-917C-4E75-B2A5-EEC55B287150}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CppWinRT", "CppWinRT", "{1A8A7481-2108-496B-802D-39F9C08D86F3}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinUI.Desktop.CppWinRT.BlankWindow", "ItemTemplates\Desktop\CppWinRT\BlankWindow\WinUI.Desktop.CppWinRT.BlankWindow.csproj", "{81221BE8-00A2-4841-B62C-9E751C298066}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinUI.Desktop.CppWinRT.BlankWindow", "..\Source\ItemTemplates\Desktop\CppWinRT\BlankWindow\WinUI.Desktop.CppWinRT.BlankWindow.csproj", "{81221BE8-00A2-4841-B62C-9E751C298066}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinUI.Neutral.CppWinRT.TemplatedControl", "ItemTemplates\Neutral\CppWinRT\TemplatedControl\WinUI.Neutral.CppWinRT.TemplatedControl.csproj", "{761212D7-B5D2-4629-98C8-88F6A24982BB}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinUI.Neutral.CppWinRT.TemplatedControl", "..\Source\ItemTemplates\Neutral\CppWinRT\TemplatedControl\WinUI.Neutral.CppWinRT.TemplatedControl.csproj", "{761212D7-B5D2-4629-98C8-88F6A24982BB}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinUI.Desktop.Cs.BlankWindow", "ItemTemplates\Desktop\CSharp\BlankWindow\WinUI.Desktop.Cs.BlankWindow.csproj", "{9DE11F03-73A8-4DCA-88B3-1623A718DFD1}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinUI.Desktop.Cs.BlankWindow", "..\Source\ItemTemplates\Desktop\CSharp\BlankWindow\WinUI.Desktop.Cs.BlankWindow.csproj", "{9DE11F03-73A8-4DCA-88B3-1623A718DFD1}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Desktop", "Desktop", "{E7C0B105-E6A4-43E4-AC0F-5D4F5CDDC395}" EndProject @@ -43,9 +45,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CppWinRT", "CppWinRT", "{9C EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CSharp", "CSharp", "{01EE62F3-3B99-43B0-9E99-29FA871D48E2}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinUI.Neutral.CppWinRT.ResourceDictionary", "ItemTemplates\Neutral\CppWinRT\ResourceDictionary\WinUI.Neutral.CppWinRT.ResourceDictionary.csproj", "{3F3F0E7F-594F-4006-A3EF-5E5624EF147C}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinUI.Neutral.CppWinRT.ResourceDictionary", "..\Source\ItemTemplates\Neutral\CppWinRT\ResourceDictionary\WinUI.Neutral.CppWinRT.ResourceDictionary.csproj", "{3F3F0E7F-594F-4006-A3EF-5E5624EF147C}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinUI.Neutral.Cs.ResourceDictionary", "ItemTemplates\Neutral\CSharp\ResourceDictionary\WinUI.Neutral.Cs.ResourceDictionary.csproj", "{C8DA9E71-2F7F-4E7C-8DC7-766FF0F67196}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinUI.Neutral.Cs.ResourceDictionary", "..\Source\ItemTemplates\Neutral\CSharp\ResourceDictionary\WinUI.Neutral.Cs.ResourceDictionary.csproj", "{C8DA9E71-2F7F-4E7C-8DC7-766FF0F67196}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{BCBB50CD-2C38-4B27-940B-1FEDD2C6DECE}" ProjectSection(SolutionItems) = preProject @@ -54,35 +56,45 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution update-package-versions.targets = update-package-versions.targets EndProjectSection EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinUI.Neutral.CppWinRT.Resw", "ItemTemplates\Neutral\CppWinRT\Resw\WinUI.Neutral.CppWinRT.Resw.csproj", "{30AB0000-148D-48BE-85DB-70D9F7BDFEC5}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinUI.Neutral.CppWinRT.Resw", "..\Source\ItemTemplates\Neutral\CppWinRT\Resw\WinUI.Neutral.CppWinRT.Resw.csproj", "{30AB0000-148D-48BE-85DB-70D9F7BDFEC5}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinUI.Neutral.Cs.Resw", "ItemTemplates\Neutral\CSharp\Resw\WinUI.Neutral.Cs.Resw.csproj", "{17320A27-C039-4973-95AA-ACB3EFA1D47E}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinUI.Neutral.Cs.Resw", "..\Source\ItemTemplates\Neutral\CSharp\Resw\WinUI.Neutral.Cs.Resw.csproj", "{17320A27-C039-4973-95AA-ACB3EFA1D47E}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CSharp", "CSharp", "{EC44EE95-8EC9-4EE5-A8A6-E6BE2F32C843}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinUI.Desktop.Cs.ClassLibrary", "ProjectTemplates\Desktop\CSharp\ClassLibrary\WinUI.Desktop.Cs.ClassLibrary.csproj", "{33783A04-0CB4-4CE5-A9FE-82E2E7E06D1F}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinUI.Desktop.Cs.ClassLibrary", "..\Source\ProjectTemplates\Desktop\CSharp\ClassLibrary\WinUI.Desktop.Cs.ClassLibrary.csproj", "{33783A04-0CB4-4CE5-A9FE-82E2E7E06D1F}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinUI.Desktop.Cs.PackagedApp", "ProjectTemplates\Desktop\CSharp\PackagedApp\WinUI.Desktop.Cs.PackagedApp.csproj", "{938DD23E-270E-488B-AC4C-CA68A545A8F2}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinUI.Desktop.Cs.PackagedApp", "..\Source\ProjectTemplates\Desktop\CSharp\PackagedApp\WinUI.Desktop.Cs.PackagedApp.csproj", "{938DD23E-270E-488B-AC4C-CA68A545A8F2}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinUI.Desktop.CppWinRT.PackagedApp", "ProjectTemplates\Desktop\CppWinRT\PackagedApp\WinUI.Desktop.CppWinRT.PackagedApp.csproj", "{80195619-D4CF-4287-BA59-08077486BE1C}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinUI.Desktop.CppWinRT.PackagedApp", "..\Source\ProjectTemplates\Desktop\CppWinRT\PackagedApp\WinUI.Desktop.CppWinRT.PackagedApp.csproj", "{80195619-D4CF-4287-BA59-08077486BE1C}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Neutral", "Neutral", "{50DEEF87-BC2F-4B45-B97D-B83135F12786}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "CppWinRT", "CppWinRT", "{4D266288-D49F-46D4-90E0-667E81D6A433}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinUI.Neutral.CppWinRT.RuntimeComponent", "ProjectTemplates\Neutral\CppWinRT\RuntimeComponent\WinUI.Neutral.CppWinRT.RuntimeComponent.csproj", "{FD33E535-127D-48AC-8788-0F61FA2A251C}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinUI.Neutral.CppWinRT.RuntimeComponent", "..\Source\ProjectTemplates\Neutral\CppWinRT\RuntimeComponent\WinUI.Neutral.CppWinRT.RuntimeComponent.csproj", "{FD33E535-127D-48AC-8788-0F61FA2A251C}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinUI.Desktop.Cs.SingleProjectPackagedApp", "ProjectTemplates\Desktop\CSharp\SingleProjectPackagedApp\WinUI.Desktop.Cs.SingleProjectPackagedApp.csproj", "{D9C038B7-6A62-4945-A030-4AC7597F53CA}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinUI.Desktop.Cs.SingleProjectPackagedApp", "..\Source\ProjectTemplates\Desktop\CSharp\SingleProjectPackagedApp\WinUI.Desktop.Cs.SingleProjectPackagedApp.csproj", "{D9C038B7-6A62-4945-A030-4AC7597F53CA}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinUI.Desktop.CppWinRT.SingleProjectPackagedApp", "ProjectTemplates\Desktop\CppWinRT\SingleProjectPackagedApp\WinUI.Desktop.CppWinRT.SingleProjectPackagedApp.csproj", "{E54D1AD4-E935-479D-8A69-FC073E4DB33D}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinUI.Desktop.CppWinRT.SingleProjectPackagedApp", "..\Source\ProjectTemplates\Desktop\CppWinRT\SingleProjectPackagedApp\WinUI.Desktop.CppWinRT.SingleProjectPackagedApp.csproj", "{E54D1AD4-E935-479D-8A69-FC073E4DB33D}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WindowsAppSDK.Cs.Extension.Dev17", "Extension\Cs\Dev17\WindowsAppSDK.Cs.Extension.Dev17.csproj", "{E700DF09-42A9-4AC7-9855-400029FBFDBE}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WindowsAppSDK.Cpp.Extension.Dev17", "Extension\Cpp\Dev17\WindowsAppSDK.Cpp.Extension.Dev17.csproj", "{85E88201-049C-4E42-AE85-DFEEFA7C533C}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinUI.Desktop.Cs.UnitTestApp", "ProjectTemplates\Desktop\CSharp\UnitTestApp\WinUI.Desktop.Cs.UnitTestApp.csproj", "{45777B9F-9CC1-47D7-BD66-C3C194277902}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinUI.Desktop.Cs.UnitTestApp", "..\Source\ProjectTemplates\Desktop\CSharp\UnitTestApp\WinUI.Desktop.Cs.UnitTestApp.csproj", "{45777B9F-9CC1-47D7-BD66-C3C194277902}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinUI.Desktop.CppWinRT.UnitTestApp", "..\Source\ProjectTemplates\Desktop\CppWinRT\UnitTestApp\WinUI.Desktop.CppWinRT.UnitTestApp.csproj", "{DFA6B905-57A3-4B31-A74B-25BA2243389F}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinUI.Desktop.Cs.TabViewApp", "..\Source\ProjectTemplates\Desktop\CSharp\TabViewApp\WinUI.Desktop.Cs.TabViewApp.csproj", "{A1B2C3D4-1111-4A5B-9C8D-1E2F3A4B5C6D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinUI.Desktop.Cs.NavigationApp", "..\Source\ProjectTemplates\Desktop\CSharp\NavigationApp\WinUI.Desktop.Cs.NavigationApp.csproj", "{B2C3D4E5-2222-4B6C-AD9E-2F3A4B5C6D7E}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinUI.Desktop.Cs.MvvmApp", "..\Source\ProjectTemplates\Desktop\CSharp\MvvmApp\WinUI.Desktop.Cs.MvvmApp.csproj", "{C3D4E5F6-3333-4C7D-BE0F-3A4B5C6D7E8F}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DotnetNewTemplates", "DotnetNewTemplates", "{8EAF0E4D-B0E3-4A21-B0F6-EA69F0215F5A}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinUI.Desktop.CppWinRT.UnitTestApp", "ProjectTemplates\Desktop\CppWinRT\UnitTestApp\WinUI.Desktop.CppWinRT.UnitTestApp.csproj", "{DFA6B905-57A3-4B31-A74B-25BA2243389F}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WinAppSdk.CSharp.DotnetNewTemplates", "..\Dotnet\WinAppSdk.CSharp.DotnetNewTemplates.csproj", "{F9C3BC5E-2E45-4272-A4F1-0F63CFE9A2DE}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Shared", "Shared", "{96699B60-67B5-4186-9FEC-3963ED811FF0}" ProjectSection(SolutionItems) = preProject @@ -103,6 +115,10 @@ Global {F19716E6-41A1-4320-A819-288172CE161C}.Debug|Any CPU.Build.0 = Debug|Any CPU {F19716E6-41A1-4320-A819-288172CE161C}.Release|Any CPU.ActiveCfg = Release|Any CPU {F19716E6-41A1-4320-A819-288172CE161C}.Release|Any CPU.Build.0 = Release|Any CPU + {E5209752-4CE6-413B-B3BE-61E33C106A5E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E5209752-4CE6-413B-B3BE-61E33C106A5E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E5209752-4CE6-413B-B3BE-61E33C106A5E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E5209752-4CE6-413B-B3BE-61E33C106A5E}.Release|Any CPU.Build.0 = Release|Any CPU {1E071372-7CB7-47BC-9BA2-8235F9BB09C8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {1E071372-7CB7-47BC-9BA2-8235F9BB09C8}.Debug|Any CPU.Build.0 = Debug|Any CPU {1E071372-7CB7-47BC-9BA2-8235F9BB09C8}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -183,6 +199,22 @@ Global {DFA6B905-57A3-4B31-A74B-25BA2243389F}.Debug|Any CPU.Build.0 = Debug|Any CPU {DFA6B905-57A3-4B31-A74B-25BA2243389F}.Release|Any CPU.ActiveCfg = Release|Any CPU {DFA6B905-57A3-4B31-A74B-25BA2243389F}.Release|Any CPU.Build.0 = Release|Any CPU + {A1B2C3D4-1111-4A5B-9C8D-1E2F3A4B5C6D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A1B2C3D4-1111-4A5B-9C8D-1E2F3A4B5C6D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A1B2C3D4-1111-4A5B-9C8D-1E2F3A4B5C6D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A1B2C3D4-1111-4A5B-9C8D-1E2F3A4B5C6D}.Release|Any CPU.Build.0 = Release|Any CPU + {B2C3D4E5-2222-4B6C-AD9E-2F3A4B5C6D7E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B2C3D4E5-2222-4B6C-AD9E-2F3A4B5C6D7E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B2C3D4E5-2222-4B6C-AD9E-2F3A4B5C6D7E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B2C3D4E5-2222-4B6C-AD9E-2F3A4B5C6D7E}.Release|Any CPU.Build.0 = Release|Any CPU + {C3D4E5F6-3333-4C7D-BE0F-3A4B5C6D7E8F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C3D4E5F6-3333-4C7D-BE0F-3A4B5C6D7E8F}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C3D4E5F6-3333-4C7D-BE0F-3A4B5C6D7E8F}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C3D4E5F6-3333-4C7D-BE0F-3A4B5C6D7E8F}.Release|Any CPU.Build.0 = Release|Any CPU + {F9C3BC5E-2E45-4272-A4F1-0F63CFE9A2DE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {F9C3BC5E-2E45-4272-A4F1-0F63CFE9A2DE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {F9C3BC5E-2E45-4272-A4F1-0F63CFE9A2DE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {F9C3BC5E-2E45-4272-A4F1-0F63CFE9A2DE}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -190,6 +222,7 @@ Global GlobalSection(NestedProjects) = preSolution {2D9BD73D-5A5E-4113-AEA9-53D059A79A41} = {46667165-BDC3-4FC2-9BC3-E4B1AEB1E05B} {F19716E6-41A1-4320-A819-288172CE161C} = {46667165-BDC3-4FC2-9BC3-E4B1AEB1E05B} + {E5209752-4CE6-413B-B3BE-61E33C106A5E} = {46667165-BDC3-4FC2-9BC3-E4B1AEB1E05B} {CD06AC1A-5DAA-4161-8D57-92D27C4FD911} = {63F11D46-2E6A-4B6A-B57B-CB83FFCAB63F} {46667165-BDC3-4FC2-9BC3-E4B1AEB1E05B} = {CD06AC1A-5DAA-4161-8D57-92D27C4FD911} {1F0ED7C6-3679-4288-9CEA-7B30437D3FA6} = {CD06AC1A-5DAA-4161-8D57-92D27C4FD911} @@ -218,8 +251,13 @@ Global {D9C038B7-6A62-4945-A030-4AC7597F53CA} = {EC44EE95-8EC9-4EE5-A8A6-E6BE2F32C843} {E54D1AD4-E935-479D-8A69-FC073E4DB33D} = {1A8A7481-2108-496B-802D-39F9C08D86F3} {45777B9F-9CC1-47D7-BD66-C3C194277902} = {EC44EE95-8EC9-4EE5-A8A6-E6BE2F32C843} + {A1B2C3D4-1111-4A5B-9C8D-1E2F3A4B5C6D} = {EC44EE95-8EC9-4EE5-A8A6-E6BE2F32C843} + {B2C3D4E5-2222-4B6C-AD9E-2F3A4B5C6D7E} = {EC44EE95-8EC9-4EE5-A8A6-E6BE2F32C843} + {C3D4E5F6-3333-4C7D-BE0F-3A4B5C6D7E8F} = {EC44EE95-8EC9-4EE5-A8A6-E6BE2F32C843} {DFA6B905-57A3-4B31-A74B-25BA2243389F} = {1A8A7481-2108-496B-802D-39F9C08D86F3} {96699B60-67B5-4186-9FEC-3963ED811FF0} = {50DEEF87-BC2F-4B45-B97D-B83135F12786} + {8EAF0E4D-B0E3-4A21-B0F6-EA69F0215F5A} = {34272930-CFC7-4E33-9DB9-88E82AE2C046} + {F9C3BC5E-2E45-4272-A4F1-0F63CFE9A2DE} = {8EAF0E4D-B0E3-4A21-B0F6-EA69F0215F5A} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {A417E325-71BD-4C29-94F8-F21FB3F5C392} diff --git a/dev/VSIX/WindowsAppSDK.ico b/dev/Templates/VSIX/WindowsAppSDK.ico similarity index 100% rename from dev/VSIX/WindowsAppSDK.ico rename to dev/Templates/VSIX/WindowsAppSDK.ico diff --git a/dev/Templates/VSIX/build-local-VSIX-package/Build-VSIX-Local.ps1 b/dev/Templates/VSIX/build-local-VSIX-package/Build-VSIX-Local.ps1 new file mode 100644 index 0000000000..28e2639933 --- /dev/null +++ b/dev/Templates/VSIX/build-local-VSIX-package/Build-VSIX-Local.ps1 @@ -0,0 +1,519 @@ +<# +.SYNOPSIS + Builds the Windows App SDK VSIX extension packages locally. + +.DESCRIPTION + Reproduces the Azure Pipelines "CreateVsix" stage on a local machine. + Builds up to 4 VSIX files: + - WindowsAppSDK.Cs.Extension.Dev17.Standalone.vsix + - WindowsAppSDK.Cs.Extension.Dev17.Component.vsix + - WindowsAppSDK.Cpp.Extension.Dev17.Standalone.vsix + - WindowsAppSDK.Cpp.Extension.Dev17.Component.vsix + +.PARAMETER WindowsAppSDKVersion + The version of the Microsoft.WindowsAppSDK NuGet package to use. + Example: "1.8.260317003" + If not specified, defaults to the version in Directory.Build.props (1.0.0-preview1). + +.PARAMETER Configuration + Build configuration. Default: Release. + +.PARAMETER Deployment + Which deployment type(s) to build. Default: "LocalDev". + "LocalDev" - Per-user (AllUsers=false) VSIX with a distinct extension + Id (...Dev17.LocalDev). The ONLY flavor that is locally + installable on a developer machine - install with + .\Install-LocalDev-VSIX.ps1 (no admin required). + "Standalone" - Per-machine (AllUsers=true) VSIX. BUILD-ONLY locally; + not installable on a machine that already has the WinUI + workload (the workload owns the same extension Id and + blocks side-loading). Build this when you need an + artifact to ship / sign / publish. + "Component" - Per-machine VSIX flagged IsProductComponent. BUILD-ONLY + locally; consumed by the VS Installer build pipeline. + "Both" - Build Standalone + Component (no LocalDev). + +.PARAMETER EnableExperimentalVSIXFeatures + When set, marks the VSIX as experimental (adds .Experimental suffix, sets Preview=true). + +.PARAMETER OutputDir + Where to copy the final .vsix files. Default: .\publish\VSIX (relative to script dir). + +.PARAMETER NupkgSourceDir + Optional path to a directory containing pre-downloaded Microsoft.WindowsAppSDK*.nupkg. + This directory will be added as a NuGet package source. + +.PARAMETER RepoRoot + Path to the WindowsAppSDK repository root. Default: auto-detected relative to this script. + +.PARAMETER SkipRestore + Skip NuGet restore (useful if you've already restored). + +.EXAMPLE + .\Build-VSIX-Local.ps1 + # Build the LocalDev VSIX (default). Then install with .\Install-LocalDev-VSIX.ps1 + +.EXAMPLE + .\Build-VSIX-Local.ps1 -WindowsAppSDKVersion "1.8.260317003" -Deployment Standalone + # Build a Standalone VSIX artifact (build-only; not installable locally) + +.EXAMPLE + .\Build-VSIX-Local.ps1 -NupkgSourceDir "C:\packages" -Deployment Both + # Build the Standalone + Component artifacts (build-only) +#> + +[CmdletBinding()] +param( + [string]$WindowsAppSDKVersion = "", + + [ValidateSet("Debug", "Release")] + [string]$Configuration = "Release", + + [ValidateSet("Standalone", "Component", "LocalDev", "Both")] + [string]$Deployment = "LocalDev", + + [switch]$EnableExperimentalVSIXFeatures, + + [string]$OutputDir = "", + + [string]$NupkgSourceDir = "", + + [string]$RepoRoot = "", + + [string]$OptionalVSIXVersion = "", + + [switch]$SkipRestore +) + +Set-StrictMode -Version 2.0 +$ErrorActionPreference = "Stop" + +#region --- Helper Functions --- + +function Write-Banner { + param([string]$Message) + $line = "=" * 70 + Write-Host "" + Write-Host $line -ForegroundColor Cyan + Write-Host " $Message" -ForegroundColor Cyan + Write-Host $line -ForegroundColor Cyan + Write-Host "" +} + +function Write-Step { + param([string]$Message) + Write-Host "[*] $Message" -ForegroundColor Green +} + +function Write-Warn { + param([string]$Message) + Write-Host "[!] $Message" -ForegroundColor Yellow +} + +function Write-Err { + param([string]$Message) + Write-Host "[X] $Message" -ForegroundColor Red +} + +function Find-MSBuild { + $vswherePath = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" + if (-not (Test-Path $vswherePath)) { + Write-Err "vswhere.exe not found. Please install Visual Studio 2022 or later." + exit 1 + } + + $msbuildPath = & $vswherePath -latest -requires Microsoft.Component.MSBuild -find "MSBuild\**\Bin\MSBuild.exe" 2>$null | Select-Object -First 1 + if (-not $msbuildPath -or -not (Test-Path $msbuildPath)) { + Write-Err "MSBuild.exe not found. Please install Visual Studio 2022+ with the '.NET desktop development' workload." + exit 1 + } + + return $msbuildPath +} + +function Find-VSInstallPath { + $vswherePath = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" + $installPath = & $vswherePath -latest -property installationPath 2>$null + return $installPath +} + +function Extract-VersionFromNupkg { + param([string]$NupkgDir) + + $nupkgFiles = Get-ChildItem -Path $NupkgDir -Filter "Microsoft.WindowsAppSDK.*.nupkg" | + Where-Object { $_.Name -match "Microsoft\.WindowsAppSDK\.[0-9].*\.nupkg" } + + if ($nupkgFiles.Count -eq 0) { + Write-Err "No Microsoft.WindowsAppSDK*.nupkg files found in '$NupkgDir'." + exit 1 + } + + if ($nupkgFiles.Count -gt 1) { + Write-Err "Multiple Microsoft.WindowsAppSDK nupkg files found in '$NupkgDir'. Please keep only one." + foreach ($f in $nupkgFiles) { Write-Err " - $($f.Name)" } + exit 1 + } + + $nupkg = $nupkgFiles[0] + Write-Step "Found nupkg: $($nupkg.Name)" + + # Extract version from nuspec inside the nupkg + $tempExtract = Join-Path $env:TEMP "vsix-nupkg-extract-$(Get-Random)" + try { + $zipCopy = Join-Path $env:TEMP "$($nupkg.BaseName).zip" + Copy-Item $nupkg.FullName $zipCopy -Force + Expand-Archive -Path $zipCopy -DestinationPath $tempExtract -Force + Remove-Item $zipCopy -Force + + $nuspecFiles = Get-ChildItem -Path $tempExtract -Recurse -Filter "*.nuspec" + foreach ($nuspecFile in $nuspecFiles) { + [xml]$nuspec = Get-Content -Path $nuspecFile.FullName + if ($nuspec.package.metadata.id -eq "Microsoft.WindowsAppSDK") { + $version = $nuspec.package.metadata.version + Write-Step "Extracted version from nuspec: $version" + return $version + } + } + Write-Err "Could not find Microsoft.WindowsAppSDK nuspec in the nupkg." + exit 1 + } + finally { + if (Test-Path $tempExtract) { Remove-Item $tempExtract -Recurse -Force -ErrorAction SilentlyContinue } + } +} + +#endregion + +#region --- Setup --- + +Write-Banner "Windows App SDK VSIX Local Build" + +$scriptDir = $PSScriptRoot +if (-not $scriptDir) { $scriptDir = (Get-Location).Path } + +# Resolve repo root +if ($RepoRoot -eq "") { + $RepoRoot = Join-Path $scriptDir "..\..\..\..\" +} +$RepoRoot = (Resolve-Path $RepoRoot -ErrorAction SilentlyContinue).Path +if (-not $RepoRoot -or -not (Test-Path $RepoRoot)) { + Write-Err "WindowsAppSDK repo root not found. Use -RepoRoot to specify." + exit 1 +} +Write-Step "Repo root: $RepoRoot" + +# Resolve paths +$vsixDir = Join-Path $RepoRoot "dev\Templates\VSIX" +$solutionFile = Join-Path $vsixDir "WindowsAppSDK.Extension.sln" + +if (-not (Test-Path $solutionFile)) { + Write-Err "Solution file not found: $solutionFile" + exit 1 +} +Write-Step "Solution: $solutionFile" + +# Resolve output directory +if ($OutputDir -eq "") { + $OutputDir = Join-Path $scriptDir "publish\VSIX" +} +if (-not (Test-Path $OutputDir)) { + New-Item -ItemType Directory -Path $OutputDir -Force | Out-Null +} +$OutputDir = (Resolve-Path $OutputDir).Path +Write-Step "Output dir: $OutputDir" + +#endregion + +#region --- Prerequisites --- + +Write-Banner "Checking Prerequisites" + +# 1. Find MSBuild +$msbuild = Find-MSBuild +Write-Step "MSBuild: $msbuild" + +# 2. Check VS installation +$vsPath = Find-VSInstallPath +if ($vsPath) { + Write-Step "Visual Studio: $vsPath" +} else { + Write-Warn "Could not detect VS installation path." +} + +# 3. Check VSSDK targets +$vssdkTargets = Join-Path $vsPath "MSBuild\Microsoft\VisualStudio\v17.0\VSSDK\Microsoft.VsSDK.targets" +if (-not (Test-Path $vssdkTargets)) { + # Try generic version path + $vssdkSearch = Get-ChildItem -Path (Join-Path $vsPath "MSBuild") -Recurse -Filter "Microsoft.VsSDK.targets" -ErrorAction SilentlyContinue | Select-Object -First 1 + if ($vssdkSearch) { + Write-Step "VSSDK targets: $($vssdkSearch.FullName)" + } else { + Write-Warn "Microsoft.VsSDK.targets not found. Install the 'Visual Studio extension development' workload." + Write-Warn "The build may still succeed if VSSDK is restored via NuGet (Microsoft.VSSDK.BuildTools)." + } +} else { + Write-Step "VSSDK targets: $vssdkTargets" +} + +# 4. Check .NET SDK +$dotnetPath = Get-Command dotnet -ErrorAction SilentlyContinue +if ($dotnetPath) { + $sdkVersions = & dotnet --list-sdks 2>$null + $hasNet8 = $sdkVersions | Where-Object { $_ -match "^8\." } + if ($hasNet8) { + Write-Step ".NET 8 SDK: found" + } else { + Write-Warn ".NET 8 SDK not found. The DotnetNewTemplates project requires it." + Write-Warn "Install from https://dotnet.microsoft.com/download/dotnet/8.0" + } +} else { + Write-Warn "dotnet CLI not found. The DotnetNewTemplates project may fail to build." +} + +#endregion + +#region --- Version Resolution --- + +Write-Banner "Resolving Package Version" + +if ($NupkgSourceDir -ne "" -and $WindowsAppSDKVersion -eq "") { + $NupkgSourceDir = (Resolve-Path $NupkgSourceDir).Path + Write-Step "Extracting version from nupkg in: $NupkgSourceDir" + $WindowsAppSDKVersion = Extract-VersionFromNupkg -NupkgDir $NupkgSourceDir +} + +if ($WindowsAppSDKVersion -eq "") { + Write-Warn "No -WindowsAppSDKVersion specified and no -NupkgSourceDir provided." + Write-Warn "Falling back to the default in Directory.Build.props (1.0.0-preview1)." + Write-Warn "This version likely does not exist on nuget.org." + Write-Warn "Specify -WindowsAppSDKVersion to use a real version (e.g., '1.8.260317003')." + $WindowsAppSDKVersion = "" +} + +if ($WindowsAppSDKVersion -ne "") { + Write-Step "WindowsAppSDKVersion = $WindowsAppSDKVersion" +} + +if ($OptionalVSIXVersion -eq "") { + # ...0 -- year-as-Major outranks any official 1.x/2.x, + # monotonic across years. PR# segment is always 0 locally. + $now = Get-Date + $OptionalVSIXVersion = "$($now.Year).$($now.ToString('MMdd')).$($now.ToString('HHmm')).0" + Write-Step "OptionalVSIXVersion = $OptionalVSIXVersion (auto-generated)" +} else { + Write-Step "OptionalVSIXVersion = $OptionalVSIXVersion (user-specified)" +} + +#endregion + +#region --- NuGet Config --- + +Write-Banner "Configuring NuGet Sources" + +$nugetConfig = Join-Path $scriptDir "vsix-nuget.config" +if (-not (Test-Path $nugetConfig)) { + Write-Err "vsix-nuget.config not found at: $nugetConfig" + Write-Err "This file should be alongside Build-VSIX-Local.ps1." + exit 1 +} + +# If a local nupkg source is provided, create a temp config with that source added +$effectiveNugetConfig = $nugetConfig +if ($NupkgSourceDir -ne "") { + $tempConfig = Join-Path $env:TEMP "vsix-nuget-temp-$(Get-Random).config" + [xml]$configXml = Get-Content $nugetConfig + $newSource = $configXml.CreateElement("add") + $newSource.SetAttribute("key", "LocalNupkg") + $newSource.SetAttribute("value", $NupkgSourceDir) + $configXml.configuration.packageSources.AppendChild($newSource) | Out-Null + $configXml.Save($tempConfig) + $effectiveNugetConfig = $tempConfig + Write-Step "Added local nupkg source: $NupkgSourceDir" +} + +Write-Step "NuGet config: $effectiveNugetConfig" + +# Use a short build output path to avoid MAX_PATH issues with the VSSDK. +# The VSSDK extracts template ZIPs into deeply nested paths; if the repo +# is in a deep directory the combined path can exceed 260 characters. +$shortBuildOutput = "C:\tmp\vsixbo\" +if (-not (Test-Path $shortBuildOutput)) { + New-Item -ItemType Directory -Path $shortBuildOutput -Force | Out-Null +} +Write-Step "Build output (short path): $shortBuildOutput" + +#endregion + +#region --- Build Functions --- + +function Invoke-MSBuildRestore { + param( + [string]$DeploymentType + ) + + Write-Step "Restoring ($DeploymentType)..." + + $args = @( + $solutionFile + "/t:restore" + "/p:Configuration=$Configuration" + "/p:Platform=Any CPU" + "/p:Deployment=$DeploymentType" + "/p:RestoreConfigFile=$effectiveNugetConfig" + "/p:EnableExperimentalVSIXFeatures=$($EnableExperimentalVSIXFeatures.IsPresent.ToString().ToLower())" + "/p:BuildOutput=$shortBuildOutput" + "/verbosity:minimal" + "/nologo" + ) + + if ($WindowsAppSDKVersion -ne "") { + $args += "/p:WindowsAppSDKVersion=$WindowsAppSDKVersion" + } + + if ($NupkgSourceDir -ne "") { + $args += "/p:RestoreAdditionalProjectSources=$NupkgSourceDir" + } + + if ($OptionalVSIXVersion -ne "") { + $args += "/p:OptionalVSIXVersion=$OptionalVSIXVersion" + } + + Write-Host " > MSBuild $($args -join ' ')" -ForegroundColor DarkGray + & $msbuild @args + if ($LASTEXITCODE -ne 0) { + Write-Err "NuGet restore failed for $DeploymentType deployment." + exit $LASTEXITCODE + } +} + +function Invoke-MSBuildBuild { + param( + [string]$DeploymentType + ) + + Write-Step "Building ($DeploymentType)..." + + $args = @( + $solutionFile + "/p:Configuration=$Configuration" + "/p:Platform=Any CPU" + "/p:Deployment=$DeploymentType" + "/p:EnableExperimentalVSIXFeatures=$($EnableExperimentalVSIXFeatures.IsPresent.ToString().ToLower())" + "/p:BuildOutput=$shortBuildOutput" + "/verbosity:minimal" + "/nologo" + ) + + if ($WindowsAppSDKVersion -ne "") { + $args += "/p:WindowsAppSDKVersion=$WindowsAppSDKVersion" + } + + if ($OptionalVSIXVersion -ne "") { + $args += "/p:OptionalVSIXVersion=$OptionalVSIXVersion" + } + + Write-Host " > MSBuild $($args -join ' ')" -ForegroundColor DarkGray + & $msbuild @args + if ($LASTEXITCODE -ne 0) { + Write-Err "Build failed for $DeploymentType deployment." + exit $LASTEXITCODE + } +} + +function Copy-VsixOutput { + param( + [string]$DeploymentType + ) + + # Search both the short build output and the default BuildOutput location + $searchPaths = @($shortBuildOutput) + $defaultBuildOutput = Join-Path $vsixDir "BuildOutput" + if (Test-Path $defaultBuildOutput) { $searchPaths += $defaultBuildOutput } + + $vsixFiles = @() + foreach ($searchPath in $searchPaths) { + $found = Get-ChildItem -Path $searchPath -Recurse -Filter "WindowsAppSDK.*.$DeploymentType.vsix" -ErrorAction SilentlyContinue + $vsixFiles += $found + } + + if ($vsixFiles.Count -eq 0) { + Write-Warn "No VSIX files found for $DeploymentType deployment." + return + } + + # Deduplicate by filename (same VSIX may appear in multiple locations) + $seen = @{} + foreach ($vsix in $vsixFiles) { + if (-not $seen.ContainsKey($vsix.Name)) { + $seen[$vsix.Name] = $vsix + # Rename to include version: WindowsAppSDK.Cs.Extension.Dev17.Component.vsix + # -> WindowsAppSDK.Cs.Extension.Dev17.Component.99.2026.0416.1640.vsix + $newName = $vsix.BaseName + ".$OptionalVSIXVersion.vsix" + $dest = Join-Path $OutputDir $newName + Copy-Item $vsix.FullName $dest -Force + Write-Step " -> $dest" + } + } +} + +#endregion + +#region --- Execute Build --- + +$deployments = @() +if ($Deployment -eq "Both") { + $deployments = @("Standalone", "Component") +} else { + $deployments = @($Deployment) +} + +foreach ($deploy in $deployments) { + Write-Banner "Building VSIX - $deploy" + + if (-not $SkipRestore) { + Invoke-MSBuildRestore -DeploymentType $deploy + } + Invoke-MSBuildBuild -DeploymentType $deploy + + Write-Step "Copying $deploy VSIX output..." + Copy-VsixOutput -DeploymentType $deploy +} + +#endregion + +#region --- Cleanup --- + +if ($NupkgSourceDir -ne "" -and $effectiveNugetConfig -ne $nugetConfig) { + Remove-Item $effectiveNugetConfig -Force -ErrorAction SilentlyContinue +} + +#endregion + +#region --- Summary --- + +Write-Banner "Build Complete" + +$outputVsix = Get-ChildItem -Path $OutputDir -Filter "*.vsix" -ErrorAction SilentlyContinue +if ($outputVsix.Count -gt 0) { + Write-Step "VSIX files produced:" + foreach ($v in $outputVsix) { + $sizeMB = [math]::Round($v.Length / 1MB, 2) + Write-Host " $($v.Name) ($sizeMB MB)" -ForegroundColor White + } +} else { + Write-Warn "No .vsix files found in $OutputDir." + Write-Warn "Check the build output above for errors." +} + +Write-Host "" +if ($Deployment -eq "LocalDev") { + Write-Step "Next step: install per-user with no admin required:" + Write-Host " .\Install-LocalDev-VSIX.ps1" -ForegroundColor White + Write-Host "" +} else { + Write-Step "Build-only flavor produced. To install on a developer machine," + Write-Step "build the LocalDev flavor instead and run Install-LocalDev-VSIX.ps1." + Write-Host "" +} + +#endregion diff --git a/dev/Templates/VSIX/build-local-VSIX-package/Install-LocalDev-VSIX.ps1 b/dev/Templates/VSIX/build-local-VSIX-package/Install-LocalDev-VSIX.ps1 new file mode 100644 index 0000000000..32fe6f9afb --- /dev/null +++ b/dev/Templates/VSIX/build-local-VSIX-package/Install-LocalDev-VSIX.ps1 @@ -0,0 +1,368 @@ +<# +.SYNOPSIS + Installs the locally-built LocalDev (per-user, AllUsers="false") Windows + App SDK Templates VSIX into Visual Studio 2022 and/or 2026. + +.DESCRIPTION + THE FAST DEV LOOP. No admin required. No setup.exe. No workload removal. + + The LocalDev VSIX is identical in content to the Standalone VSIX except + its manifest sets . That makes it a + per-user install under + %LOCALAPPDATA%\Microsoft\VisualStudio\\Extensions\\ + instead of the per-machine + C:\Program Files\Microsoft Visual Studio\\Common7\IDE\Extensions\ + location used by Standalone/Component. + + Why this works on a machine that already has the WinUI workload + =============================================================== + The workload ships the same extension Id (Microsoft.WindowsAppSDK.Cs.Dev17) + per-machine. VS scans BOTH the per-machine and per-user extension hives + at startup. When two installed extensions share the same Id, the higher + Version wins. The locally-built VSIX uses version + ...0 (e.g. 2026.0529.1710.0) + and the workload-shipped one is 1.x.x.x, so the LocalDev build always + wins for the current user. The workload copy stays untouched on disk + (no admin needed to install OR uninstall LocalDev). + + Steps performed + --------------- + 1. Discover all VS 17+ instances (vswhere) + 2. Refuse to run if any devenv.exe is open (templates are cached at + startup; replacing the VSIX while VS is running has no effect) + 3. For each (VSIX, instance) pair: VSIXInstaller /quiet /instanceIds: + (no /admin, no elevation) + 4. Optionally invoke devenv /UpdateConfiguration to refresh the + template cache so the new templates appear on the very next launch + (VS would otherwise refresh on first launch anyway) + + What this script DELIBERATELY does NOT do + ----------------------------------------- + * No setup.exe modify (we never touch VS Setup state) + * No removal of workload components + * No deletion of files under Program Files + * No admin elevation required + +.PARAMETER Language + Which language template(s) to install. CSharp | Cpp | Both (default). + +.PARAMETER VsixDir + Directory containing LocalDev .vsix files. Default: .\publish\VSIX + +.PARAMETER VsixPath + Direct path to a single LocalDev .vsix. Overrides -VsixDir and -Language. + +.PARAMETER VsVersionRange + vswhere version range filter. Default '[17.0,)' = VS 2022 and VS 2026. + Use '[17.0,18.0)' for VS 2022 only or '[18.0,19.0)' for VS 2026 only. + +.PARAMETER UninstallFirst + If set, run VSIXInstaller /uninstall: before installing. Useful + when you've already installed a LocalDev build and want a clean reinstall. + NOT required for normal use - VSIXInstaller will replace an existing + per-user copy in place. + +.PARAMETER SkipUpdateConfiguration + Skip the post-install 'devenv /UpdateConfiguration' step. The new + templates will still appear, but only on the next VS launch. + +.EXAMPLE + .\Install-LocalDev-VSIX.ps1 + # Install the latest LocalDev C# + C++ VSIX into every VS 17+ instance. + +.EXAMPLE + .\Install-LocalDev-VSIX.ps1 -Language CSharp -VsVersionRange '[18.0,19.0)' + # Install only the C# VSIX into VS 2026. + +.EXAMPLE + .\Install-LocalDev-VSIX.ps1 -UninstallFirst + # Force a clean reinstall (uninstall then install). +#> + +[CmdletBinding()] +param( + [ValidateSet("CSharp", "Cpp", "Both")] + [string]$Language = "Both", + + [string]$VsixDir = "", + + [string]$VsixPath = "", + + [string]$VsVersionRange = '[17.0,)', + + [switch]$UninstallFirst, + + [switch]$SkipUpdateConfiguration +) + +Set-StrictMode -Version 2.0 +$ErrorActionPreference = 'Stop' + +#region --- Helpers --- + +function Write-Banner { + param([string]$Message) + $line = '=' * 70 + Write-Host '' + Write-Host $line -ForegroundColor Cyan + Write-Host " $Message" -ForegroundColor Cyan + Write-Host $line -ForegroundColor Cyan + Write-Host '' +} + +function Write-Step { param([string]$M) Write-Host "[*] $M" -ForegroundColor Green } +function Write-Warn { param([string]$M) Write-Host "[!] $M" -ForegroundColor Yellow } +function Write-Err { param([string]$M) Write-Host "[X] $M" -ForegroundColor Red } + +function Get-VsixExtId { + param([string]$Name) + # LocalDev VSIX uses Ids with a ".LocalDev" suffix so they don't collide + # with the workload-shipped per-machine copy (see manifest comments). + if ($Name -match '\.Cs\.') { return 'Microsoft.WindowsAppSDK.Cs.Dev17.LocalDev' } + if ($Name -match '\.Cpp\.') { return 'Microsoft.WindowsAppSDK.Cpp.Dev17.LocalDev' } + return $null +} + +function Wait-VsixInstaller { + $waited = 0 + while (Get-Process -Name 'VSIXInstaller' -ErrorAction SilentlyContinue) { + Start-Sleep -Seconds 2 + $waited += 2 + if ($waited % 30 -eq 0) { + Write-Host " Still installing... (${waited}s elapsed)" -ForegroundColor DarkGray + } + } +} + +function Get-LatestVsixInstallerLog { + Get-ChildItem "$env:TEMP\dd_VSIXInstaller_*.log" -ErrorAction SilentlyContinue | + Sort-Object LastWriteTime -Descending | Select-Object -First 1 +} + +#endregion + +#region --- Setup --- + +Write-Banner 'Windows App SDK LocalDev VSIX Installer (per-user, no admin)' + +$scriptDir = $PSScriptRoot +if (-not $scriptDir) { $scriptDir = (Get-Location).Path } + +#endregion + +#region --- Locate VSIX files --- + +Write-Banner 'Locating LocalDev VSIX Files' + +$toInstall = @() + +if ($VsixPath -ne "") { + if (-not (Test-Path $VsixPath)) { + Write-Err "VSIX file not found: $VsixPath" + exit 1 + } + $toInstall += Get-Item $VsixPath +} else { + if ($VsixDir -eq "") { + $VsixDir = Join-Path $scriptDir 'publish\VSIX' + } + if (-not (Test-Path $VsixDir)) { + Write-Err "VSIX directory not found: $VsixDir" + Write-Err "Run '.\Build-VSIX-Local.ps1 -Deployment LocalDev' first." + exit 1 + } + + $csVsix = Get-ChildItem $VsixDir -Filter 'WindowsAppSDK.Cs.Extension.Dev17.LocalDev.*.vsix' -ErrorAction SilentlyContinue | Sort-Object LastWriteTime -Descending | Select-Object -First 1 + $cppVsix = Get-ChildItem $VsixDir -Filter 'WindowsAppSDK.Cpp.Extension.Dev17.LocalDev.*.vsix' -ErrorAction SilentlyContinue | Sort-Object LastWriteTime -Descending | Select-Object -First 1 + + if ($Language -in @('CSharp','Both') -and $csVsix) { $toInstall += $csVsix } + if ($Language -in @('Cpp', 'Both') -and $cppVsix) { $toInstall += $cppVsix } +} + +if (-not $toInstall) { + Write-Err "No matching LocalDev VSIX files found." + Write-Err "Expected names: WindowsAppSDK.{Cs,Cpp}.Extension.Dev17.LocalDev..vsix" + Write-Err "Run: .\Build-VSIX-Local.ps1 -Deployment LocalDev" + exit 1 +} + +foreach ($v in $toInstall) { + Write-Step "VSIX: $($v.Name)" +} + +#endregion + +#region --- Refuse to run while VS is open --- + +Write-Banner 'Checking Visual Studio Status' + +$vsProcs = Get-Process -Name 'devenv' -ErrorAction SilentlyContinue +if ($vsProcs) { + Write-Err 'Visual Studio is running. Per-user VSIX installs apply at VS startup;' + Write-Err 'replacing the VSIX while VS is running has no effect on this VS session.' + Write-Err 'Close all devenv.exe processes and re-run this script.' + foreach ($p in $vsProcs) { Write-Err " devenv.exe (PID: $($p.Id))" } + exit 1 +} +Write-Step 'No Visual Studio instances running.' + +#endregion + +#region --- Discover VS instances --- + +Write-Banner "Discovering Visual Studio Installations (range $VsVersionRange)" + +$vswherePath = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" +if (-not (Test-Path $vswherePath)) { + Write-Err 'vswhere.exe not found. Install Visual Studio 2022 or later.' + exit 1 +} + +$vsInstancesJson = & $vswherePath -products '*' -prerelease -version $VsVersionRange -format json 2>$null +if (-not $vsInstancesJson) { + Write-Err "No Visual Studio installation found matching version range '$VsVersionRange'." + exit 1 +} +$vsInstancesAll = $vsInstancesJson | ConvertFrom-Json + +$vsInstances = @() +foreach ($inst in $vsInstancesAll) { + $vsixExe = Join-Path $inst.installationPath 'Common7\IDE\VSIXInstaller.exe' + if (-not (Test-Path $vsixExe)) { + Write-Warn "Skipping $($inst.displayName) - VSIXInstaller.exe not found." + continue + } + $vsInstances += [PSCustomObject]@{ + InstanceId = $inst.instanceId + DisplayName = $inst.displayName + Version = $inst.installationVersion + Path = $inst.installationPath + VsixInstaller = $vsixExe + Devenv = Join-Path $inst.installationPath 'Common7\IDE\devenv.exe' + } + Write-Step "$($inst.displayName) (v$($inst.installationVersion)) [$($inst.instanceId)]" +} +if (-not $vsInstances) { Write-Err 'No usable VS installations found.'; exit 1 } + +#endregion + +#region --- Optional uninstall (per-user only) --- + +if ($UninstallFirst) { + Write-Banner 'Uninstalling Existing Per-User Copy' + foreach ($vsix in $toInstall) { + $extId = Get-VsixExtId -Name $vsix.Name + if (-not $extId) { continue } + foreach ($inst in $vsInstances) { + Write-Step "[$($inst.DisplayName)] VSIXInstaller /uninstall:$extId ..." + # No /admin flag here - we are intentionally only touching the + # per-user (current user) install. VSIXInstaller will refuse to + # silently uninstall a per-machine extension without /admin, so + # any per-machine workload-shipped copy is left alone (which is + # exactly what we want). + & $inst.VsixInstaller "/uninstall:$extId" '/quiet' "/instanceIds:$($inst.InstanceId)" 2>&1 | Out-Null + Wait-VsixInstaller + $log = Get-LatestVsixInstallerLog + if ($log) { + $tail = Get-Content $log.FullName -Tail 20 -ErrorAction SilentlyContinue + if ($tail | Select-String 'Uninstall.*completed|successfully uninstalled') { + Write-Step "[$($inst.DisplayName)] Per-user copy uninstalled (or none was present)." + } else { + Write-Warn "[$($inst.DisplayName)] Uninstall returned no clear success line." + Write-Warn " Log: $($log.FullName)" + } + } + } + } +} + +#endregion + +#region --- Install (per-user, no admin) --- + +Write-Banner 'Installing LocalDev VSIX (per-user)' + +$failed = @() +$succeeded = @() + +foreach ($vsix in $toInstall) { + foreach ($inst in $vsInstances) { + Write-Step "[$($inst.DisplayName)] Installing $($vsix.Name)..." + $args = @('/quiet', "/instanceIds:$($inst.InstanceId)", $vsix.FullName) + Write-Host " > VSIXInstaller $($args -join ' ')" -ForegroundColor DarkGray + & $inst.VsixInstaller @args 2>&1 | Out-Null + Wait-VsixInstaller + + $log = Get-LatestVsixInstallerLog + $hasError = $false + if ($log) { + $tail = Get-Content $log.FullName -Tail 80 -ErrorAction SilentlyContinue + $errLines = $tail | Select-String 'Install Error|InvalidOperationException.*(Uninstall|Installation).*failed' + if ($errLines) { + $hasError = $true + $failed += "$($vsix.Name) -> $($inst.DisplayName)" + Write-Err "[$($inst.DisplayName)] VSIXInstaller failed." + Write-Err " Log: $($log.FullName)" + foreach ($e in $errLines) { Write-Err " $($e.Line.Trim())" } + } + } + if (-not $hasError) { + Write-Step "[$($inst.DisplayName)] Installed (per-user)." + $succeeded += [PSCustomObject]@{ Vsix = $vsix.Name; Instance = $inst } + } + } +} + +#endregion + +#region --- Refresh template cache --- + +if (-not $SkipUpdateConfiguration -and $succeeded) { + Write-Banner 'Refreshing Template Cache (devenv /UpdateConfiguration)' + # /UpdateConfiguration forces VS to re-scan extensions and rebuild caches + # (incl. ProjectTemplatesCache, ItemTemplatesCache, ComponentModelCache). + # This makes the new templates show up immediately on next File -> New + # without waiting for the next interactive launch to discover them. + $instancesTouched = $succeeded | ForEach-Object { $_.Instance } | Sort-Object InstanceId -Unique + foreach ($inst in $instancesTouched) { + Write-Step "[$($inst.DisplayName)] devenv /UpdateConfiguration ..." + & $inst.Devenv '/UpdateConfiguration' 2>&1 | Out-Null + Write-Step "[$($inst.DisplayName)] Cache refreshed." + } +} + +#endregion + +#region --- Summary --- + +Write-Banner 'Installation Summary' + +if (-not $failed) { + Write-Step 'All LocalDev VSIX(es) installed successfully.' + Write-Host '' + Write-Step 'Verify in Visual Studio:' + Write-Host ' 1. Launch Visual Studio (any installed VS 17+ instance).' -ForegroundColor White + Write-Host ' 2. File -> New -> Project.' -ForegroundColor White + Write-Host ' 3. Filter Language=C#, Search "WinUI".' -ForegroundColor White + Write-Host ' 4. You should see the 7 project templates:' -ForegroundColor White + Write-Host ' 1) Blank App' -ForegroundColor White + Write-Host ' 2) NavigationView App' -ForegroundColor White + Write-Host ' 3) TabView App' -ForegroundColor White + Write-Host ' 4) MVVM App' -ForegroundColor White + Write-Host ' 5) Blank App (Packaged WAP)' -ForegroundColor White + Write-Host ' 6) Class Library' -ForegroundColor White + Write-Host ' 7) Unit Test App' -ForegroundColor White + Write-Host '' + Write-Step 'To uninstall later (no admin needed):' + Write-Host ' .\Install-LocalDev-VSIX.ps1 -UninstallFirst' -ForegroundColor White + Write-Host ' # then Ctrl+C to skip the reinstall, or just let it reinstall' -ForegroundColor DarkGray + Write-Host ' # alternatively:' -ForegroundColor DarkGray + Write-Host ' & "\Common7\IDE\VSIXInstaller.exe" /uninstall:Microsoft.WindowsAppSDK.Cs.Dev17.LocalDev /quiet' -ForegroundColor White + exit 0 +} else { + Write-Err 'Failed installs:' + foreach ($f in $failed) { Write-Err " - $f" } + exit 1 +} + +#endregion diff --git a/dev/Templates/VSIX/build-local-VSIX-package/build-install-localdev-vsix.ps1 b/dev/Templates/VSIX/build-local-VSIX-package/build-install-localdev-vsix.ps1 new file mode 100644 index 0000000000..124566d1d7 --- /dev/null +++ b/dev/Templates/VSIX/build-local-VSIX-package/build-install-localdev-vsix.ps1 @@ -0,0 +1,120 @@ +<# +.SYNOPSIS + End-to-end LocalDev (per-user, AllUsers="false") build + install for the + Windows App SDK Templates VSIX. + +.DESCRIPTION + The fast dev loop. No admin. No setup.exe. No workload removal. + + 1. Build the LocalDev flavor of the C# (and optionally C++) VSIX + 2. Install it per-user into every VS 17+ instance found by vswhere + 3. Refresh the template cache via 'devenv /UpdateConfiguration' + + See Install-LocalDev-VSIX.ps1 for the full theory of operation. + +.PARAMETER Language + CSharp | Cpp | Both (default). + +.PARAMETER SkipBuild + Reuse the most recently built LocalDev .vsix in publish\VSIX without + rebuilding. + +.PARAMETER VsVersionRange + vswhere version range filter. Default '[17.0,)' (VS 2022 + VS 2026). + Use '[17.0,18.0)' for VS 2022 only, '[18.0,19.0)' for VS 2026 only. + +.PARAMETER UninstallFirst + Run VSIXInstaller /uninstall before installing for a clean reinstall. + +.EXAMPLE + .\build-install-localdev-vsix.ps1 + # Build + install LocalDev C# + C++ to all VS 17+. + +.EXAMPLE + .\build-install-localdev-vsix.ps1 -Language CSharp -VsVersionRange '[18.0,19.0)' + # Build only C# LocalDev and install to VS 2026 only. +#> + +[CmdletBinding()] +param( + [ValidateSet("CSharp", "Cpp", "Both")] + [string]$Language = "Both", + + [switch]$SkipBuild, + + [string]$VsVersionRange = '[17.0,)', + + [switch]$UninstallFirst +) + +Set-StrictMode -Version 2.0 +$ErrorActionPreference = 'Stop' + +function Write-Banner { + param([string]$Message) + $line = '=' * 70 + Write-Host '' + Write-Host $line -ForegroundColor Cyan + Write-Host " $Message" -ForegroundColor Cyan + Write-Host $line -ForegroundColor Cyan + Write-Host '' +} +function Write-Step { param([string]$M) Write-Host "[*] $M" -ForegroundColor Green } +function Write-Err { param([string]$M) Write-Host "[X] $M" -ForegroundColor Red } + +$scriptDir = $PSScriptRoot +if (-not $scriptDir) { $scriptDir = (Get-Location).Path } + +$buildScript = Join-Path $scriptDir 'Build-VSIX-Local.ps1' +$installScript = Join-Path $scriptDir 'Install-LocalDev-VSIX.ps1' +$publishDir = Join-Path $scriptDir 'publish\VSIX' + +Write-Banner 'LocalDev: Build + Install (per-user, no admin)' +Write-Step "Script directory : $scriptDir" +Write-Step "Language : $Language" +Write-Step "VS range filter : $VsVersionRange" +Write-Step "SkipBuild : $($SkipBuild.IsPresent)" + +# --- Build --- +if ($SkipBuild) { + Write-Banner 'Build (SKIPPED via -SkipBuild)' +} else { + Write-Banner 'Build LocalDev VSIX' + if (-not (Test-Path $buildScript)) { + Write-Err "Build-VSIX-Local.ps1 not found at: $buildScript" + exit 1 + } + Push-Location $scriptDir + try { + & $buildScript -Deployment LocalDev + if ($LASTEXITCODE -ne 0) { + Write-Err "Build-VSIX-Local.ps1 exited with code $LASTEXITCODE" + exit $LASTEXITCODE + } + } finally { + Pop-Location + } +} + +# --- Install --- +Write-Banner 'Install LocalDev VSIX' +if (-not (Test-Path $installScript)) { + Write-Err "Install-LocalDev-VSIX.ps1 not found at: $installScript" + exit 1 +} + +$installArgs = @{ + Language = $Language + VsVersionRange = $VsVersionRange +} +if ($UninstallFirst) { $installArgs['UninstallFirst'] = $true } + +Push-Location $scriptDir +try { + & $installScript @installArgs + $exit = $LASTEXITCODE +} finally { + Pop-Location +} + +exit $exit diff --git a/dev/Templates/VSIX/build-local-VSIX-package/build-local-VSIX-package.md b/dev/Templates/VSIX/build-local-VSIX-package/build-local-VSIX-package.md new file mode 100644 index 0000000000..2cfc5c05c1 --- /dev/null +++ b/dev/Templates/VSIX/build-local-VSIX-package/build-local-VSIX-package.md @@ -0,0 +1,246 @@ +# Windows App SDK VSIX — Local Build & Test Guide + +The fast inner-loop guide for building and testing the WinUI Templates VSIX on +a developer machine that already has Visual Studio 2022 and / or 2026 with the +WinUI workload installed. + +## TL;DR + +```powershell +# Build + install the LocalDev VSIX into every VS 17+ instance on the machine. +# No admin required. No setup.exe modify. No workload removal. +.\build-install-localdev-vsix.ps1 + +# Then in Visual Studio: File -> New -> Project -> filter C# -> search "WinUI" +``` + +That single command rebuilds your local source, installs to `%LOCALAPPDATA%`, +and refreshes the template cache. Do it after every code change you want to +see in real VS. + +--- + +## Why LocalDev is the only locally installable flavor + +The build can produce three flavors. **Only LocalDev is meant to be installed +on a developer box.** The other two are build-only artifacts. + +| Flavor | `` | Extension Id | Locally installable? | Purpose | +|---|---|---|---|---| +| **LocalDev** ★ | `false` (per-user) | `Microsoft.WindowsAppSDK.Cs.Dev17.LocalDev` | **Yes — no admin** | Fast dev loop. Coexists peacefully with the workload-shipped per-machine copy. | +| Standalone | `true` (per-machine) | `Microsoft.WindowsAppSDK.Cs.Dev17` | **No** | Build-only artifact (e.g. for the VS Marketplace pipeline). On any machine that already has the WinUI workload, VSIXInstaller cannot install it because the same Id is owned by 5+ workload components. | +| Component | `true` (per-machine, `IsProductComponent`) | `Microsoft.WindowsAppSDK.Cs.Dev17` | **No** | Build-only artifact for the VS Installer build pipeline (gets picked up as part of the WinUI workload component). | + +> If you really need to test the per-machine install path, do it inside a clean +> VM that does **not** have the WinUI workload installed. Don't try to +> side-load Standalone or Component on a workload-equipped machine — the +> "Uninstall failed; please uninstall all of the following components" +> failure cascade is documented in [investigation.md](investigation.md). + +--- + +## Prerequisites (one-time) + +| Requirement | Details | +|-------------|---------| +| **Visual Studio 2022 (17.0+)** or **2026** | Required for MSBuild and VSSDK targets | +| **Workloads** | `.NET desktop development` + `Visual Studio extension development` | +| **.NET 8 SDK** | Needed by the `WinAppSdk.CSharp.DotnetNewTemplates` project | +| **Internet access** | To restore NuGet packages from nuget.org | + +Quick checks: + +```powershell +& "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -format json +dotnet --list-sdks +``` + +--- + +## Inner loop: build + install + reinstall + +The recommended one-shot orchestrator: + +```powershell +# Build LocalDev for both C# and C++; install into every VS 17+ instance. +.\build-install-localdev-vsix.ps1 + +# Reinstall after a code change (uninstalls old per-user copy first): +.\build-install-localdev-vsix.ps1 -UninstallFirst + +# Skip the build step (reuse the latest .vsix in publish\VSIX): +.\build-install-localdev-vsix.ps1 -SkipBuild + +# Limit to one language: +.\build-install-localdev-vsix.ps1 -Language CSharp + +# Limit to one VS major version: +.\build-install-localdev-vsix.ps1 -VsVersionRange '[17.0,18.0)' # VS 2022 only +.\build-install-localdev-vsix.ps1 -VsVersionRange '[18.0,19.0)' # VS 2026 only +``` + +Or run the steps separately (same result): + +```powershell +.\Build-VSIX-Local.ps1 # default = -Deployment LocalDev +.\Install-LocalDev-VSIX.ps1 +``` + +### What the install script does +1. Refuses to run while any `devenv.exe` is open (templates are cached at + startup). +2. `vswhere` discovers all VS 17+ instances. +3. `VSIXInstaller /quiet /instanceIds:` per (VSIX, instance) pair. **No + `/admin`, no elevation.** Output goes to + `%LOCALAPPDATA%\Microsoft\VisualStudio\\Extensions\\`. +4. `devenv /UpdateConfiguration` per instance to refresh + `ProjectTemplatesCache`, `ItemTemplatesCache`, `ComponentModelCache`. + +### What it deliberately does NOT do +- No `setup.exe modify` (never touches VS Setup state). +- No removal of workload components. +- No deletion of files under Program Files. +- No admin elevation. + +### Uninstall the LocalDev copy + +```powershell +& "\Common7\IDE\VSIXInstaller.exe" /uninstall:Microsoft.WindowsAppSDK.Cs.Dev17.LocalDev /quiet +& "\Common7\IDE\VSIXInstaller.exe" /uninstall:Microsoft.WindowsAppSDK.Cpp.Dev17.LocalDev /quiet +``` + +The workload-shipped per-machine copy is never touched and is reactivated +automatically once the LocalDev copy is gone. + +### Verifying in Visual Studio + +1. Launch Visual Studio (any installed VS 17+ instance). +2. File → New → Project. Filter Language=C#, search "WinUI". Expect these + seven project templates: + + | # | Template | + |---|---| + | 1 | WinUI Blank App | + | 2 | WinUI Navigation App | + | 3 | WinUI TabView App | + | 4 | WinUI MVVM App | + | 5 | WinUI Blank App (Packaged WAP) | + | 6 | WinUI Class Library | + | 7 | WinUI Unit Test App | + +3. (Optional) Confirm VS picked up your local build, not the workload copy: + Extensions → Manage Extensions → Installed → look for + **"Windows App SDK C# VS Templates (LocalDev)"** — the `(LocalDev)` + suffix is on the VSIX `` and proves the per-user copy is + active. The workload copy ("Windows App SDK C# VS Templates", no suffix) + may also appear; that's fine — the higher-version per-user LocalDev + registration shadows it for File → New → Project. + +--- + +## Build-only flavors (Standalone, Component) + +Use these only when you need an artifact for signing / publishing / pipeline +parity. **They cannot be installed locally on a workload-equipped machine.** + +```powershell +# Build the Standalone artifact only: +.\Build-VSIX-Local.ps1 -Deployment Standalone + +# Build the Component artifact only: +.\Build-VSIX-Local.ps1 -Deployment Component + +# Build both: +.\Build-VSIX-Local.ps1 -Deployment Both + +# Build with a specific Windows App SDK version: +.\Build-VSIX-Local.ps1 -Deployment Standalone -WindowsAppSDKVersion "1.8.260317003" + +# Build using a local .nupkg directory (auto-extracts the WindowsAppSDK version +# from the embedded .nuspec): +.\Build-VSIX-Local.ps1 -Deployment Standalone -NupkgSourceDir "C:\my-packages" + +# (Optional) Override the auto-generated VSIX version. By default the script +# stamps ...0 (e.g. 2026.0529.1640.0) from the current +# time. Pass this flag only if you want a specific value, for instance: +.\Build-VSIX-Local.ps1 -Deployment Standalone -OptionalVSIXVersion "2026.0529.1640.0" +``` + +The output `.vsix` files land in `.\publish\VSIX\` named with the version, e.g. +`WindowsAppSDK.Cs.Extension.Dev17.Standalone.2026.0529.1640.0.vsix`. + +--- + +## File reference + +| File | Purpose | +|------|---------| +| `Build-VSIX-Local.ps1` | Builds VSIXes. Default `-Deployment LocalDev`. | +| `Install-LocalDev-VSIX.ps1` | Per-user install of the LocalDev VSIX into VS 17+ instances. No admin. | +| `build-install-localdev-vsix.ps1` | One-shot orchestrator: Build-VSIX-Local (LocalDev) + Install-LocalDev-VSIX. | +| `vsix-nuget.config` | NuGet config the build script passes via `/p:RestoreConfigFile`. | +| `investigation.md` | Historical findings about why per-machine install is broken on workload-equipped machines. Read this before trying to "fix" Standalone install. | + +--- + +## Troubleshooting + +### Visual Studio shows the old templates after rebuild + +You launched VS while it had the old per-user extension cached. Either: + +- close VS, run `.\build-install-localdev-vsix.ps1 -UninstallFirst`, then + relaunch VS, OR +- open Tools → Get Tools and Features (or `devenv /UpdateConfiguration` from a + shell) to force the template cache rebuild. + +### "Visual Studio is running" error from the install script + +Per-user VSIX installs only take effect on the next VS startup, so the script +refuses to run while any `devenv.exe` exists. Close all VS instances and +re-run. + +### NuGet restore fails with "Unable to find version..." + +The repo's root `NuGet.config` uses `` and points at Microsoft +internal feeds only. `Build-VSIX-Local.ps1` works around this by passing +`vsix-nuget.config` via `/p:RestoreConfigFile`. If you're invoking MSBuild +yourself, use the same parameter. + +### `Microsoft.VsSDK.targets was not found` + +Open Visual Studio Installer → Modify → check the **Visual Studio extension +development** workload. + +### `DotnetNewTemplates` fails to build + +The `WinAppSdk.CSharp.DotnetNewTemplates.csproj` targets `net8.0`. Install the +[.NET 8 SDK](https://dotnet.microsoft.com/download/dotnet/8.0). + +### `VSSDK1300: Could not find a part of the path...` + +The VSSDK extracts template ZIPs into deeply nested paths and the .NET +Framework APIs it uses do not honor `LongPathsEnabled`. `Build-VSIX-Local.ps1` +already redirects build output to `C:\tmp\vsixbo\` to keep paths short. If +you're invoking MSBuild yourself, pass `/p:BuildOutput=C:\tmp\vsixbo\`. + +### "Version 1.0.0-preview1 of package Microsoft.WindowsAppSDK not found" + +You ran `Build-VSIX-Local.ps1` without `-WindowsAppSDKVersion` or `-NupkgSourceDir`, +so the build fell back to the placeholder version baked into +`Directory.Build.props`. The VSIX file still builds and installs (the inner +templates carry token placeholders that are rewritten at template-instantiation +time), but `dotnet new`-style restore against the published nupkg won't work. +Pass a real version when you need package-realistic testing: + +```powershell +.\Build-VSIX-Local.ps1 -Deployment LocalDev -WindowsAppSDKVersion "1.8.260317003" +``` + +### Want to install the Standalone or Component VSIX locally + +Don't. They share an extension Id with the workload-shipped copy and +VSIXInstaller refuses to side-load over a workload-managed extension. See +[investigation.md](investigation.md) for the gory details. Use the LocalDev +flavor for local testing, or test inside a clean VM without the WinUI +workload. diff --git a/dev/Templates/VSIX/build-local-VSIX-package/vsix-nuget.config b/dev/Templates/VSIX/build-local-VSIX-package/vsix-nuget.config new file mode 100644 index 0000000000..4b6d8bc20e --- /dev/null +++ b/dev/Templates/VSIX/build-local-VSIX-package/vsix-nuget.config @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + diff --git a/dev/VSIX/extension.manifest.json b/dev/Templates/VSIX/extension.manifest.json similarity index 100% rename from dev/VSIX/extension.manifest.json rename to dev/Templates/VSIX/extension.manifest.json diff --git a/dev/VSIX/global.json b/dev/Templates/VSIX/global.json similarity index 100% rename from dev/VSIX/global.json rename to dev/Templates/VSIX/global.json diff --git a/dev/VSIX/overview-experimental.md b/dev/Templates/VSIX/overview-experimental.md similarity index 100% rename from dev/VSIX/overview-experimental.md rename to dev/Templates/VSIX/overview-experimental.md diff --git a/dev/VSIX/overview-stable.md b/dev/Templates/VSIX/overview-stable.md similarity index 100% rename from dev/VSIX/overview-stable.md rename to dev/Templates/VSIX/overview-stable.md diff --git a/dev/Templates/how-to-create-a-new-csharp-template.md b/dev/Templates/how-to-create-a-new-csharp-template.md new file mode 100644 index 0000000000..144a1190f3 --- /dev/null +++ b/dev/Templates/how-to-create-a-new-csharp-template.md @@ -0,0 +1,324 @@ +# Adding a new WinUI **C#** template + +The C# templates ship through two channels, both driven by the single +declarative manifest [`templates.props`](templates.props): + +| Channel | Output | Consumer csproj | +| -------------- | ------------------------------------- | --------------- | +| **dotnet-new** | NuGet `Microsoft.WindowsAppSDK.WinUI.CSharp.Templates` | [`Dotnet/WinAppSdk.CSharp.DotnetNewTemplates.csproj`](Dotnet/WinAppSdk.CSharp.DotnetNewTemplates.csproj) | +| **VSIX (C#)** | VS extension (New Project / New Item) | [`VSIX/Extension/Cs/Dev17/WindowsAppSDK.Cs.Extension.Dev17.csproj`](VSIX/Extension/Cs/Dev17/WindowsAppSDK.Cs.Extension.Dev17.csproj) | + +Adding a template means: drop the content under [`Source/`](Source), +add one entry to `templates.props`, and (if it ships in the VSIX) list +the template in [`VSIX/WindowsAppSDK.Extension.sln`](VSIX/WindowsAppSDK.Extension.sln). +Neither consumer csproj needs to change. + +--- + +## TL;DR + +### 1. Drop the template content under `Source/` + +For a project template: + +``` +dev/Templates/Source/ProjectTemplates/Desktop/CSharp// + .csproj + .ico (used by VSIX) + .png (used by VSIX) + .vstemplate (used by VSIX) + App.xaml / MainWindow.xaml / ... +``` + +For an item template, use `Source/ItemTemplates/Neutral/CSharp//` +with the same shape (no `.png`). + +If the template ships in the VSIX, also add the `.csproj` to +[`VSIX/WindowsAppSDK.Extension.sln`](VSIX/WindowsAppSDK.Extension.sln) +so CI builds it. + +### 2. If the template is a packaged WinUI app, add `Package-managed.appxmanifest` + +Place it next to the `.csproj`. The pack task will rename it to +`Package.appxmanifest` in the produced template. See the FAQ for why +the non-reserved name in Source. + +### 3. If the template ships to `dotnet new`, add the dotnet-new metadata folder + +``` +dev/Templates/Dotnet/templates// + .template.config/ + template.json (required) + dotnetcli.host.json (CLI parameter aliases) + ide.host.json (VS / VS Code metadata) + icon.png (shown in dialogs) +``` + +`` must match the `Identity` you choose in step 4 +(e.g. `templates/navigation-app/` ↔ `winui.navview`). + +### 4. Add an entry to `templates.props` + +Pick the item type by where the template should ship: + +| Ships to dotnet-new | Ships to VSIX | Item type | +| :-----------------: | :-----------: | ------------------------------- | +| ✅ | ✅ | `ProjectTemplate` | +| ✅ | ✅ | `ItemTemplate` | +| ❌ | ✅ | `VsixOnlyProjectTemplate` | +| ✅ | ❌ | `DotnetNewOnlyProjectTemplate` | +| ❌ | ✅ | `VsixOnlyItemTemplate` | +| ✅ | ❌ | `DotnetNewOnlyItemTemplate` | + +Each entry is one MSBuild item element of the chosen type with this +shape: + +```xml + + WinUI.Desktop.Cs.SomeName + $(MSBuildThisFileDirectory)Source\ProjectTemplates\Desktop\CSharp\SomeName + $(MSBuildThisFileDirectory)Dotnet\templates\some-name + Package-managed.appxmanifest + +``` + +| Metadata | Description | Required? | +| -------- | ----------- | --------- | +| `Identity` (the `Include` attribute) | For dotnet-new templates: the short name (also the `content//` subfolder in the NuGet). For VSIX-only templates: any unique name. | Always | +| `BaseName` | File-name stem of the source `.csproj` / `.ico` / `.png` / `.vstemplate`. | Always | +| `SourceDir` | Absolute path to the template's source tree. | Always | +| `DotnetConfigDir` | Absolute path to `Dotnet/templates//`. | When ships to dotnet-new | +| `RenameManifestFrom` | Source-side manifest filename, typically `Package-managed.appxmanifest`. Packed as `Package.appxmanifest`. | Packaged WinUI app templates only | + +### 5. Local build for tests + +1. dotnet new template: + + TL;DR + ```pwsh + # dotnet-new NuGet (inspect produced .nupkg under localpackages\) + dotnet pack dev\Templates\Dotnet\WinAppSdk.CSharp.DotnetNewTemplates.csproj -c Debug + + # dotnet new uninstall Microsoft.WindowsAppSDK.WinUI.CSharp.Templates + + dotnet new install localpackages\Microsoft.WindowsAppSDK.WinUI.CSharp.Templates.*.nupkg + ``` + + read details in [build-local-VSIX-package.md](.\VSIX\build-local-VSIX-package\build-local-VSIX-package.md) + +2. VSIX + + TL;DR + ```pwsh + dev\Templates\VSIX\build-local-VSIX-package\build-install-localdev-vsix.ps1 + ``` + + read details in [build-local-VSIX-package.md](.\VSIX\build-local-VSIX-package\build-local-VSIX-package.md) + +--- + +## How it works under the hood + +### Single source of truth: `templates.props` + +[`templates.props`](templates.props) is a plain MSBuild props file. It +declares six item collections (one per cell of the dotnet-new × VSIX +matrix above) and the per-template metadata for each entry. Default +metadata lives in ``; per-entry metadata only +overrides what differs. + +Both consuming csprojs `` this file, then partition the items by +their delivery channel: + +```text + ProjectTemplate ItemTemplate VsixOnly* DotnetNewOnly* +dotnet-new csproj ✅ ✅ — ✅ +VSIX csproj ✅ ✅ ✅ — +``` + +Adding a template is an entry in `templates.props`. Neither csproj has to +know about it. + +### dotnet-new packaging: `ExpandProjectTemplatePackItems` + +`dotnet new` template packs are just NuGet packages where the template +content sits under `content//`. NuGet's `Pack` target +consumes `` items. Building one +template by hand looks like this: + +```xml + + + + + +``` + +That style is what the original PR shipped. It worked but had problems: +the dotnet csproj needed to know **every** template's exclude list, file +names, and rename rule — and adding one new template meant ~15 lines of +copy-paste with seven find-and-replace edits, none of which the compiler +or NuGet would warn about if you got one wrong. + +We replaced it with an **inline C# MSBuild task** — +`ExpandProjectTemplatePackItems` in +[`WinAppSdk.CSharp.DotnetNewTemplates.csproj`](Dotnet/WinAppSdk.CSharp.DotnetNewTemplates.csproj). +It takes `@(ProjectTemplate)` (or `@(ItemTemplate)`, etc.) and per +template performs the same four-step packing recipe: + +1. Pack everything under `SourceDir`, minus `bin/`, `obj/`, and the + per-template sidecars (`.csproj` / `.ico` / `.png` / `.vstemplate`). +2. If `RenameManifestFrom` is set, re-pack that manifest under the + reserved name `Package.appxmanifest`. +3. Pack everything under `DotnetConfigDir/.template.config/`. +4. Pack a copy of the shared `.gitignore` (project templates only). + +### Why a C# task and not a pure-MSBuild `` with batching + +It would be more idiomatic to write something like: + +```xml + +``` + +…and let MSBuild's task batching fan it out per template. Two MSBuild +rules block that path: + +- **MSB5029** ("wildcard enumerates the whole drive") inspects + `` patterns *before* batching resolves `%(...)` metadata, so + the literal `\**\*.*` after the empty substitution is rejected. +- **MSB4191** forbids custom-metadata references in `` at the + top level (only inside ``), so we can't pre-filter the list + with `Condition="'%(IncludeInVSIX)' != 'false'"` either. + +An MSBuild task is opaque to both checks. The task walks the file +system with `System.IO` at run time, when all metadata has been +resolved. + +### Manifest rename + +Packaged WinUI apps need a file literally named `Package.appxmanifest` +for MSIX tooling to recognize them. But the Source-side template project +*itself* has to build (CI builds the whole `WindowsAppSDK.Extension.sln` +to verify templates don't bit-rot). If the file were named +`Package.appxmanifest` in the Source tree, MSIX tooling would try to +package the *template project* as a real app and fail. + +The convention is therefore: + +- Source tree stores it as `Package-managed.appxmanifest` (a + non-reserved name). +- Packing renames it to `Package.appxmanifest`. + +The `RenameManifestFrom` metadata is what tells the inline task to +perform that rename. + +### VSIX consumption + +The VSIX csproj converts the same manifest into `` +items via MSBuild item transforms: + +```xml + + %(BaseName) + ProjectTemplates + false + TemplateProjectOutputGroup; + +``` + +`IncludeOutputGroupsInVSIX="TemplateProjectOutputGroup"` is the VSSDK +hook each template project uses to publish its `.vstemplate` zip into +the VSIX container. + +We intentionally do not specify the `` GUID hint. MSBuild +resolves ProjectReferences by path; the GUID was historically only a +hint for Solution Explorer. + +### C++/WinRT isolation + +The C++/WinRT VSIX project at +[`VSIX/Extension/Cpp/Dev17/WindowsAppSDK.Cpp.Extension.Dev17.csproj`](VSIX/Extension/Cpp/Dev17/WindowsAppSDK.Cpp.Extension.Dev17.csproj) +**does not** import [`templates.props`](templates.props) and is not +reached by it indirectly: neither [`Directory.Build.props`](Directory.Build.props) +nor any other auto-discovered props file injects the manifest into the +C++ side. Therefore none of the C# item collections +(`@(ProjectTemplate)`, `@(ItemTemplate)`, `@(VsixOnlyProjectTemplate)`, +`@(VsixOnlyItemTemplate)`, `@(DotnetNewOnlyProjectTemplate)`, +`@(DotnetNewOnlyItemTemplate)`) are visible to the C++ csproj, and +changes to `templates.props` cannot regress the C++ VSIX build. + +If/when C++ templates are migrated to the same declarative manifest in +a follow-up, this isolation note should be updated accordingly. + +--- + +## File / folder reference + +``` +dev/Templates/ +├── templates.props ← the C# manifest (one entry per template) +├── Directory.Build.props ← shared MSBuild props for the Templates folder +├── Dotnet/ ← C# only: packs the dotnet-new NuGet +│ ├── WinAppSdk.CSharp.DotnetNewTemplates.csproj +│ ├── Directory.Build.props +│ └── templates// +│ └── .template.config/ +│ ├── template.json +│ ├── dotnetcli.host.json +│ ├── ide.host.json +│ └── icon.png +├── Source/ ← actual template content (C# and C++) +│ ├── ProjectTemplates/Desktop/CSharp// +│ │ ├── .csproj +│ │ ├── .{ico,png,vstemplate} +│ │ ├── Package-managed.appxmanifest (if packaged) +│ │ └── ...source files... +│ ├── ProjectTemplates/Desktop/CppWinRT// ← out of scope for this doc +│ ├── ItemTemplates/Neutral/CSharp// +│ └── ItemTemplates/Neutral/CppWinRT// ← out of scope for this doc +└── VSIX/ + ├── WindowsAppSDK.Extension.sln + ├── Extension/Cs/Dev17/WindowsAppSDK.Cs.Extension.Dev17.csproj ← C# VSIX (consumes templates.props) + ├── Extension/Cpp/Dev17/WindowsAppSDK.Cpp.Extension.Dev17.csproj ← C++ VSIX (does NOT import templates.props) + └── Directory.Build.props +``` + +--- + +## FAQ + +**Q. Why is the manifest in `Source/` named `Package-managed.appxmanifest` +instead of `Package.appxmanifest`?** + +The Source-side template project itself has to build cleanly — CI +builds [`VSIX/WindowsAppSDK.Extension.sln`](VSIX/WindowsAppSDK.Extension.sln) +to verify templates don't bit-rot. A file literally named +`Package.appxmanifest` would trigger MSIX tooling and try to package +the template *project itself* as a real app, breaking that build. The +Source tree therefore uses a non-reserved name and the pack task +renames it back to `Package.appxmanifest` in the produced template. + +**Q. I want to add a C++/WinRT template.** + +Currently, this doc and `templates.props` do not cover C++/WinRT. + +For C++ templates, add the template content under + `Source/{Project,Item}Templates/.../CppWinRT//` as usual, + then add a `` to the C++ extension csproj +([`VSIX/Extension/Cpp/Dev17/WindowsAppSDK.Cpp.Extension.Dev17.csproj`](VSIX/Extension/Cpp/Dev17/WindowsAppSDK.Cpp.Extension.Dev17.csproj)) +and a corresponding `` to the C++ vsixmanifest. + +There is no dotnet-new pack for C++/WinRT templates yet. diff --git a/dev/Templates/templates.props b/dev/Templates/templates.props new file mode 100644 index 0000000000..640ff68352 --- /dev/null +++ b/dev/Templates/templates.props @@ -0,0 +1,196 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + WinUI.Desktop.Cs.SingleProjectPackagedApp + $(MSBuildThisFileDirectory)Source\ProjectTemplates\Desktop\CSharp\SingleProjectPackagedApp + $(MSBuildThisFileDirectory)Dotnet\templates\blank-app + Package-managed.appxmanifest + + + + WinUI.Desktop.Cs.NavigationApp + $(MSBuildThisFileDirectory)Source\ProjectTemplates\Desktop\CSharp\NavigationApp + $(MSBuildThisFileDirectory)Dotnet\templates\navigation-app + Package-managed.appxmanifest + + + + WinUI.Desktop.Cs.ClassLibrary + $(MSBuildThisFileDirectory)Source\ProjectTemplates\Desktop\CSharp\ClassLibrary + $(MSBuildThisFileDirectory)Dotnet\templates\class-library + + + + + WinUI.Desktop.Cs.UnitTestApp + $(MSBuildThisFileDirectory)Source\ProjectTemplates\Desktop\CSharp\UnitTestApp + $(MSBuildThisFileDirectory)Dotnet\templates\unit-test + Package-managed.appxmanifest + + + + WinUI.Desktop.Cs.MvvmApp + $(MSBuildThisFileDirectory)Source\ProjectTemplates\Desktop\CSharp\MvvmApp + $(MSBuildThisFileDirectory)Dotnet\templates\mvvm-app + Package-managed.appxmanifest + + + + WinUI.Desktop.Cs.TabViewApp + $(MSBuildThisFileDirectory)Source\ProjectTemplates\Desktop\CSharp\TabViewApp + $(MSBuildThisFileDirectory)Dotnet\templates\tabview-app + Package-managed.appxmanifest + + + + + + + WinUI.Desktop.Cs.PackagedApp + $(MSBuildThisFileDirectory)Source\ProjectTemplates\Desktop\CSharp\PackagedApp + + + + + + + + + + WinUI.Desktop.Cs.BlankWindow + $(MSBuildThisFileDirectory)Source\ItemTemplates\Desktop\CSharp\BlankWindow + $(MSBuildThisFileDirectory)Dotnet\templates\item-blank-window + + + + WinUI.Neutral.Cs.BlankPage + $(MSBuildThisFileDirectory)Source\ItemTemplates\Neutral\CSharp\BlankPage + $(MSBuildThisFileDirectory)Dotnet\templates\item-blank-page + + + + WinUI.Neutral.Cs.ContentDialog + $(MSBuildThisFileDirectory)Source\ItemTemplates\Neutral\CSharp\ContentDialog + $(MSBuildThisFileDirectory)Dotnet\templates\item-content-dialog + + + + WinUI.Neutral.Cs.ResourceDictionary + $(MSBuildThisFileDirectory)Source\ItemTemplates\Neutral\CSharp\ResourceDictionary + $(MSBuildThisFileDirectory)Dotnet\templates\item-resource-dictionary + + + + WinUI.Neutral.Cs.Resw + $(MSBuildThisFileDirectory)Source\ItemTemplates\Neutral\CSharp\Resw + $(MSBuildThisFileDirectory)Dotnet\templates\item-resw + + + + WinUI.Neutral.Cs.TemplatedControl + $(MSBuildThisFileDirectory)Source\ItemTemplates\Neutral\CSharp\TemplatedControl + $(MSBuildThisFileDirectory)Dotnet\templates\item-templated-control + + + + WinUI.Neutral.Cs.UserControl + $(MSBuildThisFileDirectory)Source\ItemTemplates\Neutral\CSharp\UserControl + $(MSBuildThisFileDirectory)Dotnet\templates\item-user-control + + + + + + + + + + + diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/MainWindow.xaml.cs b/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/MainWindow.xaml.cs deleted file mode 100644 index ef074a16f3..0000000000 --- a/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/BlankApp/MainWindow.xaml.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Runtime.InteropServices.WindowsRuntime; -using Windows.Foundation; -using Windows.Foundation.Collections; -using Microsoft.UI.Xaml; -using Microsoft.UI.Xaml.Controls; -using Microsoft.UI.Xaml.Controls.Primitives; -using Microsoft.UI.Xaml.Data; -using Microsoft.UI.Xaml.Input; -using Microsoft.UI.Xaml.Media; -using Microsoft.UI.Xaml.Navigation; - -// To learn more about WinUI, the WinUI project structure, -// and more about our project templates, see: http://aka.ms/winui-project-info. - -namespace $safeprojectname$; - -/// -/// An empty window that can be used on its own or navigated to within a Frame. -/// -public sealed partial class MainWindow : Window -{ - public MainWindow() - { - InitializeComponent(); - } -} diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/WapProj/LockScreenLogo.scale-200.png b/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/WapProj/LockScreenLogo.scale-200.png deleted file mode 100644 index 7440f0d4bf..0000000000 Binary files a/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/WapProj/LockScreenLogo.scale-200.png and /dev/null differ diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/WapProj/SplashScreen.scale-200.png b/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/WapProj/SplashScreen.scale-200.png deleted file mode 100644 index 32f486a867..0000000000 Binary files a/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/WapProj/SplashScreen.scale-200.png and /dev/null differ diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/WapProj/Square150x150Logo.scale-200.png b/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/WapProj/Square150x150Logo.scale-200.png deleted file mode 100644 index 53ee3777ea..0000000000 Binary files a/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/WapProj/Square150x150Logo.scale-200.png and /dev/null differ diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/WapProj/Square44x44Logo.scale-200.png b/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/WapProj/Square44x44Logo.scale-200.png deleted file mode 100644 index f713bba67f..0000000000 Binary files a/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/WapProj/Square44x44Logo.scale-200.png and /dev/null differ diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/WapProj/Square44x44Logo.targetsize-24_altform-unplated.png b/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/WapProj/Square44x44Logo.targetsize-24_altform-unplated.png deleted file mode 100644 index dc9f5bea0c..0000000000 Binary files a/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/WapProj/Square44x44Logo.targetsize-24_altform-unplated.png and /dev/null differ diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/WapProj/StoreLogo.png b/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/WapProj/StoreLogo.png deleted file mode 100644 index a4586f26bd..0000000000 Binary files a/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/WapProj/StoreLogo.png and /dev/null differ diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/WapProj/Wide310x150Logo.scale-200.png b/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/WapProj/Wide310x150Logo.scale-200.png deleted file mode 100644 index 8b4a5d0dd5..0000000000 Binary files a/dev/VSIX/ProjectTemplates/Desktop/CSharp/PackagedApp/WapProj/Wide310x150Logo.scale-200.png and /dev/null differ diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Assets/LockScreenLogo.scale-200.png b/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Assets/LockScreenLogo.scale-200.png deleted file mode 100644 index 7440f0d4bf..0000000000 Binary files a/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Assets/LockScreenLogo.scale-200.png and /dev/null differ diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Assets/SplashScreen.scale-200.png b/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Assets/SplashScreen.scale-200.png deleted file mode 100644 index 32f486a867..0000000000 Binary files a/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Assets/SplashScreen.scale-200.png and /dev/null differ diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Assets/Square150x150Logo.scale-200.png b/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Assets/Square150x150Logo.scale-200.png deleted file mode 100644 index 53ee3777ea..0000000000 Binary files a/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Assets/Square150x150Logo.scale-200.png and /dev/null differ diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Assets/Square44x44Logo.scale-200.png b/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Assets/Square44x44Logo.scale-200.png deleted file mode 100644 index f713bba67f..0000000000 Binary files a/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Assets/Square44x44Logo.scale-200.png and /dev/null differ diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Assets/Square44x44Logo.targetsize-24_altform-unplated.png b/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Assets/Square44x44Logo.targetsize-24_altform-unplated.png deleted file mode 100644 index dc9f5bea0c..0000000000 Binary files a/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Assets/Square44x44Logo.targetsize-24_altform-unplated.png and /dev/null differ diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Assets/StoreLogo.png b/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Assets/StoreLogo.png deleted file mode 100644 index a4586f26bd..0000000000 Binary files a/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Assets/StoreLogo.png and /dev/null differ diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Assets/Wide310x150Logo.scale-200.png b/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Assets/Wide310x150Logo.scale-200.png deleted file mode 100644 index 8b4a5d0dd5..0000000000 Binary files a/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/Assets/Wide310x150Logo.scale-200.png and /dev/null differ diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/MainWindow.xaml b/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/MainWindow.xaml deleted file mode 100644 index 5c061d1cbf..0000000000 --- a/dev/VSIX/ProjectTemplates/Desktop/CSharp/SingleProjectPackagedApp/MainWindow.xaml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/Assets/LockScreenLogo.scale-200.png b/dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/Assets/LockScreenLogo.scale-200.png deleted file mode 100644 index 7440f0d4bf..0000000000 Binary files a/dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/Assets/LockScreenLogo.scale-200.png and /dev/null differ diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/Assets/SplashScreen.scale-200.png b/dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/Assets/SplashScreen.scale-200.png deleted file mode 100644 index 32f486a867..0000000000 Binary files a/dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/Assets/SplashScreen.scale-200.png and /dev/null differ diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/Assets/Square150x150Logo.scale-200.png b/dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/Assets/Square150x150Logo.scale-200.png deleted file mode 100644 index 53ee3777ea..0000000000 Binary files a/dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/Assets/Square150x150Logo.scale-200.png and /dev/null differ diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/Assets/Square44x44Logo.scale-200.png b/dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/Assets/Square44x44Logo.scale-200.png deleted file mode 100644 index f713bba67f..0000000000 Binary files a/dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/Assets/Square44x44Logo.scale-200.png and /dev/null differ diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/Assets/Square44x44Logo.targetsize-24_altform-unplated.png b/dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/Assets/Square44x44Logo.targetsize-24_altform-unplated.png deleted file mode 100644 index dc9f5bea0c..0000000000 Binary files a/dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/Assets/Square44x44Logo.targetsize-24_altform-unplated.png and /dev/null differ diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/Assets/StoreLogo.png b/dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/Assets/StoreLogo.png deleted file mode 100644 index a4586f26bd..0000000000 Binary files a/dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/Assets/StoreLogo.png and /dev/null differ diff --git a/dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/Assets/Wide310x150Logo.scale-200.png b/dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/Assets/Wide310x150Logo.scale-200.png deleted file mode 100644 index 8b4a5d0dd5..0000000000 Binary files a/dev/VSIX/ProjectTemplates/Desktop/CSharp/UnitTestApp/Assets/Wide310x150Logo.scale-200.png and /dev/null differ diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WapProj/LockScreenLogo.scale-200.png b/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WapProj/LockScreenLogo.scale-200.png deleted file mode 100644 index 7440f0d4bf..0000000000 Binary files a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WapProj/LockScreenLogo.scale-200.png and /dev/null differ diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WapProj/SplashScreen.scale-200.png b/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WapProj/SplashScreen.scale-200.png deleted file mode 100644 index 32f486a867..0000000000 Binary files a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WapProj/SplashScreen.scale-200.png and /dev/null differ diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WapProj/Square150x150Logo.scale-200.png b/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WapProj/Square150x150Logo.scale-200.png deleted file mode 100644 index 53ee3777ea..0000000000 Binary files a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WapProj/Square150x150Logo.scale-200.png and /dev/null differ diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WapProj/Square44x44Logo.scale-200.png b/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WapProj/Square44x44Logo.scale-200.png deleted file mode 100644 index f713bba67f..0000000000 Binary files a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WapProj/Square44x44Logo.scale-200.png and /dev/null differ diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WapProj/Square44x44Logo.targetsize-24_altform-unplated.png b/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WapProj/Square44x44Logo.targetsize-24_altform-unplated.png deleted file mode 100644 index dc9f5bea0c..0000000000 Binary files a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WapProj/Square44x44Logo.targetsize-24_altform-unplated.png and /dev/null differ diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WapProj/StoreLogo.png b/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WapProj/StoreLogo.png deleted file mode 100644 index a4586f26bd..0000000000 Binary files a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WapProj/StoreLogo.png and /dev/null differ diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WapProj/Wide310x150Logo.scale-200.png b/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WapProj/Wide310x150Logo.scale-200.png deleted file mode 100644 index 8b4a5d0dd5..0000000000 Binary files a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/PackagedApp/WapProj/Wide310x150Logo.scale-200.png and /dev/null differ diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/Assets/LockScreenLogo.scale-200.png b/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/Assets/LockScreenLogo.scale-200.png deleted file mode 100644 index 7440f0d4bf..0000000000 Binary files a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/Assets/LockScreenLogo.scale-200.png and /dev/null differ diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/Assets/SplashScreen.scale-200.png b/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/Assets/SplashScreen.scale-200.png deleted file mode 100644 index 32f486a867..0000000000 Binary files a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/Assets/SplashScreen.scale-200.png and /dev/null differ diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/Assets/Square150x150Logo.scale-200.png b/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/Assets/Square150x150Logo.scale-200.png deleted file mode 100644 index 53ee3777ea..0000000000 Binary files a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/Assets/Square150x150Logo.scale-200.png and /dev/null differ diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/Assets/Square44x44Logo.scale-200.png b/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/Assets/Square44x44Logo.scale-200.png deleted file mode 100644 index f713bba67f..0000000000 Binary files a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/Assets/Square44x44Logo.scale-200.png and /dev/null differ diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/Assets/Square44x44Logo.targetsize-24_altform-unplated.png b/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/Assets/Square44x44Logo.targetsize-24_altform-unplated.png deleted file mode 100644 index dc9f5bea0c..0000000000 Binary files a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/Assets/Square44x44Logo.targetsize-24_altform-unplated.png and /dev/null differ diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/Assets/StoreLogo.png b/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/Assets/StoreLogo.png deleted file mode 100644 index a4586f26bd..0000000000 Binary files a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/Assets/StoreLogo.png and /dev/null differ diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/Assets/Wide310x150Logo.scale-200.png b/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/Assets/Wide310x150Logo.scale-200.png deleted file mode 100644 index 8b4a5d0dd5..0000000000 Binary files a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/SingleProjectPackagedApp/Assets/Wide310x150Logo.scale-200.png and /dev/null differ diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/Assets/LockScreenLogo.scale-200.png b/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/Assets/LockScreenLogo.scale-200.png deleted file mode 100644 index 7440f0d4bf..0000000000 Binary files a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/Assets/LockScreenLogo.scale-200.png and /dev/null differ diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/Assets/SplashScreen.scale-200.png b/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/Assets/SplashScreen.scale-200.png deleted file mode 100644 index 32f486a867..0000000000 Binary files a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/Assets/SplashScreen.scale-200.png and /dev/null differ diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/Assets/Square150x150Logo.scale-200.png b/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/Assets/Square150x150Logo.scale-200.png deleted file mode 100644 index 53ee3777ea..0000000000 Binary files a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/Assets/Square150x150Logo.scale-200.png and /dev/null differ diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/Assets/Square44x44Logo.scale-200.png b/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/Assets/Square44x44Logo.scale-200.png deleted file mode 100644 index f713bba67f..0000000000 Binary files a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/Assets/Square44x44Logo.scale-200.png and /dev/null differ diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/Assets/Square44x44Logo.targetsize-24_altform-unplated.png b/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/Assets/Square44x44Logo.targetsize-24_altform-unplated.png deleted file mode 100644 index dc9f5bea0c..0000000000 Binary files a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/Assets/Square44x44Logo.targetsize-24_altform-unplated.png and /dev/null differ diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/Assets/StoreLogo.png b/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/Assets/StoreLogo.png deleted file mode 100644 index a4586f26bd..0000000000 Binary files a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/Assets/StoreLogo.png and /dev/null differ diff --git a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/Assets/Wide310x150Logo.scale-200.png b/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/Assets/Wide310x150Logo.scale-200.png deleted file mode 100644 index 8b4a5d0dd5..0000000000 Binary files a/dev/VSIX/ProjectTemplates/Desktop/CppWinRT/UnitTestApp/Assets/Wide310x150Logo.scale-200.png and /dev/null differ diff --git a/dev/WindowsAppRuntime_DLL/WindowsAppRuntime.def b/dev/WindowsAppRuntime_DLL/WindowsAppRuntime.def index c487bfd388..b3174e5b79 100644 --- a/dev/WindowsAppRuntime_DLL/WindowsAppRuntime.def +++ b/dev/WindowsAppRuntime_DLL/WindowsAppRuntime.def @@ -16,6 +16,7 @@ EXPORTS MddTryCreatePackageDependency MddLifetimeManagementGC MddLifetimeManagementTestInitialize + MddGetPackageGraphRevisionId MddGetGenerationId @@ -28,4 +29,6 @@ EXPORTS WindowsAppRuntime_VersionInfo_MSIX_Main_PackageFamilyName_Get WindowsAppRuntime_VersionInfo_TestInitialize + ContainmentTestInitialize + WindowsAppRuntime_EnsureIsLoaded diff --git a/installer/test/InstallerFunctionalTests/FunctionalTests.cpp b/installer/test/InstallerFunctionalTests/FunctionalTests.cpp index fb3116456c..d12e5d5b27 100644 --- a/installer/test/InstallerFunctionalTests/FunctionalTests.cpp +++ b/installer/test/InstallerFunctionalTests/FunctionalTests.cpp @@ -41,12 +41,23 @@ namespace WindowsAppRuntimeInstallerTests TEST_METHOD_SETUP(MethodInit) { RemoveAllPackages(); + if (!VerifyAllPackagesRemoved()) + { + Log::Error(L"TEST SETUP BLOCKED: Failed to remove pre-existing packages. " + L"This is a setup environment error, not a test failure. " + L"Packages may be in use by another process."); + return false; + } return true; } TEST_METHOD_CLEANUP(MethodUninit) { RemoveAllPackages(); + if (!VerifyAllPackagesRemoved()) + { + Log::Warning(L"Cleanup: some packages could not be removed. They may be in use."); + } return true; } diff --git a/installer/test/InstallerFunctionalTests/constants.h b/installer/test/InstallerFunctionalTests/constants.h index 58596a3bfe..bb3c1c92da 100644 --- a/installer/test/InstallerFunctionalTests/constants.h +++ b/installer/test/InstallerFunctionalTests/constants.h @@ -26,6 +26,8 @@ namespace WindowsAppRuntimeInstallerTests { static const int c_phaseTimeout{ (30 * 1000) }; // 30 seconds + static const int c_packageRemovalRetryCount{ 5 }; + static const int c_packageRemovalRetryDelayMs{ 5000 }; // 5 seconds (total: up to 25s) static const std::wstring c_x86FrameworkName{ L"WindowsAppRuntime.Test.InstallerFramework_1.0.0.0_x86__8wekyb3d8bbwe" }; static const std::wstring c_x64FrameworkName{ L"WindowsAppRuntime.Test.InstallerFramework_1.0.0.0_x64__8wekyb3d8bbwe" }; diff --git a/installer/test/InstallerFunctionalTests/helpers.cpp b/installer/test/InstallerFunctionalTests/helpers.cpp index 773759d367..88d44d4c26 100644 --- a/installer/test/InstallerFunctionalTests/helpers.cpp +++ b/installer/test/InstallerFunctionalTests/helpers.cpp @@ -58,11 +58,39 @@ namespace WindowsAppRuntimeInstallerTests { Log::Comment(WEX::Common::String().Format(L"Removing package: %ws", packageName.c_str())); PackageManager manager; - auto result{ manager.RemovePackageAsync(packageName).get() }; - Log::Comment(WEX::Common::String().Format(L"Removal result: 0x%0X", result.ExtendedErrorCode().value)); - if (!ignoreFailures) + + for (int attempt = 1; attempt <= c_packageRemovalRetryCount; ++attempt) { - winrt::check_hresult(result.ExtendedErrorCode()); + auto result{ manager.RemovePackageAsync(packageName).get() }; + const auto hr{ result.ExtendedErrorCode().value }; + Log::Comment(WEX::Common::String().Format(L"Removal result: 0x%0X (attempt %d/%d)", hr, attempt, c_packageRemovalRetryCount)); + + if (SUCCEEDED(hr)) + { + return; + } + + // If the package is not found, treat as success — nothing to remove. + if (hr == HRESULT_FROM_WIN32(ERROR_NOT_FOUND)) + { + Log::Comment(WEX::Common::String().Format(L"Package not found (already removed): %ws", packageName.c_str())); + return; + } + + // Retry on transient errors (package in use, etc.) unless this is the last attempt. + if (attempt < c_packageRemovalRetryCount) + { + Log::Warning(WEX::Common::String().Format(L"Retrying removal of package %ws after %dms (error: 0x%0X)", packageName.c_str(), c_packageRemovalRetryDelayMs, hr)); + Sleep(c_packageRemovalRetryDelayMs); + } + else if (!ignoreFailures) + { + winrt::check_hresult(result.ExtendedErrorCode()); + } + else + { + Log::Warning(WEX::Common::String().Format(L"Failed to remove package %ws after %d attempts (error: 0x%0X)", packageName.c_str(), c_packageRemovalRetryCount, hr)); + } } } @@ -90,6 +118,20 @@ namespace WindowsAppRuntimeInstallerTests } } + bool VerifyAllPackagesRemoved() + { + bool allRemoved{ true }; + for (const auto& packageName : c_packages) + { + if (IsPackageRegistered(packageName)) + { + Log::Warning(WEX::Common::String().Format(L"Setup error: package still registered after removal: %ws", packageName.c_str())); + allRemoved = false; + } + } + return allRemoved; + } + bool IsPackageRegistered(const std::wstring& packageFullName) { PackageManager manager; diff --git a/installer/test/InstallerFunctionalTests/helpers.h b/installer/test/InstallerFunctionalTests/helpers.h index 4efd181767..40c22d21e5 100644 --- a/installer/test/InstallerFunctionalTests/helpers.h +++ b/installer/test/InstallerFunctionalTests/helpers.h @@ -11,6 +11,7 @@ namespace WindowsAppRuntimeInstallerTests void RemovePackage(const std::wstring& packageFullName, bool ignoreFailures=true); void TryRemoveProvisionedPackage(const std::wstring& packageFamilyName); void RemoveAllPackages(bool ignoreFailures=true); + bool VerifyAllPackagesRemoved(); bool IsPackageRegistered(const std::wstring& packageFullName); winrt::Windows::System::ProcessorArchitecture GetSystemArchitecture(); std::filesystem::path GetModulePath(HMODULE hmodule = nullptr); diff --git a/specs/Compatibility/RuntimeCompatibilityOptions.md b/specs/Compatibility/RuntimeCompatibilityOptions.md index 5f4b876939..081eaf8453 100644 --- a/specs/Compatibility/RuntimeCompatibilityOptions.md +++ b/specs/Compatibility/RuntimeCompatibilityOptions.md @@ -25,6 +25,14 @@ A new `RuntimeCompatibilityOptions` class has APIs to control the behavior of se There are also properties which can be set in the app's project file to automatically use the new APIs with the specified values. +> **Authoring model (Containment v2).** Change IDs are registered in a WASDK-owned +> catalog and pre-pruned by `RuntimeCompatibilityOptions::Apply()`, so servicing +> engineers no longer need to name a target release branch at the callsite. See +> [WASDK-ContainmentV2-Plan.md](./WASDK-ContainmentV2-Plan.md) for the role +> boundaries (servicing engineer vs release engineer) and the staged rollout, and +> [RuntimeCompatibilityContainmentV2.md](../design/RuntimeCompatibilityContainmentV2.md) +> for the underlying design. + # API Pages ## RuntimeCompatibilityOptions class diff --git a/specs/Compatibility/WASDK-ContainmentV2-Plan.md b/specs/Compatibility/WASDK-ContainmentV2-Plan.md new file mode 100644 index 0000000000..52558536f6 --- /dev/null +++ b/specs/Compatibility/WASDK-ContainmentV2-Plan.md @@ -0,0 +1,147 @@ +# Containment v2 — rollout plan + +> **Status:** Rollout plan, tracking the implementation of [Runtime Compatibility Containment v2](../design/RuntimeCompatibilityContainmentV2.md). +> This document is the operational counterpart to the design doc: it records the staged PR sequence, the validation +> approach, and the role boundaries between servicing engineers and release engineers as the new model lands. + +## Goals (recap) + +The design proposal solves three problems with the existing per-callsite patch-version model: + +1. **Servicing engineers no longer need to know the containing release version.** New + `WINAPPSDK_CHANGE_*` macros expand to a bare change ID (no patch-version second + argument); the catalog in `RuntimeCompatibilityOptions.cpp` is what actually + associates change IDs to releases. +2. **Capturing change IDs at branch cut no longer churns the world.** Release engineering + adds a single per-release group to the catalog at branch cut; no callsite edits. +3. **`RuntimeCompatibilityOptions.idl` is untouched.** No API review; only enum values + added incrementally by the release engineer (no shape changes). +4. **The patch-version enum is owned by WinAppSDK, not by FrameworkUdk.** A new patch + release no longer requires a coordinated edit to os.2020's public header. FrUdk's + `Containment.h` exposes only the deprecated stub enum `WinAppSDKPatchVersionDeprecated` + (all enumerators collapse to `WinAppSDK_Unused = UINT32(-1)`, which guarantees the + `static_assert(patchVersion == 0, ...)` in the legacy 2-arg `IsChangeEnabled` template + fires for any leftover `IsChangeEnabled()` callsite while leaving + the default-initialized 1-arg form unaffected); the live release-version mapping + `enum class WinAppSDKReleaseVersion : UINT32` lives in the anonymous namespace of + `dev/RuntimeCompatibilityOptions/RuntimeCompatibilityOptions.cpp` and is scoped to + avoid name collisions with the FrUdk stub. The accompanying + `WinAppSDKReleaseVersionFromValues` helper is also local to that .cpp; nothing + outside the translation unit references either name. + +## Role boundaries + +| Role | Repo / file | What they do | What they never touch | +| --- | --- | --- | --- | +| **Servicing engineer** | os.2020 `onecoreuap\windows\FrameworkUdk\inc\public\Containment.h` (defines the bare ID) + the component source file (wraps the new behavior) | Adds one `#define WINAPPSDK_CHANGE_FOO id` macro (no patch-version arg); wraps the new behavior in `if (WinAppSdk::Containment::IsChangeEnabled())` | `RuntimeCompatibilityOptions.idl`, `RuntimeCompatibilityOptions.h`, `RuntimeCompatibilityOptions.cpp`, the catalog, the patch-version enum. Never names a release branch. | +| **Release engineer** | WindowsAppSDK `dev\RuntimeCompatibilityOptions\*` and `Microsoft.Windows.ApplicationModel.WindowsAppRuntime.RuntimeCompatibilityChange` IDL enum | At branch cut, adds a new `WinAppSDK_X_Y_Z` enumerator to the anonymous-namespace `enum class WinAppSDKReleaseVersion` inside `RuntimeCompatibilityOptions.cpp` (only if the catalog needs it), adds a `s_changes_X_Y_Z[]` array + corresponding `MakeGroup(...)` entry in `s_catalogGroupsProd[]`, and adds the corresponding IDL enum values | `Containment.h` (servicing engineer's territory; FrUdk stub enum never needs new enumerators again) | +| **App developer** | Their `.csproj` / `.vcxproj` | Sets `WindowsAppSDKRuntimePatchLevel1` / `WindowsAppSDKRuntimePatchLevel2` / `WindowsAppSDKDisabledChanges` as needed | Anything in the SDK source | + +## Staged PR sequence + +The work lands as four atomic changes, each safe to deploy independently. + +| # | Repo | Scope | What happens if any one piece is missed | +| --- | --- | --- | --- | +| 1 | WindowsAppSDK | **Foundation.** Catalog plumbing + `Apply` pre-prune + `std::sort` of the disabled list + new `ContainmentTestInitialize` test-only DLL export + the `CompatibilityTests.dll` test catalog + WASDK-owned scoped `enum class WinAppSDKReleaseVersion` + `WinAppSDKReleaseVersionFromValues` helper, both confined to the anonymous namespace of `dev/RuntimeCompatibilityOptions/RuntimeCompatibilityOptions.cpp` (no header export, no other TU references). `Apply` builds a local `runtimePatchLevel`, walks the catalog against it, and mirrors the result into `WinAppSDKRuntimeConfiguration::patchVersion` via an opaque `UINT32` cast (preserves the `SetConfiguration` identity-divergence check). `RuntimeCompatibilityOptions.h`, `CompatibilityTests.cpp`, and `CompatibilityTests.vcxproj` are untouched by PR 1 — the scoped enum is a private .cpp detail. | Nothing visible to apps. Catalog is empty on `main`; the only behavior change is that `Apply` now produces a sorted disabled list. The existing FrUdk worker (still linear scan) continues to behave correctly. Legacy `IsChangeEnabled` callsites are unchanged. | +| 2 | os.2020 (FrUdk) | **Worker perf + enum deprecation.** `Containment_GetChangeEnabled` switches from linear scan to `std::binary_search` (relying on PR 1's sort guarantee). `Containment.h` renames `WinAppSDKPatchVersion` to `WinAppSDKPatchVersionDeprecated`, adds `WinAppSDK_Unused = UINT32(-1)`, collapses all `WinAppSDK_3_*` enumerators to `WinAppSDK_Unused`, and removes `WinAppSDK_Latest`, `WinAppSDK_Security`, and `WinAppSDKPatchVersionFromValues`. The `static_assert(patchVersion == 0, ...)` deprecation message is unchanged; setting `WinAppSDK_Unused` to `UINT32(-1)` (rather than `0`) deliberately tips the static_assert for any leftover 2-arg `IsChangeEnabled()` callsite while leaving the default-initialized 1-arg form alone. os.2020-internal 2-arg callsites migrate to the 1-arg form. Single atomic commit. | os.2020 build break (the `static_assert` fires on any leftover 2-arg callsite naming any non-zero enumerator, and undefined-identifier errors fire on any callsite naming `WinAppSDK_Latest` / `WinAppSDK_Security` / removed `WinAppSDK_M_m_p` constants). Hence the migration ships in the same commit. | +| 3 | WindowsAppSDK | **FrUdk bump (`main`).** Bumps `Microsoft.FrameworkUdk` in `eng\Version.Details.xml` to pull in PR 2. `main`'s WASDK code is already prepared by PR 1 (private scoped enum in the .cpp, no public test-side surface), so the only churn is the version bump itself. No production WASDK callsites on `main` use the 2-arg form. | WASDK `main` build break (same `static_assert` / undefined identifier) on the bumped header without PR 1 in place. | +| 4 | WindowsAppSDK | **Cherry-pick to `release/2.0-stable`.** Brings the PR 1 foundation (catalog plumbing + private scoped enum, with the enum populated for the 2.x patch versions the 2.0 catalog references). The populated `s_catalogGroupsProd[]` on `2.0-stable` already encodes the `ApplicationData.GetForUnpackaged()` (`61684930`) and `MRT module-specific PRI discovery` (`62382643`) IDs under the `WinAppSDK_2_1_5` group, so callsites that switch from 2-arg to 1-arg `IsChangeEnabled` retain identical runtime behavior. The 2-arg `, WinAppSDK_2_1_5` second argument is left in place in `dev\ApplicationData\M.W.S.ApplicationData.cpp` and `dev\MRTCore\…\Helper.cpp` until the 2.0 train picks up the FrUdk PR 2 bump (whose `IsChangeEnabled` template adds a `WinAppSDKPatchVersionDeprecated patchVersion = {}` default; pre-bump FrUdk has no such default, so a bare 1-arg call fails to compile). | None — this PR is behavior-preserving on its own. | +| 4b | WindowsAppSDK (follow-up) | **2.0 FrUdk bump + macro migration.** Bumps `Microsoft.FrameworkUdk` on `release/2.0-stable` to pull in PR 2, and in the same commit drops `, WinAppSDK_2_1_5` from the two macros above. The catalog from PR 4 already covers both IDs, so the 1-arg `IsChangeEnabled()` call still returns the same result; the `static_assert(patchVersion == 0)` from PR 2 keeps the file honest in the future. | The FrUdk bump alone would otherwise break the build (undefined identifier on `WinAppSDK_2_1_5` from the macro expansions). | + +### Why this beats the original four-phase sequence + +Earlier revisions of this plan staged a three-phase rollout that added a new 1-arg +`IsChangeEnabled()` template to FrameworkUdk alongside the existing 2-arg one, with a +deprecation pragma on the 2-arg form. The `0`-patch-version sentinel design (see +[Runtime Compatibility Containment v2](../design/RuntimeCompatibilityContainmentV2.md)) +eliminates the new template entirely: new macros expand to bare change IDs and the +existing 2-arg template defaults `patchVersion = 0`; the worker's per-callsite patch +check has been removed entirely (in favor of pre-pruning in `Apply`), and the +disabled-list check alone decides. That collapses "add new template + migrate +callsites" into "add catalog + sort + pre-prune in Apply" with no public FrUdk API +shape change. PR 2's `static_assert` is purely a quality-gate to keep future macros +honest; it has nothing to do with ABI. + +A second simplification adopted later: the patch-version enum itself moves from FrUdk +into WinAppSDK, and is *not* exported from a header — it lives only in the anonymous +namespace of `RuntimeCompatibilityOptions.cpp`. FrUdk's `WinAppSDKPatchVersionDeprecated` +stub is frozen — it never needs another enumerator. New `WinAppSDK_X_Y_Z` constants +are added only to WASDK's private `enum class WinAppSDKReleaseVersion`, and only when +the catalog actually needs them. This eliminates the cross-repo enum-edit coordination +that the previous shape required for every patch release, and avoids the name-collision +risk that would arise if WASDK re-exported the same enumerator names that FrUdk's +unscoped legacy enum still carries. + +## Validation status (as of this PR) + +End-to-end test pass in both worktrees: + +- **`main`** worktree (catalog empty): 6/6 `CompatibilityTests` pass — `CanSetRuntimeCompatibilityOptions`, + `VerifyNoMatchingPatchLevelBehavior`, `VerifyConflictingPatchLevelBehavior`, `VerifyDisabledChanges`, + `VerifyCatalogPrePrunesByPatchLevel`, `VerifyCatalogAndExplicitDisabledChangesCombine`. +- **`release/2.0-stable`** worktree (catalog populated with 8 production IDs across the + `WinAppSDK_2_1_0` and `WinAppSDK_2_1_5` groups): 6/6 pass. + +### Test catalog (foundation PR) + +`CompatibilityTests` exercises catalog pre-pruning through a synthetic two-group test catalog +swapped in by `ContainmentTestInitialize(true)`: + +* `s_enabled_changes_test = { 1, 2, 3 }` at `WinAppSDKPatchVersion::WinAppSDK_Latest - 1`. + `releaseVersion` is **not** greater than the runtime's effective patch level under the + default `WinAppSDKRuntimeConfiguration` (`Apply` resolves an unspecified patch level to + `WinAppSDKPatchVersion::WinAppSDK_Latest`), so Apply prunes the group **out** of + `disabledChanges`. These IDs remain **enabled** at runtime. +* `s_disabled_changes_test = { 0, 99999999 }` at `WinAppSDKPatchVersion::WinAppSDK_Latest + 1`. + `releaseVersion` **is** greater than the effective patch level, so Apply preserves the + group **in** `disabledChanges`. These IDs are **disabled** at runtime. + +The synthetic IDs (`0`, `1`, `2`, `3`, `99999999`) span the value range so that `std::sort` +in Apply and `std::binary_search` in the FrUdk worker are exercised at both ends. +`VerifyCatalogPrePrunesByPatchLevel` asserts both branches. +`VerifyCatalogAndExplicitDisabledChangesCombine` covers the union of explicit +`DisabledChanges` and the catalog-pruned list. Tests use the 1-arg `IsChangeEnabled()` +form because the worker no longer compares per-callsite patch versions. + +### Notable engineering details + +* **`Apply()` patch-level guard.** Both `PatchLevel1` / `PatchLevel2` branches are guarded + with `(Major != 0 || Minor != 0 || Patch != 0)` so a default-initialized + `WindowsAppRuntimeVersion {0,0,0}` does not collapse `runtimePatchLevel` to `0` in + dev builds (where `WINDOWSAPPSDK_RELEASE_MAJOR / MINOR = 0 / 0`). Without this guard + every dev-build test that does not explicitly set a patch level would behave as if the + app had pinned to `0.0.0`, defeating the catalog tests. +* **`config.patchVersion` is an opaque pass-through.** `Apply` computes the effective + patch as a WASDK-owned `WinAppSDKPatchVersion runtimePatchLevel`, walks the catalog + against it, then mirrors the resolved value into the ABI-locked + `WinAppSDKRuntimeConfiguration::patchVersion` field via + `static_cast(static_cast(runtimePatchLevel))`. + FrUdk's `Containment_GetChangeEnabled` no longer reads the field, but + `Containment_SetConfiguration` still uses it as part of the identity check that + detects attempts to apply a divergent configuration twice from the same process. +* **Scoped WASDK enum to prevent name collision.** Both FrUdk's + `WinAppSDKPatchVersionDeprecated` and WASDK's `WinAppSDKPatchVersion` would otherwise + define `WinAppSDK_3_0_0` etc. in the same TU. WASDK's `enum class` qualification + (`WinAppSDKPatchVersion::WinAppSDK_3_0_0`) keeps them disjoint while preserving the + natural reading at the catalog call sites. +* **`ContainmentTestInitialize` is resolved via `GetModuleHandleW` / `GetProcAddress`, + not via a static import.** `RuntimeCompatibilityOptions::Apply` runs in the + framework-package copy of `Microsoft.WindowsAppRuntime.dll` loaded by the bootstrap. + The catalog globals live in that same module instance, so the test must call + `ContainmentTestInitialize` on that DLL handle — a static import would resolve to a + test-folder copy with its own (production) catalog and the catalog swap would have no + observable effect. +* **Delay-load on `Microsoft.WindowsAppRuntime.dll`.** Linking the test against + `Microsoft.WindowsAppRuntime.lib` brings in an implicit static import for + `ContainmentTestInitialize`. `Microsoft.WindowsAppRuntime.dll` + plus `delayimp.lib` defers that resolution until the bootstrap has loaded the + framework-package copy. The benign `LNK4199 ... no imports found` warning emitted today + is the desired state and confirms the cleanup; the directive is left in place as + defensive cover against future regressions. + +## Open follow-ups + +* Telemetry on `Apply` — log every catalog-disabled and explicitly-disabled change ID so + the customer-impact distribution becomes observable. Tracked in `// TODO: Telemetry!` in + `RuntimeCompatibilityOptions.cpp`. diff --git a/test/Compatibility/CompatibilityTests/CompatibilityTests.cpp b/test/Compatibility/CompatibilityTests/CompatibilityTests.cpp index b8fa2632e2..bf71dce871 100644 --- a/test/Compatibility/CompatibilityTests/CompatibilityTests.cpp +++ b/test/Compatibility/CompatibilityTests/CompatibilityTests.cpp @@ -7,6 +7,21 @@ #include #include +// Signature of the test-only DLL export from Microsoft.WindowsAppRuntime.dll. +// Switches the WinAppSDK Containment catalog used by RuntimeCompatibilityOptions::Apply() +// between the production catalog (default) and a test-only catalog whose two groups +// straddle WinAppSDK_Latest: an "enabled" group at WinAppSDK_Latest - 1 holding +// {1, 2, 3} that Apply prunes out of disabledChanges, and a "disabled" group at +// WinAppSDK_Latest + 1 holding {0, 99999999} that Apply preserves in disabledChanges. +// +// The export is resolved via GetModuleHandleW/GetProcAddress (not a static import) +// because RuntimeCompatibilityOptions::Apply runs in the framework-package copy of +// Microsoft.WindowsAppRuntime.dll loaded by the bootstrap. The catalog globals live +// in that same module instance, so the test must call ContainmentTestInitialize on +// that DLL handle - a static import would resolve to a test-folder copy with its +// own (production) catalog and the catalog swap would have no observable effect. +using PFN_ContainmentTestInitialize = HRESULT(STDAPICALLTYPE*)(bool) noexcept; + namespace TB = ::Test::Bootstrap; namespace TP = ::Test::Packages; @@ -14,6 +29,25 @@ namespace WAR = winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime; namespace Test::CompatibilityTests { + // Resolve ContainmentTestInitialize from the bootstrap-loaded framework copy + // of Microsoft.WindowsAppRuntime.dll. Must be called AFTER SetupBootstrap so + // the DLL is present in the process module list. + static HRESULT ContainmentTestInitialize(bool enableTest) noexcept + { + HMODULE const hmod{ ::GetModuleHandleW(L"Microsoft.WindowsAppRuntime.dll") }; + if (hmod == nullptr) + { + return HRESULT_FROM_WIN32(::GetLastError()); + } + auto const pfn{ reinterpret_cast( + ::GetProcAddress(hmod, "ContainmentTestInitialize")) }; + if (pfn == nullptr) + { + return HRESULT_FROM_WIN32(::GetLastError()); + } + return pfn(enableTest); + } + class CompatibilityTests { public: @@ -42,12 +76,24 @@ namespace Test::CompatibilityTests // The test method setup and execution is on a different thread than the class setup. // Initialize the framework for the test thread. ::Test::Bootstrap::SetupBootstrap(); + + // Swap in the test-only catalog so the catalog pre-prune tests + // observe the synthetic groups that straddle WinAppSDK_Latest. + // Must be done after SetupBootstrap so the framework copy of + // Microsoft.WindowsAppRuntime.dll is loaded and reachable via + // GetModuleHandleW; that copy is the one that hosts + // RuntimeCompatibilityOptions::Apply and owns the catalog globals. + VERIFY_ARE_EQUAL(S_OK, ContainmentTestInitialize(true)); return true; } TEST_METHOD_CLEANUP(MethodUninit) { VERIFY_IS_TRUE(TP::IsPackageRegistered_WindowsAppRuntimeFramework()); + // Restore the production catalog before tearing down the bootstrap. + // IsolationLevel="Method" already guarantees a fresh process per test, + // but resetting keeps the contract clean. + VERIFY_ARE_EQUAL(S_OK, ContainmentTestInitialize(false)); ::Test::Bootstrap::CleanupBootstrap(); return true; } @@ -146,5 +192,61 @@ namespace Test::CompatibilityTests // A different value not in DisabledChanges should remain enabled. VERIFY_IS_TRUE((WinAppSdk::Containment::IsChangeEnabled<99999, WinAppSDK_Security>())); } + + TEST_METHOD(VerifyCatalogPrePrunesByPatchLevel) + { + // The test catalog has two groups whose releaseVersion straddles + // the runtime's effective patch level (WinAppSDK_Latest by + // default): + // * s_enabled_changes_test at WinAppSDK_Latest - 1: the + // pre-prune walk SKIPS this group, so {1, 2, 3} remain + // enabled. + // * s_disabled_changes_test at WinAppSDK_Latest + 1: the + // pre-prune walk COPIES this group into disabledChanges, + // so {0, 99999999} are disabled. + // Together the two groups span the value range and exercise + // both branches of the catalog walk, both ends of std::sort, + // and both ends of the FrUdk worker's std::binary_search. + winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime::RuntimeCompatibilityOptions options; + options.Apply(); + + // Use WinAppSDK_Security as the template-arg patch so the worker's + // per-callsite patch comparison degenerates to (0 > effective) = false, + // isolating the catalog pre-prune as the disabling mechanism. + + // s_enabled_changes_test: catalog group released BEFORE the + // effective patch level. Apply prunes it out; IDs remain enabled. + VERIFY_IS_TRUE((WinAppSdk::Containment::IsChangeEnabled<1, WinAppSDK_Security>())); + VERIFY_IS_TRUE((WinAppSdk::Containment::IsChangeEnabled<2, WinAppSDK_Security>())); + VERIFY_IS_TRUE((WinAppSdk::Containment::IsChangeEnabled<3, WinAppSDK_Security>())); + + // s_disabled_changes_test: catalog group released AFTER the + // effective patch level. Apply preserves it; IDs are disabled. + VERIFY_IS_FALSE((WinAppSdk::Containment::IsChangeEnabled<0, WinAppSDK_Security>())); // smallest representable ID + VERIFY_IS_FALSE((WinAppSdk::Containment::IsChangeEnabled<99999999, WinAppSDK_Security>())); // high-value sentinel + + // An ID not in the catalog and not explicitly disabled stays enabled. + VERIFY_IS_TRUE((WinAppSdk::Containment::IsChangeEnabled<99999, WinAppSDK_Security>())); + } + + TEST_METHOD(VerifyCatalogAndExplicitDisabledChangesCombine) + { + // Catalog pre-prune contributes {0, 99999999} via + // s_disabled_changes_test (the catalog group released AFTER the + // effective patch level), and the app's explicit DisabledChanges + // also names 99999999 plus 55555. Duplicates between the two + // sources are harmless: the FrUdk worker treats disabledChanges + // as a sorted set and uses set-membership semantics, so the + // result is the union, not a tally. + winrt::Microsoft::Windows::ApplicationModel::WindowsAppRuntime::RuntimeCompatibilityOptions options; + options.DisabledChanges().Append((WAR::RuntimeCompatibilityChange)99999999); + options.DisabledChanges().Append((WAR::RuntimeCompatibilityChange)55555); + options.Apply(); + + VERIFY_IS_FALSE((WinAppSdk::Containment::IsChangeEnabled<0, WinAppSDK_Security>())); // catalog only + VERIFY_IS_FALSE((WinAppSdk::Containment::IsChangeEnabled<99999999, WinAppSDK_Security>())); // catalog + explicit + VERIFY_IS_FALSE((WinAppSdk::Containment::IsChangeEnabled<55555, WinAppSDK_Security>())); // explicit only + VERIFY_IS_TRUE((WinAppSdk::Containment::IsChangeEnabled<99999, WinAppSDK_Security>())); // neither + } }; } diff --git a/test/Compatibility/CompatibilityTests/CompatibilityTests.vcxproj b/test/Compatibility/CompatibilityTests/CompatibilityTests.vcxproj index 8edeb3908c..805e71ab5b 100644 --- a/test/Compatibility/CompatibilityTests/CompatibilityTests.vcxproj +++ b/test/Compatibility/CompatibilityTests/CompatibilityTests.vcxproj @@ -79,8 +79,18 @@ Windows - onecore.lib;onecoreuap.lib;Microsoft.WindowsAppRuntime.lib;wex.common.lib;wex.logger.lib;te.common.lib;%(AdditionalDependencies) + onecore.lib;onecoreuap.lib;Microsoft.WindowsAppRuntime.lib;wex.common.lib;wex.logger.lib;te.common.lib;delayimp.lib;%(AdditionalDependencies) $(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories);$(OutDir)\..\WindowsAppRuntime_DLL + + Microsoft.WindowsAppRuntime.dll;%(DelayLoadDLLs) diff --git a/test/ModifySampleAppsReferences.ps1 b/test/ModifySampleAppsReferences.ps1 index e90cefb06a..af95090680 100644 --- a/test/ModifySampleAppsReferences.ps1 +++ b/test/ModifySampleAppsReferences.ps1 @@ -41,9 +41,25 @@ Get-ChildItem -Recurse Directory.Packages.props -Path $SampleRepoRoot | foreach- foreach ($nugetPackageToVersion in $packagesToUpdateTable.GetEnumerator()) { - $newVersionString = 'PackageVersion Include="' + $nugetPackageToVersion.Key + '" Version="' + $nugetPackageToVersion.Value + '"' - $oldVersionString = 'PackageVersion Include="' + $nugetPackageToVersion.Key + '" Version="[-.0-9a-zA-Z]*"' - $content = $content -replace $oldVersionString, $newVersionString + $packageId = $nugetPackageToVersion.Key + $packageVersion = $nugetPackageToVersion.Value + $newVersionString = 'PackageVersion Include="' + $packageId + '" Version="' + $packageVersion + '"' + $oldVersionPattern = 'PackageVersion Include="' + [regex]::Escape($packageId) + '" Version="[-.0-9a-zA-Z]*"' + + if ($content -match $oldVersionPattern) + { + $content = $content -replace $oldVersionPattern, $newVersionString + } + else + { + # Missing entry: insert into the first ItemGroup. Ensures transitive + # Foundation dependencies (e.g. Microsoft.WindowsAppSDK.Base) get a + # centrally-managed PackageVersion matching Foundation; otherwise NuGet + # sees a downgrade and SamplesCompatTest fails with NU1605. + $insertion = "`r`n <" + $newVersionString + ' />' + $content = [regex]::Replace($content, '(]*>)', '$1' + $insertion, 1) + Write-Host "Inserted PackageVersion for $packageId ($packageVersion) into $($_.FullName)" + } } Set-Content -Path $_.FullName -Value $content