Переглянути джерело

Replace custom targets for generating assembly attributes and source control info by using SDK features (#7504)

Nate McMaster 7 роки тому
батько
коміт
2ac4619635
31 змінених файлів з 155 додано та 105 видалено
  1. 1 1
      .azure/pipelines/ci.yml
  2. 38 18
      Directory.Build.props
  3. 1 0
      Directory.Build.targets
  4. 4 4
      build/Maestro/Maestro.csproj
  5. 1 1
      build/SharedFx.targets
  6. 0 1
      build/repo.targets
  7. 4 1
      dockerbuild.sh
  8. 2 0
      eng/Versions.props
  9. 6 0
      eng/Workarounds.targets
  10. 16 0
      eng/targets/CSharp.Common.props
  11. 29 1
      eng/targets/CSharp.Common.targets
  12. 13 0
      eng/targets/Packaging.targets
  13. 2 2
      eng/targets/Wix.Common.props
  14. 0 17
      src/Azure/AzureAD/Authentication.AzureAD.UI/src/Microsoft.AspNetCore.Authentication.AzureAD.UI.csproj
  15. 0 17
      src/Azure/AzureAD/Authentication.AzureADB2C.UI/src/Microsoft.AspNetCore.Authentication.AzureADB2C.UI.csproj
  16. 1 1
      src/Components/Blazor/Build/src/Microsoft.AspNetCore.Blazor.Build.csproj
  17. 1 1
      src/Components/Blazor/Cli/src/Microsoft.AspNetCore.Blazor.Cli.csproj
  18. 1 1
      src/Components/Blazor/Templates/src/SetPackageProperties.targets
  19. 1 1
      src/Components/Build/src/Microsoft.AspNetCore.Components.Build.csproj
  20. 3 3
      src/Framework/src/SharedFx.targets
  21. 5 5
      src/Framework/test/Microsoft.AspNetCore.App.UnitTests.csproj
  22. 0 18
      src/Identity/UI/src/Microsoft.AspNetCore.Identity.UI.csproj
  23. 1 0
      src/Installers/Archive/Archive.Internal.zipproj
  24. 1 0
      src/Installers/Archive/Archive.Redist.zipproj
  25. 1 0
      src/Installers/Windows/AspNetCoreModule-Setup/CustomAction/aspnetcoreCA.vcxproj
  26. 8 0
      src/MusicStore/Directory.Build.props
  27. 1 1
      src/Mvc/src/Microsoft.AspNetCore.Mvc.Analyzers/Microsoft.AspNetCore.Mvc.Analyzers.csproj
  28. 1 1
      src/Mvc/src/Microsoft.AspNetCore.Mvc.Api.Analyzers/Microsoft.AspNetCore.Mvc.Api.Analyzers.csproj
  29. 1 1
      src/Mvc/src/Microsoft.Extensions.ApiDescription.Design/Microsoft.Extensions.ApiDescription.Design.csproj
  30. 1 1
      src/ProjectTemplates/SetPackageProperties.targets
  31. 11 8
      version.props

+ 1 - 1
.azure/pipelines/ci.yml

@@ -263,7 +263,7 @@ jobs:
     jobDisplayName: "Build: Linux Musl x64"
     jobDisplayName: "Build: Linux Musl x64"
     agentOs: Linux
     agentOs: Linux
     buildScript: ./dockerbuild.sh alpine
     buildScript: ./dockerbuild.sh alpine
-    buildArgs: --ci --pack --all -e KOREBUILD_SKIP_INSTALL_NETFX=0 --arch x64 --os-name linux-musl --no-build-nodejs --no-build-java -p:RepositoryBranch=$(Build.SourceBranchName)
+    buildArgs: --ci --pack --all -e KOREBUILD_SKIP_INSTALL_NETFX=0 --arch x64 --os-name linux-musl --no-build-nodejs --no-build-java
     installNodeJs: false
     installNodeJs: false
     afterBuild:
     afterBuild:
     # Remove packages that are not rid-specific.
     # Remove packages that are not rid-specific.

+ 38 - 18
Directory.Build.props

@@ -15,15 +15,6 @@
     <PackageLicenseUrl>https://raw.githubusercontent.com/aspnet/AspNetCore/2.0.0/LICENSE.txt</PackageLicenseUrl>
     <PackageLicenseUrl>https://raw.githubusercontent.com/aspnet/AspNetCore/2.0.0/LICENSE.txt</PackageLicenseUrl>
     <!-- The SPDX name for the source license. See https://spdx.org/licenses/. -->
     <!-- The SPDX name for the source license. See https://spdx.org/licenses/. -->
     <PackageLicenseType>Apache-2.0</PackageLicenseType>
     <PackageLicenseType>Apache-2.0</PackageLicenseType>
-    <!--
-      Suppress a warning about upcoming deprecation of PackageLicenseUrl. When embedding licenses are supported,
-      replace PackageLicenseUrl with PackageLicenseExpression.
-    -->
-    <NoWarn>$(NoWarn);NU5125</NoWarn>
-    <!-- Suppress warnings about using SemVer 2.0. -->
-    <NoWarn>$(NoWarn);NU5105</NoWarn>
-    <!-- Don't make missing XML docs a fatal build error, but still surface so we have visibility into undocumented APIs. -->
-    <WarningsNotAsErrors>$(WarningsNotAsErrors);CS1591</WarningsNotAsErrors>
 
 
     <!-- Contact email address for NuGet packages and Linux installers. -->
     <!-- Contact email address for NuGet packages and Linux installers. -->
     <MaintainerEmail>[email protected]</MaintainerEmail>
     <MaintainerEmail>[email protected]</MaintainerEmail>
@@ -42,6 +33,22 @@
     <SharedFxDescription>Shared Framework for hosting of Microsoft ASP.NET Core applications. It is open source, cross-platform and is supported by Microsoft. We hope you enjoy using it! If you do, please consider joining the active community of developers that are contributing to the project on GitHub ($(RepositoryUrl)). We happily accept issues and PRs.</SharedFxDescription>
     <SharedFxDescription>Shared Framework for hosting of Microsoft ASP.NET Core applications. It is open source, cross-platform and is supported by Microsoft. We hope you enjoy using it! If you do, please consider joining the active community of developers that are contributing to the project on GitHub ($(RepositoryUrl)). We happily accept issues and PRs.</SharedFxDescription>
   </PropertyGroup>
   </PropertyGroup>
 
 
+  <!-- Warnings and errors -->
+  <PropertyGroup>
+    <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
+    <!--
+      Suppress NuGet warning about upcoming deprecation of PackageLicenseUrl. When embedding licenses are supported,
+      replace PackageLicenseUrl with PackageLicenseExpression.
+    -->
+    <NoWarn>$(NoWarn);NU5125</NoWarn>
+    <!-- Suppress NuGet warnings about using SemVer 2.0. -->
+    <NoWarn>$(NoWarn);NU5105</NoWarn>
+    <!-- Don't make missing XML docs a fatal build error, but still surface so we have visibility into undocumented APIs. -->
+    <WarningsNotAsErrors>$(WarningsNotAsErrors);CS1591</WarningsNotAsErrors>
+    <!-- xUnit1004 = warns about skipped tests. Make this a non-fatal build warning. -->
+    <WarningsNotAsErrors>$(WarningsNotAsErrors);xUnit1004</WarningsNotAsErrors>
+  </PropertyGroup>
+
   <!-- Source code settings -->
   <!-- Source code settings -->
   <PropertyGroup>
   <PropertyGroup>
     <RepositoryRoot>$(MSBuildThisFileDirectory)</RepositoryRoot>
     <RepositoryRoot>$(MSBuildThisFileDirectory)</RepositoryRoot>
@@ -49,13 +56,23 @@
     <RepositoryType>git</RepositoryType>
     <RepositoryType>git</RepositoryType>
     <SharedSourceRoot>$(MSBuildThisFileDirectory)src\Shared\</SharedSourceRoot>
     <SharedSourceRoot>$(MSBuildThisFileDirectory)src\Shared\</SharedSourceRoot>
     <GoogleTestSubmoduleRoot>$(RepositoryRoot)src\submodules\googletest\</GoogleTestSubmoduleRoot>
     <GoogleTestSubmoduleRoot>$(RepositoryRoot)src\submodules\googletest\</GoogleTestSubmoduleRoot>
+    <!-- Embed source files that are not tracked by the source control manager in the PDB. -->
+    <EmbedUntrackedSources>true</EmbedUntrackedSources>
+    <!-- Additional assembly attributes are already configured to include the source revision ID. -->
+    <IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
+
+    <!-- These project types are disabled because the presence of a PackageReference causes issues for NuGet. -->
+    <DisableSourceLink Condition="'$(MSBuildProjectExtension)' == '.zipproj' OR '$(MSBuildProjectExtension)' == '.debproj' OR '$(MSBuildProjectExtension)' == '.rpmproj'">true</DisableSourceLink>
   </PropertyGroup>
   </PropertyGroup>
 
 
+  <ItemGroup Condition="'$(DisableSourceLink)' != 'true'">
+    <!-- See https://github.com/dotnet/sourcelink -->
+    <PackageReference Include="Microsoft.SourceLink.GitHub" Version="$(MicrosoftSourceLinkGitHubPackageVersion)" PrivateAssets="All" AllowExplicitReference="true" />
+    <PackageReference Include="Microsoft.SourceLink.Vsts.Git" Version="$(MicrosoftSourceLinkVstsGitPackageVersion)" PrivateAssets="All" AllowExplicitReference="true" />
+  </ItemGroup>
+
   <!-- Compilation options which apply to all languages. Language-specific options should be set in eng/targets/$(lang).Common.props -->
   <!-- Compilation options which apply to all languages. Language-specific options should be set in eng/targets/$(lang).Common.props -->
   <PropertyGroup>
   <PropertyGroup>
-    <AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)eng\AspNetCore.snk</AssemblyOriginatorKeyFile>
-    <SignAssembly>true</SignAssembly>
-    <TreatWarningsAsErrors>true</TreatWarningsAsErrors>
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
     <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
     <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
     <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
     <PlatformName Condition=" '$(PlatformName)' == '' ">$(Platform)</PlatformName>
     <PlatformName Condition=" '$(PlatformName)' == '' ">$(Platform)</PlatformName>
@@ -77,16 +94,14 @@
       linux-arm64
       linux-arm64
     </SupportedRuntimeIdentifiers>
     </SupportedRuntimeIdentifiers>
 
 
-    <!-- Instructs the compiler to use SHA256 instead of SHA1 when adding file hashes to PDBs. -->
-    <ChecksumAlgorithm>SHA256</ChecksumAlgorithm>
+    <!-- Make error messages clickable in VS Code's console -->
+    <GenerateFullPaths Condition="'$(VSCODE_PID)' != ''">true</GenerateFullPaths>
+
     <!-- Suppress the message about using a preview version of .NET Core SDK. We are okay with this and don't need the warning. -->
     <!-- Suppress the message about using a preview version of .NET Core SDK. We are okay with this and don't need the warning. -->
     <SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
     <SuppressNETCoreSdkPreviewMessage>true</SuppressNETCoreSdkPreviewMessage>
 
 
     <!-- Fixes a common error in targets implementing a NoBuild mode. -->
     <!-- Fixes a common error in targets implementing a NoBuild mode. -->
     <BuildProjectReferences Condition=" '$(NoBuild)' == 'true' ">false</BuildProjectReferences>
     <BuildProjectReferences Condition=" '$(NoBuild)' == 'true' ">false</BuildProjectReferences>
-
-    <!-- Enables Strict mode for Roslyn compiler -->
-    <Features>strict</Features>
   </PropertyGroup>
   </PropertyGroup>
 
 
   <Import Project="eng\Versions.props" />
   <Import Project="eng\Versions.props" />
@@ -139,12 +154,17 @@
     <IsTestAssetProject Condition="$(RepoRelativeProjectDir.Contains('testassets'))">true</IsTestAssetProject>
     <IsTestAssetProject Condition="$(RepoRelativeProjectDir.Contains('testassets'))">true</IsTestAssetProject>
     <IsSampleProject Condition="$(RepoRelativeProjectDir.Contains('sample'))">true</IsSampleProject>
     <IsSampleProject Condition="$(RepoRelativeProjectDir.Contains('sample'))">true</IsSampleProject>
     <IsAnalyzersProject Condition="$(MSBuildProjectName.EndsWith('.Analyzers'))">true</IsAnalyzersProject>
     <IsAnalyzersProject Condition="$(MSBuildProjectName.EndsWith('.Analyzers'))">true</IsAnalyzersProject>
-    <DisableDeterministicSourceRoot Condition="'$(IsSampleProject)' == 'true' OR '$(IsTestAssetProject)' == 'true'">true</DisableDeterministicSourceRoot>
   </PropertyGroup>
   </PropertyGroup>
 
 
   <Import Project="build\tasks\RepoTasks.tasks" Condition="'$(MSBuildProjectName)' != 'RepoTasks' AND '$(DesignTimeBuild)' != 'true'" />
   <Import Project="build\tasks\RepoTasks.tasks" Condition="'$(MSBuildProjectName)' != 'RepoTasks' AND '$(DesignTimeBuild)' != 'true'" />
 
 
   <PropertyGroup>
   <PropertyGroup>
+    <ContinuousIntegrationBuild Condition="'$(CI)' == 'true'">true</ContinuousIntegrationBuild>
+    <!--
+      Disable deterministic source paths in test assets and samples.
+      In order for the debugger to find source files when debugging a locally built binary the PDB must contain original, unmapped local paths
+    -->
+    <DeterministicSourcePaths Condition="'$(IsSampleProject)' == 'true' OR '$(IsTestAssetProject)' == 'true'">false</DeterministicSourcePaths>
     <!-- Projects which reference Microsoft.AspNetCore.Mvc.Testing should import this targets file to ensure dependency .deps.json files are copied into test output. -->
     <!-- Projects which reference Microsoft.AspNetCore.Mvc.Testing should import this targets file to ensure dependency .deps.json files are copied into test output. -->
     <MvcTestingTargets>$(MSBuildThisFileDirectory)src\Mvc\src\Microsoft.AspNetCore.Mvc.Testing\Microsoft.AspNetCore.Mvc.Testing.targets</MvcTestingTargets>
     <MvcTestingTargets>$(MSBuildThisFileDirectory)src\Mvc\src\Microsoft.AspNetCore.Mvc.Testing\Microsoft.AspNetCore.Mvc.Testing.targets</MvcTestingTargets>
     <!-- IIS native projects can only be built on Windows for x86 and x64. -->
     <!-- IIS native projects can only be built on Windows for x86 and x64. -->

+ 1 - 0
Directory.Build.targets

@@ -67,6 +67,7 @@
     <BuildHelixPayload Condition="'$(BuildHelixPayload)' == '' AND '$(IsTestProject)' == 'true'">true</BuildHelixPayload>
     <BuildHelixPayload Condition="'$(BuildHelixPayload)' == '' AND '$(IsTestProject)' == 'true'">true</BuildHelixPayload>
   </PropertyGroup>
   </PropertyGroup>
 
 
+  <Import Project="eng\Workarounds.targets" />
   <Import Project="eng\targets\ResolveIisReferences.targets" Condition=" '$(MSBuildProjectExtension)' != '.vcxproj' " />
   <Import Project="eng\targets\ResolveIisReferences.targets" Condition=" '$(MSBuildProjectExtension)' != '.vcxproj' " />
   <Import Project="eng\targets\Cpp.Common.targets"  Condition="'$(MSBuildProjectExtension)' == '.vcxproj'" />
   <Import Project="eng\targets\Cpp.Common.targets"  Condition="'$(MSBuildProjectExtension)' == '.vcxproj'" />
   <Import Project="eng\targets\CSharp.Common.targets"  Condition="'$(MSBuildProjectExtension)' == '.csproj'" />
   <Import Project="eng\targets\CSharp.Common.targets"  Condition="'$(MSBuildProjectExtension)' == '.csproj'" />

+ 4 - 4
build/Maestro/Maestro.csproj

@@ -23,15 +23,15 @@
   </Target>
   </Target>
 
 
   <Target Name="GenerateBuildAssetManifest"
   <Target Name="GenerateBuildAssetManifest"
-          DependsOnTargets="GetFilesToPublish;ResolveRepositoryBranch;ResolveCommitHash">
+          DependsOnTargets="GetFilesToPublish">
 
 
     <GenerateBuildManifest
     <GenerateBuildManifest
       Artifacts="@(PackageToPublish)"
       Artifacts="@(PackageToPublish)"
       OutputPath="$(ManifestsPath)aspnetcore-$(TargetRuntimeIdentifier)-$(PackageVersion).xml"
       OutputPath="$(ManifestsPath)aspnetcore-$(TargetRuntimeIdentifier)-$(PackageVersion).xml"
       BuildId="$(PackageVersion)"
       BuildId="$(PackageVersion)"
-      RepoUri="$(RepositoryUrl)"
-      RepoBranch="$(RepositoryBranch)"
-      RepoCommit="$(RepositoryCommit)" />
+      RepoUri="$(BUILD_REPOSITORY_URI)"
+      RepoBranch="$(BUILD_SOURCEBRANCH)"
+      RepoCommit="$(BUILD_SOURCEVERSION)" />
   </Target>
   </Target>
 
 
 </Project>
 </Project>

+ 1 - 1
build/SharedFx.targets

@@ -21,7 +21,7 @@
 
 
   <Target Name="BuildSharedFx" DependsOnTargets="$(BuildSharedFxDependsOn)" />
   <Target Name="BuildSharedFx" DependsOnTargets="$(BuildSharedFxDependsOn)" />
 
 
-  <Target Name="_BuildSharedFxProjects" DependsOnTargets="ResolveCommitHash">
+  <Target Name="_BuildSharedFxProjects">
 
 
     <PropertyGroup>
     <PropertyGroup>
       <_RestoreGraphProjectInput>@(FxProjectToBuild)</_RestoreGraphProjectInput>
       <_RestoreGraphProjectInput>@(FxProjectToBuild)</_RestoreGraphProjectInput>

+ 0 - 1
build/repo.targets

@@ -2,7 +2,6 @@
   <Import Project="AzureIntegration.targets" />
   <Import Project="AzureIntegration.targets" />
   <Import Project="SharedFx.targets" />
   <Import Project="SharedFx.targets" />
   <Import Project="CodeSign.targets" />
   <Import Project="CodeSign.targets" />
-  <Import Project="..\eng\Workarounds.targets" />
 
 
   <PropertyGroup>
   <PropertyGroup>
     <!-- Some projects need access to tasks bundled in KoreBuild. -->
     <!-- Some projects need access to tasks bundled in KoreBuild. -->

+ 4 - 1
dockerbuild.sh

@@ -98,7 +98,7 @@ fi
 commit_hash="$(git rev-parse HEAD || true)"
 commit_hash="$(git rev-parse HEAD || true)"
 
 
 if [ ! -z "$commit_hash" ]; then
 if [ ! -z "$commit_hash" ]; then
-    build_args[${#build_args[*]}]="-p:RepositoryCommit=$commit_hash"
+    build_args[${#build_args[*]}]="-p:SourceRevisionId=$commit_hash"
 fi
 fi
 
 
 dockerfile="$DIR/build/docker/$image.Dockerfile"
 dockerfile="$DIR/build/docker/$image.Dockerfile"
@@ -118,6 +118,9 @@ docker run \
     -e TEAMCITY_VERSION \
     -e TEAMCITY_VERSION \
     -e BUILD_NUMBER \
     -e BUILD_NUMBER \
     -e BUILD_BUILDNUMBER \
     -e BUILD_BUILDNUMBER \
+    -e BUILD_REPOSITORY_URI \
+    -e BUILD_SOURCEVERSION \
+    -e BUILD_SOURCEBRANCH \
     -e DOTNET_CLI_TELEMETRY_OPTOUT \
     -e DOTNET_CLI_TELEMETRY_OPTOUT \
     -e Configuration \
     -e Configuration \
     -v "$DIR:/code/build" \
     -v "$DIR:/code/build" \

+ 2 - 0
eng/Versions.props

@@ -130,6 +130,8 @@
     <InternalAspNetCoreSdkPackageVersion Condition=" '$(KoreBuildVersion)' == '' ">3.0.0-build-20190130.1</InternalAspNetCoreSdkPackageVersion>
     <InternalAspNetCoreSdkPackageVersion Condition=" '$(KoreBuildVersion)' == '' ">3.0.0-build-20190130.1</InternalAspNetCoreSdkPackageVersion>
     <MicrosoftNETFrameworkReferenceAssembliesPackageVersion>1.0.0-alpha-004</MicrosoftNETFrameworkReferenceAssembliesPackageVersion>
     <MicrosoftNETFrameworkReferenceAssembliesPackageVersion>1.0.0-alpha-004</MicrosoftNETFrameworkReferenceAssembliesPackageVersion>
     <MicrosoftNETTestSdkPackageVersion>15.9.0</MicrosoftNETTestSdkPackageVersion>
     <MicrosoftNETTestSdkPackageVersion>15.9.0</MicrosoftNETTestSdkPackageVersion>
+    <MicrosoftSourceLinkGitHubPackageVersion>1.0.0-beta2-18618-05</MicrosoftSourceLinkGitHubPackageVersion>
+    <MicrosoftSourceLinkVstsGitPackageVersion>1.0.0-beta2-18618-05</MicrosoftSourceLinkVstsGitPackageVersion>
     <!-- Stable dotnet/corefx packages no longer updated for .NET Core 3 -->
     <!-- Stable dotnet/corefx packages no longer updated for .NET Core 3 -->
     <SystemBuffersPackageVersion>4.5.0</SystemBuffersPackageVersion>
     <SystemBuffersPackageVersion>4.5.0</SystemBuffersPackageVersion>
     <SystemCodeDomPackageVersion>4.4.0</SystemCodeDomPackageVersion>
     <SystemCodeDomPackageVersion>4.4.0</SystemCodeDomPackageVersion>

+ 6 - 0
eng/Workarounds.targets

@@ -1,3 +1,9 @@
 <!-- Use this file to workaround issues. List the issue tracking the item to fix so we can remove the workaround when the issue is resolved. -->
 <!-- Use this file to workaround issues. List the issue tracking the item to fix so we can remove the workaround when the issue is resolved. -->
 <Project>
 <Project>
+
+  <!-- Workaround https://github.com/aspnet/AspNetCore/issues/7503. This chains GenerateSourceLinkFile before razor component targets run. -->
+  <Target Name="_EnsureSourceLinkHappensBeforeRazorComponentGeneration"
+          BeforeTargets="PrepareForRazorComponentGenerate"
+          DependsOnTargets="GenerateSourceLinkFile" />
+
 </Project>
 </Project>

+ 16 - 0
eng/targets/CSharp.Common.props

@@ -2,6 +2,22 @@
 
 
   <PropertyGroup>
   <PropertyGroup>
     <LangVersion>7.3</LangVersion>
     <LangVersion>7.3</LangVersion>
+
+    <AssemblyOriginatorKeyFile>$(MSBuildThisFileDirectory)..\AspNetCore.snk</AssemblyOriginatorKeyFile>
+    <SignAssembly>true</SignAssembly>
+
+     <!-- Instructs the compiler to use SHA256 instead of SHA1 when adding file hashes to PDBs. -->
+    <ChecksumAlgorithm>SHA256</ChecksumAlgorithm>
+
+    <!-- Enables Strict mode for Roslyn compiler -->
+    <Features>strict</Features>
+
+    <!-- Disables targets in Internal.AspNetCore.Sdk which are obsolete. -->
+    <GenerateSourceLinkFile>false</GenerateSourceLinkFile>
+    <GenerateRepositoryCommitUrlInDescription>false</GenerateRepositoryCommitUrlInDescription>
+    <GenerateCommitHashAttribute>false</GenerateCommitHashAttribute>
+    <GenerateInternalAspNetCoreAttributes>false</GenerateInternalAspNetCoreAttributes>
+    <DisableDeterministicSourceRoot>true</DisableDeterministicSourceRoot>
   </PropertyGroup>
   </PropertyGroup>
 
 
   <ItemGroup>
   <ItemGroup>

+ 29 - 1
eng/targets/CSharp.Common.targets

@@ -5,7 +5,35 @@
     <TargetFramework>net$(TargetFrameworkVersion.Substring(1).Replace('.',''))</TargetFramework>
     <TargetFramework>net$(TargetFrameworkVersion.Substring(1).Replace('.',''))</TargetFramework>
     <TargetFrameworkIdentifier>.NETFramework</TargetFrameworkIdentifier>
     <TargetFrameworkIdentifier>.NETFramework</TargetFrameworkIdentifier>
   </PropertyGroup>
   </PropertyGroup>
-  
+
+  <Target Name="GetCustomAssemblyAttributes"
+          BeforeTargets="GetAssemblyAttributes"
+          DependsOnTargets="InitializeSourceControlInformation">
+
+    <ItemGroup>
+      <AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute" Condition="'$(SourceRevisionId)' != ''">
+        <_Parameter1>CommitHash</_Parameter1>
+        <_Parameter2>$(SourceRevisionId)</_Parameter2>
+      </AssemblyAttribute>
+
+      <AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute" Condition="$(RepositoryUrl.StartsWith('https://github.com'))">
+        <_Parameter1>SourceCommitUrl</_Parameter1>
+        <_Parameter2>$(RepositoryUrl)/tree/$(SourceRevisionId)</_Parameter2>
+      </AssemblyAttribute>
+
+      <AssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute" Condition="'$(Serviceable)' == 'true'">
+        <_Parameter1>Serviceable</_Parameter1>
+        <_Parameter2>True</_Parameter2>
+      </AssemblyAttribute>
+    </ItemGroup>
+  </Target>
+
+  <Target Name="GetCustomFileVersion" BeforeTargets="GetAssemblyVersion">
+    <PropertyGroup Condition="'$(FileVerison)' == '' AND '$(FileRevisionVersion)' != ''">
+      <FileVersion>$(VersionPrefix).$(FileRevisionVersion)</FileVersion>
+    </PropertyGroup>
+  </Target>
+
   <Import Project="Packaging.targets" />
   <Import Project="Packaging.targets" />
   <Import Project="ResolveReferences.targets" />
   <Import Project="ResolveReferences.targets" />
 </Project>
 </Project>

+ 13 - 0
eng/targets/Packaging.targets

@@ -19,4 +19,17 @@
     </ItemGroup>
     </ItemGroup>
   </Target>
   </Target>
 
 
+  <PropertyGroup>
+    <GenerateNuspecDependsOn>$(GenerateNuspecDependsOn);_AppendRepostoryUrlToPackageDescription</GenerateNuspecDependsOn>
+  </PropertyGroup>
+
+  <Target Name="_AppendRepostoryUrlToPackageDescription"
+    DependsOnTargets="InitializeSourceControlInformation">
+    <PropertyGroup Condition="'$(RepositoryUrl)' != '' AND '$(SourceRevisionId)' != ''">
+      <PackageDescription>$(PackageDescription)
+
+This package was built from the source code at $(RepositoryUrl)/tree/$(SourceRevisionId)</PackageDescription>
+    </PropertyGroup>
+  </Target>
+
 </Project>
 </Project>

+ 2 - 2
eng/targets/Wix.Common.props

@@ -8,8 +8,8 @@
   </PropertyGroup>
   </PropertyGroup>
 
 
   <PropertyGroup>
   <PropertyGroup>
-    <!-- Required to make NuGet happy -->
-    <TargetFramework>net461</TargetFramework>
+    <TargetFrameworkMoniker>Native,Version=v0.0</TargetFrameworkMoniker>
+
     <MSBuildProjectExtensionsPath>$(BaseIntermediateOutputPath)</MSBuildProjectExtensionsPath>
     <MSBuildProjectExtensionsPath>$(BaseIntermediateOutputPath)</MSBuildProjectExtensionsPath>
     <MSBuildProjectExtensionsPath Condition="'$(MSBuildProjectExtensionsPath)' == ''">$(MSBuildProjectDir)\obj\</MSBuildProjectExtensionsPath>
     <MSBuildProjectExtensionsPath Condition="'$(MSBuildProjectExtensionsPath)' == ''">$(MSBuildProjectDir)\obj\</MSBuildProjectExtensionsPath>
     <!-- IsRunningFromVisualStudio may be true even when running msbuild.exe from command line. This generally means that MSBUild is Visual Studio installation and therefore we need to find NuGet.targets in a different location.  -->
     <!-- IsRunningFromVisualStudio may be true even when running msbuild.exe from command line. This generally means that MSBUild is Visual Studio installation and therefore we need to find NuGet.targets in a different location.  -->

+ 0 - 17
src/Azure/AzureAD/Authentication.AzureAD.UI/src/Microsoft.AspNetCore.Authentication.AzureAD.UI.csproj

@@ -22,21 +22,4 @@
     <Reference Include="Microsoft.NET.Sdk.Razor" PrivateAssets="All" />
     <Reference Include="Microsoft.NET.Sdk.Razor" PrivateAssets="All" />
   </ItemGroup>
   </ItemGroup>
 
 
-    <ItemGroup>
-     <RazorAssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute" Condition="'$(BuildNumber)' != ''">
-       <_Parameter1>BuildNumber</_Parameter1>
-       <_Parameter2>$(BuildNumber)</_Parameter2>
-     </RazorAssemblyAttribute>
-
-     <RazorTargetAssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute" Condition="'$(BuildNumber)' != ''">
-       <_Parameter1>BuildNumber</_Parameter1>
-       <_Parameter2>$(BuildNumber)</_Parameter2>
-     </RazorTargetAssemblyAttribute>
-   </ItemGroup>
-
-   <ItemGroup>
-     <RazorCompile Include="$(GeneratedCommitHashAttributeFile)" />
-     <RazorCompile Include="$(GeneratedInternalAspNetCoreAttributeFile)" />
-   </ItemGroup>
-
 </Project>
 </Project>

+ 0 - 17
src/Azure/AzureAD/Authentication.AzureADB2C.UI/src/Microsoft.AspNetCore.Authentication.AzureADB2C.UI.csproj

@@ -22,21 +22,4 @@
     <Reference Include="Microsoft.NET.Sdk.Razor" PrivateAssets="All" />
     <Reference Include="Microsoft.NET.Sdk.Razor" PrivateAssets="All" />
   </ItemGroup>
   </ItemGroup>
 
 
-    <ItemGroup>
-     <RazorAssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute" Condition="'$(BuildNumber)' != ''">
-       <_Parameter1>BuildNumber</_Parameter1>
-       <_Parameter2>$(BuildNumber)</_Parameter2>
-     </RazorAssemblyAttribute>
-
-    <RazorTargetAssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute" Condition="'$(BuildNumber)' != ''">
-       <_Parameter1>BuildNumber</_Parameter1>
-       <_Parameter2>$(BuildNumber)</_Parameter2>
-     </RazorTargetAssemblyAttribute>
-   </ItemGroup>
-
-   <ItemGroup>
-     <RazorCompile Include="$(GeneratedCommitHashAttributeFile)" />
-     <RazorCompile Include="$(GeneratedInternalAspNetCoreAttributeFile)" />
-   </ItemGroup>
-
 </Project>
 </Project>

+ 1 - 1
src/Components/Blazor/Build/src/Microsoft.AspNetCore.Blazor.Build.csproj

@@ -28,7 +28,7 @@
       componentsversion=$(ComponentsPackageVersion);
       componentsversion=$(ComponentsPackageVersion);
       razorversion=$(MicrosoftAspNetCoreRazorDesignPackageVersion);
       razorversion=$(MicrosoftAspNetCoreRazorDesignPackageVersion);
       blazormonoversion=$(MicrosoftAspNetCoreBlazorMonoPackageVersion);
       blazormonoversion=$(MicrosoftAspNetCoreBlazorMonoPackageVersion);
-      repositorycommit=$(RepositoryCommit);</NuspecProperties>
+      repositorycommit=$(SourceRevisionId);</NuspecProperties>
     </PropertyGroup>
     </PropertyGroup>
     <ItemGroup>
     <ItemGroup>
       <_TargetFramework Include="$(TargetFramework)" />
       <_TargetFramework Include="$(TargetFramework)" />

+ 1 - 1
src/Components/Blazor/Cli/src/Microsoft.AspNetCore.Blazor.Cli.csproj

@@ -35,7 +35,7 @@
         blazorversion=$(PackageVersion);
         blazorversion=$(PackageVersion);
         aspnetcoreversion=$(ComponentsPackageVersion);
         aspnetcoreversion=$(ComponentsPackageVersion);
         sharedfxversion=$(SharedFxVersion);
         sharedfxversion=$(SharedFxVersion);
-        repositorycommit=$(RepositoryCommit);</NuspecProperties>
+        repositorycommit=$(SourceRevisionId);</NuspecProperties>
     </PropertyGroup>
     </PropertyGroup>
     <!-- Also temporarily generate the runtimeconfig.json manually until we can use <FrameworkReference> -->
     <!-- Also temporarily generate the runtimeconfig.json manually until we can use <FrameworkReference> -->
     <Sdk_GenerateFileFromTemplate
     <Sdk_GenerateFileFromTemplate

+ 1 - 1
src/Components/Blazor/Templates/src/SetPackageProperties.targets

@@ -22,7 +22,7 @@
         IncludeCustomRestoreSources=$(IncludeCustomRestoreSourcesValue);
         IncludeCustomRestoreSources=$(IncludeCustomRestoreSourcesValue);
         TemplateBlazorVersion=$(PackageVersion);
         TemplateBlazorVersion=$(PackageVersion);
         TemplateComponentsVersion=$(ComponentsPackageVersion);
         TemplateComponentsVersion=$(ComponentsPackageVersion);
-        RepositoryCommit=$(RepositoryCommit);
+        RepositoryCommit=$(SourceRevisionId);
       </GeneratedContentProperties>
       </GeneratedContentProperties>
     </PropertyGroup>
     </PropertyGroup>
   </Target>
   </Target>

+ 1 - 1
src/Components/Build/src/Microsoft.AspNetCore.Components.Build.csproj

@@ -17,7 +17,7 @@
     <PropertyGroup>
     <PropertyGroup>
       <NuspecProperties>
       <NuspecProperties>
         version=$(PackageVersion);
         version=$(PackageVersion);
-        repositorycommit=$(RepositoryCommit);
+        repositorycommit=$(SourceRevisionId);
       </NuspecProperties>
       </NuspecProperties>
     </PropertyGroup>
     </PropertyGroup>
   </Target>
   </Target>

+ 3 - 3
src/Framework/src/SharedFx.targets

@@ -174,9 +174,9 @@ This targets file should only be imported by .shfxproj files.
   </Target>
   </Target>
 
 
   <!-- Generates the .version file in the shared framework -->
   <!-- Generates the .version file in the shared framework -->
-  <Target Name="GenerateSharedFxVersionsFile">
+  <Target Name="GenerateSharedFxVersionsFile" DependsOnTargets="InitializeSourceControlInformation">
     <ItemGroup>
     <ItemGroup>
-      <VersionLines Include="$(RepositoryCommit)" />
+      <VersionLines Include="$(SourceRevisionId)" />
       <VersionLines Include="$(PackageVersion)" />
       <VersionLines Include="$(PackageVersion)" />
     </ItemGroup>
     </ItemGroup>
 
 
@@ -369,7 +369,7 @@ This targets file should only be imported by .shfxproj files.
         projectUrl=$(PackageProjectUrl);
         projectUrl=$(PackageProjectUrl);
         iconUrl=$(PackageIconUrl);
         iconUrl=$(PackageIconUrl);
         repositoryUrl=$(RepositoryUrl);
         repositoryUrl=$(RepositoryUrl);
-        repositoryCommit=$(RepositoryCommit);
+        repositoryCommit=$(SourceRevisionId);
         copyright=$(Copyright);
         copyright=$(Copyright);
         targetFramework=$(TargetFramework);
         targetFramework=$(TargetFramework);
         symbolsAssets=$([MSBuild]::NormalizeDirectory($(SymbolsOutputPath)));
         symbolsAssets=$([MSBuild]::NormalizeDirectory($(SymbolsOutputPath)));

+ 5 - 5
src/Framework/test/Microsoft.AspNetCore.App.UnitTests.csproj

@@ -14,10 +14,6 @@
       <_Parameter1>TargetRuntimeIdentifier</_Parameter1>
       <_Parameter1>TargetRuntimeIdentifier</_Parameter1>
       <_Parameter2>$(TargetRuntimeIdentifier)</_Parameter2>
       <_Parameter2>$(TargetRuntimeIdentifier)</_Parameter2>
     </AssemblyAttribute>
     </AssemblyAttribute>
-    <AssemblyAttribute Include="Microsoft.AspNetCore.TestData">
-      <_Parameter1>RepositoryCommit</_Parameter1>
-      <_Parameter2>$(RepositoryCommit)</_Parameter2>
-    </AssemblyAttribute>
     <AssemblyAttribute Include="Microsoft.AspNetCore.TestData">
     <AssemblyAttribute Include="Microsoft.AspNetCore.TestData">
       <_Parameter1>MicrosoftNETCoreAppPackageVersion</_Parameter1>
       <_Parameter1>MicrosoftNETCoreAppPackageVersion</_Parameter1>
       <_Parameter2>$(RuntimeFrameworkVersion)</_Parameter2>
       <_Parameter2>$(RuntimeFrameworkVersion)</_Parameter2>
@@ -35,8 +31,12 @@
     </ProjectReference>
     </ProjectReference>
   </ItemGroup>
   </ItemGroup>
 
 
-  <Target Name="GenerateTestData" BeforeTargets="GetAssemblyAttributes" DependsOnTargets="ResolveProjectReferences">
+  <Target Name="GenerateTestData" BeforeTargets="GetAssemblyAttributes" DependsOnTargets="ResolveProjectReferences;InitializeSourceControlInformation">
     <ItemGroup>
     <ItemGroup>
+      <AssemblyAttribute Include="Microsoft.AspNetCore.TestData">
+        <_Parameter1>RepositoryCommit</_Parameter1>
+        <_Parameter2>$(SourceRevisionId)</_Parameter2>
+      </AssemblyAttribute>
       <AssemblyAttribute Include="Microsoft.AspNetCore.TestData">
       <AssemblyAttribute Include="Microsoft.AspNetCore.TestData">
         <_Parameter1>SharedFxDependencies</_Parameter1>
         <_Parameter1>SharedFxDependencies</_Parameter1>
         <_Parameter2>@(AspNetCoreAppReference);@(AspNetCoreAppReferenceAndPackage);@(ExternalAspNetCoreAppReference);@(_TransitiveExternalAspNetCoreAppReference)</_Parameter2>
         <_Parameter2>@(AspNetCoreAppReference);@(AspNetCoreAppReferenceAndPackage);@(ExternalAspNetCoreAppReference);@(_TransitiveExternalAspNetCoreAppReference)</_Parameter2>

+ 0 - 18
src/Identity/UI/src/Microsoft.AspNetCore.Identity.UI.csproj

@@ -38,24 +38,6 @@
     <Reference Include="Microsoft.NET.Sdk.Razor" PrivateAssets="All" />
     <Reference Include="Microsoft.NET.Sdk.Razor" PrivateAssets="All" />
   </ItemGroup>
   </ItemGroup>
 
 
-  <ItemGroup>
-
-    <RazorAssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute" Condition="'$(BuildNumber)' != ''">
-      <_Parameter1>BuildNumber</_Parameter1>
-      <_Parameter2>$(BuildNumber)</_Parameter2>
-    </RazorAssemblyAttribute>
-
-    <RazorTargetAssemblyAttribute Include="System.Reflection.AssemblyMetadataAttribute" Condition="'$(BuildNumber)' != ''">
-      <_Parameter1>BuildNumber</_Parameter1>
-      <_Parameter2>$(BuildNumber)</_Parameter2>
-    </RazorTargetAssemblyAttribute>
-  </ItemGroup>
-
-  <ItemGroup>
-    <RazorCompile Include="$(GeneratedCommitHashAttributeFile)" />
-    <RazorCompile Include="$(GeneratedInternalAspNetCoreAttributeFile)" />
-  </ItemGroup>
-
   <ItemGroup>
   <ItemGroup>
     <UIFrameworkVersionMoniker Include="V3" />
     <UIFrameworkVersionMoniker Include="V3" />
     <UIFrameworkVersionMoniker Include="V4" />
     <UIFrameworkVersionMoniker Include="V4" />

+ 1 - 0
src/Installers/Archive/Archive.Internal.zipproj

@@ -17,6 +17,7 @@
 
 
   <ItemGroup>
   <ItemGroup>
     <ProjectReference Include="..\..\Framework\src\Microsoft.AspNetCore.App.shfxproj">
     <ProjectReference Include="..\..\Framework\src\Microsoft.AspNetCore.App.shfxproj">
+      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
       <SkipGetTargetFrameworkProperties>true</SkipGetTargetFrameworkProperties>
       <SkipGetTargetFrameworkProperties>true</SkipGetTargetFrameworkProperties>
       <OutputItemType>_ResolvedFxProjects</OutputItemType>
       <OutputItemType>_ResolvedFxProjects</OutputItemType>
     </ProjectReference>
     </ProjectReference>

+ 1 - 0
src/Installers/Archive/Archive.Redist.zipproj

@@ -26,6 +26,7 @@
 
 
   <ItemGroup>
   <ItemGroup>
     <ProjectReference Include="..\..\Framework\src\Microsoft.AspNetCore.App.shfxproj">
     <ProjectReference Include="..\..\Framework\src\Microsoft.AspNetCore.App.shfxproj">
+      <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
       <SkipGetTargetFrameworkProperties>true</SkipGetTargetFrameworkProperties>
       <SkipGetTargetFrameworkProperties>true</SkipGetTargetFrameworkProperties>
       <OutputItemType>_ResolvedFxProjects</OutputItemType>
       <OutputItemType>_ResolvedFxProjects</OutputItemType>
     </ProjectReference>
     </ProjectReference>

+ 1 - 0
src/Installers/Windows/AspNetCoreModule-Setup/CustomAction/aspnetcoreCA.vcxproj

@@ -3,6 +3,7 @@
 
 
   <PropertyGroup>
   <PropertyGroup>
     <ANCM-Setup Condition="$(ANCM-Setup) == ''">$(MSBuildThisFileDirectory)..\</ANCM-Setup>
     <ANCM-Setup Condition="$(ANCM-Setup) == ''">$(MSBuildThisFileDirectory)..\</ANCM-Setup>
+    <EnableSourceLink>false</EnableSourceLink>
   </PropertyGroup>
   </PropertyGroup>
 
 
   <PropertyGroup>
   <PropertyGroup>

+ 8 - 0
src/MusicStore/Directory.Build.props

@@ -0,0 +1,8 @@
+<Project>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory)..\, Directory.Build.props))\Directory.Build.props" />
+
+  <PropertyGroup>
+    <!-- Some of the tests make assertions which require symbols to map exactly back to the source root. -->
+    <DeterministicSourcePaths>false</DeterministicSourcePaths>
+  </PropertyGroup>
+</Project>

+ 1 - 1
src/Mvc/src/Microsoft.AspNetCore.Mvc.Analyzers/Microsoft.AspNetCore.Mvc.Analyzers.csproj

@@ -28,7 +28,7 @@
         projectUrl=$(PackageProjectUrl);
         projectUrl=$(PackageProjectUrl);
         iconUrl=$(PackageIconUrl);
         iconUrl=$(PackageIconUrl);
         repositoryUrl=$(RepositoryUrl);
         repositoryUrl=$(RepositoryUrl);
-        repositoryCommit=$(RepositoryCommit);
+        repositoryCommit=$(SourceRevisionId);
         copyright=$(Copyright);
         copyright=$(Copyright);
 
 
         OutputBinary=$(OutputPath)$(AssemblyName).dll;
         OutputBinary=$(OutputPath)$(AssemblyName).dll;

+ 1 - 1
src/Mvc/src/Microsoft.AspNetCore.Mvc.Api.Analyzers/Microsoft.AspNetCore.Mvc.Api.Analyzers.csproj

@@ -33,7 +33,7 @@
         projectUrl=$(PackageProjectUrl);
         projectUrl=$(PackageProjectUrl);
         iconUrl=$(PackageIconUrl);
         iconUrl=$(PackageIconUrl);
         repositoryUrl=$(RepositoryUrl);
         repositoryUrl=$(RepositoryUrl);
-        repositoryCommit=$(RepositoryCommit);
+        repositoryCommit=$(SourceRevisionId);
         copyright=$(Copyright);
         copyright=$(Copyright);
 
 
         OutputBinary=$(OutputPath)$(AssemblyName).dll;
         OutputBinary=$(OutputPath)$(AssemblyName).dll;

+ 1 - 1
src/Mvc/src/Microsoft.Extensions.ApiDescription.Design/Microsoft.Extensions.ApiDescription.Design.csproj

@@ -46,7 +46,7 @@
         licenseUrl=$(PackageLicenseUrl);
         licenseUrl=$(PackageLicenseUrl);
         owners=$(Company);
         owners=$(Company);
         projectUrl=$(PackageProjectUrl);
         projectUrl=$(PackageProjectUrl);
-        repositoryCommit=$(RepositoryCommit);
+        repositoryCommit=$(SourceRevisionId);
         repositoryUrl=$(RepositoryUrl);
         repositoryUrl=$(RepositoryUrl);
         tags=$(PackageTags.Replace(';', ' '));
         tags=$(PackageTags.Replace(';', ' '));
         version=$(PackageVersion);
         version=$(PackageVersion);

+ 1 - 1
src/ProjectTemplates/SetPackageProperties.targets

@@ -14,7 +14,7 @@
         projectUrl=$(PackageProjectUrl);
         projectUrl=$(PackageProjectUrl);
         repositoryUrl=$(RepositoryUrl);
         repositoryUrl=$(RepositoryUrl);
         repositoryType=$(RepositoryType);
         repositoryType=$(RepositoryType);
-        repositoryCommit=$(RepositoryCommit);
+        repositoryCommit=$(SourceRevisionId);
       </NuspecProperties>
       </NuspecProperties>
     </PropertyGroup>
     </PropertyGroup>
   </Target>
   </Target>

+ 11 - 8
version.props

@@ -8,6 +8,7 @@
     <PreReleaseBrandingLabel>Preview $(PreReleasePreviewNumber)</PreReleaseBrandingLabel>
     <PreReleaseBrandingLabel>Preview $(PreReleasePreviewNumber)</PreReleaseBrandingLabel>
     <ExperimentalVersionPrefix>0.3.$(AspNetCorePatchVersion)</ExperimentalVersionPrefix>
     <ExperimentalVersionPrefix>0.3.$(AspNetCorePatchVersion)</ExperimentalVersionPrefix>
     <BlazorComponentsVersionPrefix>0.8.$(AspNetCorePatchVersion)</BlazorComponentsVersionPrefix>
     <BlazorComponentsVersionPrefix>0.8.$(AspNetCorePatchVersion)</BlazorComponentsVersionPrefix>
+    <VersionPrefix>$(AspNetCoreMajorVersion).$(AspNetCoreMinorVersion).$(AspNetCorePatchVersion)</VersionPrefix>
 
 
     <!-- ANCM versioning is intentionally 10 + AspNetCoreMajorVersion because earlier versions of ANCM shipped as 8.x. -->
     <!-- ANCM versioning is intentionally 10 + AspNetCoreMajorVersion because earlier versions of ANCM shipped as 8.x. -->
     <AspNetCoreModuleVersionMajor>1$(AspNetCoreMajorVersion)</AspNetCoreModuleVersionMajor>
     <AspNetCoreModuleVersionMajor>1$(AspNetCoreMajorVersion)</AspNetCoreModuleVersionMajor>
@@ -15,10 +16,10 @@
     <AspNetCoreModuleVersionRevision>$(AspNetCorePatchVersion)</AspNetCoreModuleVersionRevision>
     <AspNetCoreModuleVersionRevision>$(AspNetCorePatchVersion)</AspNetCoreModuleVersionRevision>
 
 
     <OfficialBuildId Condition="'$(OfficialBuildId)' == ''">$(BUILD_BUILDNUMBER)</OfficialBuildId>
     <OfficialBuildId Condition="'$(OfficialBuildId)' == ''">$(BUILD_BUILDNUMBER)</OfficialBuildId>
-    <OfficialBuildId Condition="'$(OfficialBuildId)' == '' AND '$(TEAMCITY_VERSION)' != ''">$([System.DateTime]::Now.ToString('yyyyMMdd')).$(BUILD_NUMBER)</OfficialBuildId>
+    <OfficialBuildId Condition="'$(OfficialBuildId)' == '' AND '$(IsOfficialBuild)' == 'true'">$([System.DateTime]::Now.ToString('yyyyMMdd')).1</OfficialBuildId>
   </PropertyGroup>
   </PropertyGroup>
 
 
-  <PropertyGroup Condition=" '$(OfficialBuildId)' != '' AND '$(BuildNumberSuffix)' == '' ">
+  <PropertyGroup Condition=" '$(OfficialBuildId)' != '' ">
     <!-- This *mostly*  implements core versioning. Spec: https://github.com/dotnet/arcade/blob/master/Documentation/CorePackages/Versioning.md -->
     <!-- This *mostly*  implements core versioning. Spec: https://github.com/dotnet/arcade/blob/master/Documentation/CorePackages/Versioning.md -->
     <_BuildNumber>$(OfficialBuildId)</_BuildNumber>
     <_BuildNumber>$(OfficialBuildId)</_BuildNumber>
 
 
@@ -32,18 +33,20 @@
     <_BuildNumberShortDate>$([MSBuild]::Add($([MSBuild]::Add($([MSBuild]::Multiply($(_BuildNumberYY), 1000)), $([MSBuild]::Multiply($(_BuildNumberMM), 50)))), $(_BuildNumberDD)))</_BuildNumberShortDate>
     <_BuildNumberShortDate>$([MSBuild]::Add($([MSBuild]::Add($([MSBuild]::Multiply($(_BuildNumberYY), 1000)), $([MSBuild]::Multiply($(_BuildNumberMM), 50)))), $(_BuildNumberDD)))</_BuildNumberShortDate>
 
 
     <VersionSuffixBuildOfTheDay>$([System.Convert]::ToInt32($(_BuildNumberR)))</VersionSuffixBuildOfTheDay>
     <VersionSuffixBuildOfTheDay>$([System.Convert]::ToInt32($(_BuildNumberR)))</VersionSuffixBuildOfTheDay>
-
-    <!-- This is where we currently differ from the core versioning spec. This can be removed when we get official builds running in Azure Pipelines. -->
-    <VersionSuffixBuildOfTheDayPadded Condition=" '$(TEAMCITY_VERSION)' == '' ">$(VersionSuffixBuildOfTheDay.PadLeft(2, '0'))</VersionSuffixBuildOfTheDayPadded>
-    <VersionSuffixBuildOfTheDayPadded Condition=" '$(TEAMCITY_VERSION)' != '' ">$(VersionSuffixBuildOfTheDay.PadLeft(4, '0'))</VersionSuffixBuildOfTheDayPadded>
+    <VersionSuffixBuildOfTheDayPadded>$(VersionSuffixBuildOfTheDay.PadLeft(2, '0'))</VersionSuffixBuildOfTheDayPadded>
 
 
     <!-- TODO: consider using semver 2.0 instead, when/if https://github.com/dotnet/core-setup/issues/4795 is resolved -->
     <!-- TODO: consider using semver 2.0 instead, when/if https://github.com/dotnet/core-setup/issues/4795 is resolved -->
     <BuildNumberSuffix>$(_BuildNumberShortDate)-$(VersionSuffixBuildOfTheDayPadded)</BuildNumberSuffix>
     <BuildNumberSuffix>$(_BuildNumberShortDate)-$(VersionSuffixBuildOfTheDayPadded)</BuildNumberSuffix>
+
+    <FileRevisionVersion>$(_BuildNumberShortDate)</FileRevisionVersion>
+  </PropertyGroup>
+
+  <PropertyGroup Condition=" '$(OfficialBuildId)' == '' ">
+    <BuildNumberSuffix>t000</BuildNumberSuffix>
+    <FileRevisionVersion>42424</FileRevisionVersion>
   </PropertyGroup>
   </PropertyGroup>
 
 
    <PropertyGroup>
    <PropertyGroup>
-    <BuildNumberSuffix Condition=" '$(BuildNumberSuffix)' == '' ">t000</BuildNumberSuffix>
-    <VersionPrefix>$(AspNetCoreMajorVersion).$(AspNetCoreMinorVersion).$(AspNetCorePatchVersion)</VersionPrefix>
     <VersionSuffix>$(PreReleaseLabel)-$(BuildNumberSuffix)</VersionSuffix>
     <VersionSuffix>$(PreReleaseLabel)-$(BuildNumberSuffix)</VersionSuffix>
     <BrandingVersionSuffix>$(PreReleaseBrandingLabel) Build $(BuildNumberSuffix)</BrandingVersionSuffix>
     <BrandingVersionSuffix>$(PreReleaseBrandingLabel) Build $(BuildNumberSuffix)</BrandingVersionSuffix>