Produce mostly empty Microsoft.NETCore.App (dotnet/core-setup#5893)
authorDavis Goodin <dagood@users.noreply.github.com>
Tue, 23 Apr 2019 15:50:50 +0000 (10:50 -0500)
committerGitHub <noreply@github.com>
Tue, 23 Apr 2019 15:50:50 +0000 (10:50 -0500)
* Produce mostly empty Microsoft.NETCore.App

Package is now empty with a platforms package dependency. Create Microsoft.NETCore.App.Insertion transport package for compatibility workarounds.

This commit also moves netcoreapp sfx generation to the new infrastructure to more easily handle the migration away from Microsoft.NETCore.App.

* Test workarounds for Msft.NETCore.App.Insertion

If tests use MNA, use MNAI.

* M.NETCore.App.Insertion => M.NETCore.App.Internal

It isn't just for insertion into core-sdk, we use it in core-setup too for now.

* Update dir.props: quote '/' and '\' in comment

Co-Authored-By: dagood <dagood@users.noreply.github.com>
* Comment on explicit .lib exclusion

Commit migrated from https://github.com/dotnet/core-setup/commit/0752a1798f8a089aa78796068a43b52ee1564aa5

30 files changed:
eng/jobs/windows-build.yml
src/installer/TestProjects.props
src/installer/config.json
src/installer/dir.proj
src/installer/pkg/packaging-tools/framework.packaging.targets
src/installer/pkg/packaging-tools/packaging-tools.targets
src/installer/pkg/packaging-tools/sharedFramework/sharedFramework.csproj
src/installer/pkg/packaging-tools/windows/sharedFramework/breadcrumbstorefolder.wxs [new file with mode: 0644]
src/installer/pkg/packaging-tools/windows/sharedFramework/product.wxs
src/installer/pkg/packaging-tools/windows/sharedFramework/werrelatedkeys.wxs [new file with mode: 0644]
src/installer/pkg/packaging-tools/windows/wix.targets
src/installer/pkg/packaging/windows/package.targets
src/installer/pkg/packaging/windows/sharedframework/generatemsi.ps1 [deleted file]
src/installer/pkg/packaging/windows/sharedframework/provider.wxs [deleted file]
src/installer/pkg/packaging/windows/sharedframework/registrykeys.wxs [deleted file]
src/installer/pkg/packaging/windows/sharedframework/sharedframework.wxs [deleted file]
src/installer/pkg/projects/descriptions.json
src/installer/pkg/projects/netcoreapp/pkg/Microsoft.NETCore.App.Internal.pkgproj [new file with mode: 0644]
src/installer/pkg/projects/netcoreapp/pkg/Microsoft.NETCore.App.pkgproj
src/installer/pkg/projects/netcoreapp/pkg/Microsoft.NETCore.App.targets [deleted file]
src/installer/pkg/projects/netcoreapp/pkg/dir.props
src/installer/sharedFramework/framework/Program.cs [deleted file]
src/installer/sharedFramework/framework/framework.csproj [deleted file]
src/installer/sharedFramework/lockedhost/lockedhost.csproj [deleted file]
src/installer/sharedFramework/sharedFramework.proj [deleted file]
src/installer/test/Assets/TestProjects/Directory.Build.props [new file with mode: 0644]
src/installer/test/Assets/TestProjects/MNADeprecationWorkaround.props [new file with mode: 0644]
src/installer/test/Assets/TestProjects/PortableApp/PortableApp.csproj
src/installer/test/Assets/TestProjects/StandaloneApp20/Directory.Build.props [new file with mode: 0644]
src/installer/test/Assets/TestProjects/StandaloneApp21/Directory.Build.props [new file with mode: 0644]

index d9d0fdf..578a836 100644 (file)
@@ -99,12 +99,6 @@ jobs:
       condition: succeeded()
 
     # Build Shared Frameworks
-    - script: build.cmd -sharedfx-netcoreapp
-        -- '$(CommonMSBuildArgs)
-        /bl:$(Build.SourcesDirectory)\sharedframework-netcoreapp.binlog'
-      displayName: Build sharedframework layout (legacy infrastructure)
-      condition: succeeded()
-
     - script: build.cmd -sharedfx
         -- '$(CommonMSBuildArgs)
         /bl:$(Build.SourcesDirectory)\sharedframework.binlog'
index 72f1451..f31d060 100644 (file)
@@ -1,3 +1,4 @@
 <Project>
   <Import Project="BranchInfo.props" />
+  <Import Project="src\test\Assets\TestProjects\MNADeprecationWorkaround.props" />
 </Project>
\ No newline at end of file
index 6c513ca..7707a94 100644 (file)
             "Project": "publish\\publish.proj"
           }
         },
-        "sharedfx-netcoreapp": {
-          "description": "Build legacy netcoreapp Shared Framework project.",
-          "settings": {
-            "Project": "src\\sharedframework\\sharedframework.proj"
-          }
-        },
         "sharedfx": {
           "description": "Build Shared Framework projects.",
           "settings": {
index 8d32915..f845012 100644 (file)
@@ -10,7 +10,6 @@
   <ItemGroup>
     <Project Include="$(MSBuildThisFileDirectory)src.builds" />
     <Project Include="$(MSBuildThisFileDirectory)pkg/dir.proj" />
-    <Project Include="$(MSBuildThisFileDirectory)sharedFramework/sharedFramework.proj" />
     <Project Include="$(MSBuildThisFileDirectory)pkg/projects/sharedfx.builds" />
   </ItemGroup>
 
index 339934b..08d0327 100644 (file)
@@ -10,6 +10,7 @@
 
   <Target Name="GenerateInstallers"
           DependsOnTargets="
+            GetInstallerProperties;
             GenerateDeb;
             GenerateRpm;
             GenerateMsi;
   <Target Name="GenerateZip"
           Condition="'$(OSGroup)' == 'Windows_NT'">
     <ZipFileCreateFromDirectory
-      SourceDirectory="$(SharedFrameworkLayoutDir)"
+      SourceDirectory="$(SharedFrameworkArchiveSourceDir)"
       DestinationArchive="$(CompressedArchiveFile)"
       OverwriteDestination="true" />
   </Target>
index 2cf5417..9583687 100644 (file)
 
       <!-- Location to place the installer, in bin. -->
       <InstallerFileNameWithoutExtension>$(InstallerName)-$(InstallerBuildPart)</InstallerFileNameWithoutExtension>
-      <InstallerFile>$(AssetOutputPath)$(InstallerFileNameWithoutExtension)$(InstallerExtension)</InstallerFile>
+      <InstallerFile Condition="'$(InstallerFile)' == ''">$(AssetOutputPath)$(InstallerFileNameWithoutExtension)$(InstallerExtension)</InstallerFile>
       <CompressedArchiveFile>$(AssetOutputPath)$(InstallerFileNameWithoutExtension)$(CompressedFileExtension)</CompressedArchiveFile>
     </PropertyGroup>
+
+    <!-- By default, a shared framework only has files in shared/, so archive that. -->
+    <PropertyGroup>
+      <SharedFrameworkArchiveSourceDir Condition="'$(SharedFrameworkArchiveSourceDir)' == ''">$(SharedFrameworkLayoutDir)shared/</SharedFrameworkArchiveSourceDir>
+    </PropertyGroup>
+
+    <!-- Use existing infra for non-Windows shared frameworks for now. -->
+    <PropertyGroup Condition="'$(GenerateSharedFramework)' == 'true'">
+      <GeneratePkg>false</GeneratePkg>
+      <BuildDebPackage>false</BuildDebPackage>
+      <BuildRpmPackage>false</BuildRpmPackage>
+    </PropertyGroup>
   </Target>
 
+  <!--
+    By default, shared frameworks are generated based on the package. This can be overridden by the
+    project, and in the future, the runtime pack is likely to be used to assemble the sfx.
+  -->
+  <Target Name="GetSharedFrameworkPackageReferences"
+          DependsOnTargets="GetPackageIdentity"
+          Returns="@(_PackageIdentity)" />
+
 </Project>
index 497c79e..b686e4d 100644 (file)
       Projects="$(SharedFrameworkPkgprojFile)"
       Targets="GetPackageIdentity"
       RemoveProperties="Configuration">
-      <Output TaskParameter="TargetOutputs" ItemName="PackageReference" />
+      <Output TaskParameter="TargetOutputs" ItemName="SfxIdentity" />
     </MSBuild>
 
     <PropertyGroup>
-      <PublishDir>$(SharedFrameworkLayoutDir)%(PackageReference.Identity)/%(PackageReference.Version)/</PublishDir>
+      <SfxIdentity>%(SfxIdentity.Identity)</SfxIdentity>
+      <SfxVersion>%(SfxIdentity.Version)</SfxVersion>
+      <PublishDir>$(SharedFrameworkLayoutDir)shared/$(SfxIdentity)/$(SfxVersion)/</PublishDir>
     </PropertyGroup>
+
+    <MSBuild
+      Projects="$(SharedFrameworkPkgprojFile)"
+      Targets="GetSharedFrameworkPackageReferences"
+      RemoveProperties="Configuration">
+      <Output TaskParameter="TargetOutputs" ItemName="PackageReference" />
+    </MSBuild>
   </Target>
 
   <!--
       Overwrite="true" />
   </Target>
 
+  <!--
+    NETCoreApp (and only NETCoreApp) carries the host and host resolver in the shared framework,
+    which lives outside the shared/ directory. These were included in publish through package
+    references and the files must be moved.
+  -->
+  <Target Name="MoveSharedFrameworkHost"
+          Condition="'$(SfxIdentity)' == 'Microsoft.NETCore.App'"
+          AfterTargets="Publish">
+    <!-- Use the muxer we intended to consume (either restored a shipped version or the one we built) -->
+    <Move SourceFiles="$(PublishDir)dotnet$(ExeSuffix)" DestinationFolder="$(SharedFrameworkLayoutDir)" />
+
+    <!--  Use the FXR Resolver we intended to consume (either restored a shipped version or the one we built) -->
+    <Move SourceFiles="$(PublishDir)$(LibPrefix)hostfxr$(LibSuffix)" DestinationFolder="$(SharedFrameworkLayoutDir)\host\fxr\$(HostResolverVersion)" />
+
+    <!-- Ensure the host is executable. See https://github.com/NuGet/Home/issues/4424 -->
+    <Exec Command="chmod u+x $(SharedFrameworkLayoutDir)dotnet$(ExeSuffix)"
+          Condition="'$(OSGroup)' != 'Windows_NT'" />
+  </Target>
+
   <!-- Clean up artifacts that dotnet-publish generates which we don't need -->
   <Target Name="DeleteUnnecessaryPublishOutputs" AfterTargets="Publish">
     <ItemGroup>
       <ToDelete Include="$(PublishDir)$(LibPrefix)comhost$(LibSuffix)" />
       <ToDelete Include="$(PublishDir)$(LibPrefix)hostfxr$(LibSuffix)" />
       <ToDelete Include="$(PublishDir)$(LibPrefix)ijwhost$(LibSuffix)" />
+      <!--
+        On Windows, LibSuffix is .dll (for dynamic libraries), but for this particular file, we also
+        build a .lib (static library). Make sure neither is included.
+
+        We only build this library on Windows, so other static library formats don't need to be
+        handled yet.
+      -->
+      <ToDelete Include="$(PublishDir)$(LibPrefix)ijwhost.lib" />
     </ItemGroup>
 
     <Delete Files="@(ToDelete)" />
   </Target>
 
+  <!-- Preserve symbol files for compressed symbol archive. -->
+  <Target Name="CopySymbolsToPublishFolder"
+          Condition="'$(SfxIdentity)' == 'Microsoft.NETCore.App'"
+          AfterTargets="Publish">
+    <PropertyGroup>
+      <!--
+        Microsoft.NETCore.App is the name of the shared framework, but the internal package is
+        the one doing the crossgen.
+      -->
+      <CrossgennedPackageId>Microsoft.NETCore.App.Internal</CrossgennedPackageId>
+      <CrossgennedPackageSymbolDir>$(PackageSymbolsBinDir)$(CrossgennedPackageId)/</CrossgennedPackageSymbolDir>
+    </PropertyGroup>
+
+    <ItemGroup>
+      <SharedFrameworkSymbols Include="$(CrossgennedPackageSymbolDir)**/*.pdb" />
+      <SharedFrameworkSymbols Include="$(CrossgennedPackageSymbolDir)**/*$(SymbolFileExtension)" />
+
+      <SharedFrameworkSymbols
+        Include="$(CrossgennedPackageSymbolDir)**/*$(CrossGenSymbolExtension)"
+        Condition="'$(CrossGenSymbolExtension)' != ''" />
+    </ItemGroup>
+
+    <RemoveDir
+      Directories="$(SharedFrameworkPublishSymbolsDir)"
+      Condition="Exists('$(SharedFrameworkPublishSymbolsDir)')" />
+
+    <MakeDir Directories="$(SharedFrameworkPublishSymbolsDir)" />
+
+    <Copy SourceFiles="@(SharedFrameworkSymbols)" DestinationFolder="$(SharedFrameworkPublishSymbolsDir)" />
+  </Target>
+
   <Target Name="GenerateRuntimeGraph"
           Condition="'$(GenerateRuntimeGraph)' == 'true'"
           AfterTargets="Publish">
       <RuntimeGraphGeneratorRuntime Condition="'$(RuntimeGraphGeneratorRuntime)'==''">linux</RuntimeGraphGeneratorRuntime>
     </PropertyGroup>
 
+    <!--
+      Packages to trim from Microsoft.NETCore.App.deps.json for parity with earlier sfx releases.
+      To be removed once the sfx is constructed from Runtime Packs, which don't have deps.
+    -->
+    <ItemGroup>
+      <TrimPkgsFromDeps Include="runtime.$(PackageTargetRid).microsoft.netcore.dotnethost" />
+      <TrimPkgsFromDeps Include="runtime.$(PackageTargetRid).microsoft.netcore.dotnetapphost" />
+      <TrimPkgsFromDeps Include="runtime.$(PackageTargetRid).microsoft.netcore.dotnethostresolver" />
+      <TrimPkgsFromDeps Include="microsoft.netcore.dotnethost" />
+      <TrimPkgsFromDeps Include="microsoft.netcore.dotnetapphost" />
+      <TrimPkgsFromDeps Include="microsoft.netcore.dotnethostresolver" />
+    </ItemGroup>
+
     <ProcessSharedFrameworkDeps AssetsFilePath="$(SharedFrameworkAssetsFile)"
                                 DepsFilePath="$(SharedFrameworkDepsFile)"
+                                PackagesToRemove="@(TrimPkgsFromDeps)"
                                 Runtime="$(RuntimeGraphGeneratorRuntime)"
                                 BuildToolsTaskDir="$(BuildToolsTaskDir)" />
   </Target>
diff --git a/src/installer/pkg/packaging-tools/windows/sharedFramework/breadcrumbstorefolder.wxs b/src/installer/pkg/packaging-tools/windows/sharedFramework/breadcrumbstorefolder.wxs
new file mode 100644 (file)
index 0000000..0063030
--- /dev/null
@@ -0,0 +1,38 @@
+<?xml version="1.0"?>
+<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
+  <?include "..\Variables.wxi" ?>
+  <Fragment>
+    <!-- Set registry keys to allow WER to generate correct dumps. -->
+    <Component Id="BreadcrumbStoreFolder" Directory="BreadcrumbStore" Guid="{DA957490-EA59-42B9-B9D6-3E80F6FB0ED0}">
+      <CreateFolder Directory="BreadcrumbStore">
+        <Permission
+          User="Everyone"
+          CreateChild="no"
+          CreateFile="yes"
+          Delete="no"
+          DeleteChild="no"
+          Read="yes"
+          ReadAttributes="yes"
+          ReadExtendedAttributes="yes"
+          ReadPermission="yes"
+          Traverse="yes" />
+        <Permission
+          User="SYSTEM"
+          GenericAll="yes" />
+        <Permission
+          User="Administrators"
+          GenericAll="yes" />
+      </CreateFolder>
+    </Component>
+
+    <DirectoryRef Id="TARGETDIR">
+      <Directory Id="CommonAppDataFolder">
+        <Directory Id="MicrosoftCommonAppData" Name="Microsoft">
+          <Directory Id="NetFrameworkCommonAppData" Name="NetFramework">
+            <Directory Id="BreadcrumbStore" Name="BreadcrumbStore" />
+          </Directory>
+        </Directory>
+      </Directory>
+    </DirectoryRef>
+  </Fragment>
+</Wix>
index 907ffd4..93396d5 100644 (file)
     <Feature Id="MainFeature" Title="Main Feature" Level="1">
       <ComponentGroupRef Id="InstallFiles" />
       <ComponentGroupRef Id="AuthoredRegistryKeys"/>
+
+      <?ifdef WerRelatedKeys ?>
+        <ComponentGroupRef Id="WerRelatedKeys"/>
+      <?endif?>
+
+      <?ifdef BreadcrumbStoreFolder ?>
+        <ComponentRef Id="BreadcrumbStoreFolder"/>
+      <?endif?>
     </Feature>
   </Product>
 
diff --git a/src/installer/pkg/packaging-tools/windows/sharedFramework/werrelatedkeys.wxs b/src/installer/pkg/packaging-tools/windows/sharedFramework/werrelatedkeys.wxs
new file mode 100644 (file)
index 0000000..997df3d
--- /dev/null
@@ -0,0 +1,52 @@
+<?xml version="1.0"?>
+<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
+  <?include "..\Variables.wxi" ?>
+  <Fragment>
+    <!-- Set registry keys to allow WER to genereate correct dumps-->
+    <ComponentGroup Id="WerRelatedKeys">
+      <Component Directory="TARGETDIR">
+        <RegistryKey Root="HKLM" Key="SOFTWARE\Microsoft\Windows\Windows Error Reporting\RuntimeExceptionHelperModules">
+          <RegistryValue
+            Action="write"
+            Name="[DOTNETHOME]shared\$(var.FrameworkName)\$(var.NugetVersion)\mscordaccore.dll"
+            Type="integer"
+            Value="0"
+            KeyPath="yes"/>
+        </RegistryKey>
+      </Component>
+      
+      <Component Directory="TARGETDIR">
+        <RegistryKey Root="HKLM" Key="SOFTWARE\Microsoft\Windows NT\CurrentVersion\KnownManagedDebuggingDlls">
+          <RegistryValue
+            Action="write"
+            Name="[DOTNETHOME]shared\$(var.FrameworkName)\$(var.NugetVersion)\mscordaccore.dll"
+            Type="integer"
+            Value="0"
+            KeyPath="yes"/>
+        </RegistryKey>
+      </Component>
+      
+      <Component Directory="TARGETDIR">
+        <RegistryKey Root="HKLM" Key="SOFTWARE\Microsoft\Windows NT\CurrentVersion\KnownFunctionTableDlls">
+          <RegistryValue
+            Action="write"
+            Name="[DOTNETHOME]shared\$(var.FrameworkName)\$(var.NugetVersion)\mscordaccore.dll"
+            Type="integer"
+            Value="0"
+            KeyPath="yes"/>
+        </RegistryKey>
+      </Component>
+      
+      <Component Directory="TARGETDIR">
+        <RegistryKey Root="HKLM" Key="SOFTWARE\Microsoft\Windows NT\CurrentVersion\MiniDumpAuxiliaryDlls">
+          <RegistryValue
+            Action="write"
+            Name="[DOTNETHOME]shared\$(var.FrameworkName)\$(var.NugetVersion)\coreclr.dll"
+            Type="string"
+            Value="[DOTNETHOME]shared\$(var.FrameworkName)\$(var.NugetVersion)\mscordaccore.dll"
+            KeyPath="yes"/>
+        </RegistryKey>
+      </Component>
+    </ComponentGroup>
+  </Fragment>
+</Wix>
index fd96a7b..3640e13 100644 (file)
@@ -34,7 +34,7 @@
 
     <ItemGroup Condition="'$(GenerateSharedFramework)' == 'true'">
       <DirectoryToHarvest
-        Include="$(SharedFrameworkLayoutDir)"
+        Include="$(SharedFrameworkLayoutDir)shared/"
         Name="install-shared-framework"
         SubstituteVar="SharedFrameworkSrc"
         ComponentGroupName="InstallFiles"
       <WixSrcFile Include="$(MSBuildThisFileDirectory)sharedFramework/registrykeys.wxs" />
     </ItemGroup>
 
+    <ItemGroup Condition="'$(IncludeWerRelatedKeys)' == 'true'">
+      <WixSrcFile Include="$(MSBuildThisFileDirectory)sharedFramework/werrelatedkeys.wxs" />
+      <CandleVariables Include="WerRelatedKeys" Value="true" />
+    </ItemGroup>
+
+    <ItemGroup Condition="'$(IncludeBreadcrumbStoreFolder)' == 'true'">
+      <WixSrcFile Include="$(MSBuildThisFileDirectory)sharedFramework/breadcrumbstorefolder.wxs" />
+      <CandleVariables Include="BreadcrumbStoreFolder" Value="true" />
+    </ItemGroup>
+
     <ItemGroup>
       <WixSrcFile Include="$(MSBuildThisFileDirectory)provider.wxs" />
     </ItemGroup>
             GetWixBuildConfiguration;
             GetUpgradeCode;
             GenerateMsiVersionString">
+    <ItemGroup>
+      <CandleVariables Include="%(DirectoryToHarvest.SubstituteVar)" Value="%(DirectoryToHarvest.Identity)" />
+    </ItemGroup>
+
     <PropertyGroup>
       <_wixArgs></_wixArgs>
       <_wixArgs>$(_wixArgs) -nologo</_wixArgs>
       <_wixArgs>$(_wixArgs) -dTargetArchitecture="$(TargetArchitecture)"</_wixArgs>
       <_wixArgs>$(_wixArgs) -dUpgradeCode="$(UpgradeCode)"</_wixArgs>
       <_wixArgs>$(_wixArgs) -dDependencyKeyName="$(InstallerName.Replace('-', '_'))"</_wixArgs>
-      <_wixArgs>$(_wixArgs) @(DirectoryToHarvest -> '-d%(SubstituteVar)="%(Identity)', ' ')" </_wixArgs>
+      <_wixArgs>$(_wixArgs) @(CandleVariables -> '-d%(Identity)="%(Value)"', ' ')</_wixArgs>
 
       <_wixArgs>$(_wixArgs) @(WixSrcFile -> '"%(Identity)"', ' ')</_wixArgs>
       <_wixArgs>$(_wixArgs) @(DirectoryToHarvest -> '"%(WixSourceFile)"', ' ')</_wixArgs>
index 7f8398d..dbd31dd 100644 (file)
             <InstallerName>$(HostFxrInstallerFile)</InstallerName>
             <UpgradeCode>$(HostFxrUpgradeCode)</UpgradeCode>
         </WixOutputs>
-        <!-- shared framework has extra arguments so it needs to be in a separate group -->
-        <WixOutputs2 Include="$(WixObjRoot)sharedframework">
-            <InputDir>$(SharedFrameworkPublishRoot)</InputDir>
-            <BrandName>$(SharedFrameworkBrandName)</BrandName>
-            <InstallerName>$(SharedFrameworkInstallerFile)</InstallerName>
-        </WixOutputs2>
       </ItemGroup>
 
       <RemoveDir Directories="$(WixObjRoot)" />
       <MakeDir Directories="$(WixObjRoot);@(WixOutputs);@(WixOutputs2)" />
 
-      <GenerateGuidFromName Name="$(SharedFrameworkInstallerFile)">
-        <Output TaskParameter="GeneratedGuid" PropertyName="SharedFxUpgradeCode" />
-      </GenerateGuidFromName>
-
       <PropertyGroup>
         <ArchParams>"$(MsiArch)" "$(TargetArchitecture)"</ArchParams>
         <CommonParams>$(MsiVersionString) $(SharedFrameworkNugetVersion) $(ArchParams)</CommonParams>
-        <SharedFxParams>$(MsiVersionString) $(SharedFrameworkName) $(SharedFrameworkNugetVersion) $(SharedFxUpgradeCode) $(ArchParams)</SharedFxParams>
       </PropertyGroup>
 
       <Exec Command="powershell -NoProfile -NoLogo $(WindowsScriptRoot)%(WixOutputs.Filename)\generatemsi.ps1 %(WixOutputs.InputDir) %(WixOutputs.InstallerName) $(WixToolsDir) '%(WixOutputs.BrandName)' $(CommonParams) %(WixOutputs.Identity) %(WixOutputs.UpgradeCode)" />
-      <!-- shared framework -->
-      <Exec Command="powershell -NoProfile -NoLogo $(WindowsScriptRoot)%(WixOutputs2.Filename)\generatemsi.ps1 %(WixOutputs2.InputDir) %(WixOutputs2.InstallerName) $(WixToolsDir) '%(WixOutputs2.BrandName)' $(SharedFxParams) %(WixOutputs2.Identity)" />
   </Target>
 
   <Target Name="GenerateBundles"
diff --git a/src/installer/pkg/packaging/windows/sharedframework/generatemsi.ps1 b/src/installer/pkg/packaging/windows/sharedframework/generatemsi.ps1
deleted file mode 100644 (file)
index e6f2cd3..0000000
+++ /dev/null
@@ -1,163 +0,0 @@
-# Licensed to the .NET Foundation under one or more agreements.
-# The .NET Foundation licenses this file to you under the MIT license.
-# See the LICENSE file in the project root for more information.
-
-param(
-    [Parameter(Mandatory=$true)][string]$SharedFrameworkPublishRoot,
-    [Parameter(Mandatory=$true)][string]$SharedFrameworkMSIOutput,
-    [Parameter(Mandatory=$true)][string]$WixRoot,
-    [Parameter(Mandatory=$true)][string]$ProductMoniker,
-    [Parameter(Mandatory=$true)][string]$DotnetMSIVersion,
-    [Parameter(Mandatory=$true)][string]$SharedFrameworkNugetName,
-    [Parameter(Mandatory=$true)][string]$SharedFrameworkNugetVersion,
-    [Parameter(Mandatory=$true)][string]$SharedFrameworkUpgradeCode,
-    [Parameter(Mandatory=$true)][string]$Architecture,
-    [Parameter(Mandatory=$true)][string]$TargetArchitecture,
-    [Parameter(Mandatory=$true)][string]$WixObjRoot
-)
-
-$RepoRoot = Convert-Path "$PSScriptRoot\..\..\..\..\.."
-$CommonScript = "$RepoRoot\tools-local\scripts\common\_common.ps1"
-if(-Not (Test-Path "$CommonScript"))
-{
-    Exit -1
-} 
-. "$CommonScript"
-
-$PackagingRoot = Join-Path $RepoRoot "src\pkg\packaging"
-
-$InstallFileswsx = "$WixObjRoot\install-files.wxs"
-$InstallFilesWixobj = "$WixObjRoot\install-files.wixobj"
-
-
-function RunHeat
-{
-    $result = $true
-    pushd "$WixRoot"
-
-    Write-Host Running heat..
-
-    .\heat.exe dir `"$SharedFrameworkPublishRoot`" `
-    -nologo `
-    -template fragment `
-    -sreg -gg `
-    -var var.SharedFrameworkSource `
-    -cg InstallFiles `
-    -srd `
-    -dr DOTNETHOME `
-    -out $InstallFileswsx | Out-Host
-
-    if($LastExitCode -ne 0)
-    {
-        $result = $false
-        Write-Host "Heat failed with exit code $LastExitCode."
-    }
-
-    popd
-    return $result
-}
-
-function RunCandle
-{
-    $result = $true
-    pushd "$WixRoot"
-
-    Write-Host Running candle..
-    $AuthWsxRoot = Join-Path $PackagingRoot "windows\sharedframework"
-    $SharedFrameworkComponentVersion = $SharedFrameworkNugetVersion.Replace('-', '_');
-
-    .\candle.exe -nologo `
-        -out "$WixObjRoot\" `
-        -dSharedFrameworkSource="$SharedFrameworkPublishRoot" `
-        -dMicrosoftEula="$PackagingRoot\windows\eula.rtf" `
-        -dProductMoniker="$ProductMoniker" `
-        -dFrameworkName="$SharedFrameworkNugetName" `
-        -dFrameworkDisplayVersion="$SharedFrameworkNugetVersion" `
-        -dFrameworkComponentVersion="$SharedFrameworkComponentVersion" `
-        -dFrameworkUpgradeCode="$SharedFrameworkUpgradeCode" `
-        -dTargetArchitecture="$TargetArchitecture" `
-        -dBuildVersion="$DotnetMSIVersion" `
-        -arch $Architecture `
-        -ext WixDependencyExtension.dll `
-        "$AuthWsxRoot\sharedframework.wxs" `
-        "$AuthWsxRoot\provider.wxs" `
-        "$AuthWsxRoot\registrykeys.wxs" `
-        $InstallFileswsx | Out-Host
-
-    if($LastExitCode -ne 0)
-    {
-        $result = $false
-        Write-Host "Candle failed with exit code $LastExitCode."
-    }
-
-    popd
-    return $result
-}
-
-function RunLight
-{
-    $result = $true
-    pushd "$WixRoot"
-
-    Write-Host Running light..
-    $CabCache = Join-Path $WixRoot "cabcache"
-
-    .\light.exe -nologo -ext WixUIExtension -ext WixDependencyExtension -ext WixUtilExtension `
-        -cultures:en-us `
-        "$WixObjRoot\sharedframework.wixobj" `
-        "$WixObjRoot\provider.wixobj" `
-        "$WixObjRoot\registrykeys.wixobj" `
-        "$InstallFilesWixobj" `
-        -out $SharedFrameworkMSIOutput | Out-Host
-
-    if($LastExitCode -ne 0)
-    {
-        $result = $false
-        Write-Host "Light failed with exit code $LastExitCode."
-    }
-
-    popd
-    return $result
-}
-
-if(!(Test-Path $SharedFrameworkPublishRoot))
-{
-    throw "$SharedHostPublishRoot not found"
-}
-
-if(!(Test-Path $WixObjRoot))
-{
-    throw "$WixObjRoot not found"
-}
-
-Write-Host "Creating dotnet shared framework MSI at $SharedFrameworkMSIOutput"
-
-if([string]::IsNullOrEmpty($WixRoot))
-{
-    Exit -1
-}
-
-if(-Not (RunHeat))
-{
-    Exit -1
-}
-
-if(-Not (RunCandle))
-{
-    Exit -1
-}
-
-if(-Not (RunLight))
-{
-    Exit -1
-}
-
-if(!(Test-Path $SharedFrameworkMSIOutput))
-{
-    throw "Unable to create the dotnet shared framework msi."
-    Exit -1
-}
-
-Write-Host -ForegroundColor Green "Successfully created shared framework MSI - $SharedFrameworkMSIOutput"
-
-exit $LastExitCode
diff --git a/src/installer/pkg/packaging/windows/sharedframework/provider.wxs b/src/installer/pkg/packaging/windows/sharedframework/provider.wxs
deleted file mode 100644 (file)
index 9fc76d1..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0"?>
-<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" xmlns:dep="http://schemas.microsoft.com/wix/DependencyExtension">
-  <?include "Variables.wxi" ?>
-  <Fragment>
-    <Component Id="$(var.DependencyKeyId)" Directory="TARGETDIR" Win64="no">
-      <dep:Provides Key="$(var.DependencyKey)" />
-    </Component>
-  </Fragment>
-</Wix>
diff --git a/src/installer/pkg/packaging/windows/sharedframework/registrykeys.wxs b/src/installer/pkg/packaging/windows/sharedframework/registrykeys.wxs
deleted file mode 100644 (file)
index bcf20c2..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0"?>
-<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
-  <?include "Variables.wxi" ?>
-  <Fragment>
-    <ComponentGroup Id="AuthoredRegistryKeys">
-      <Component Id="SetupRegistry_x86" Directory="TARGETDIR" Win64="no">
-        <RegistryKey Root="HKLM" Key="SOFTWARE\dotnet\Setup\InstalledVersions\$(var.Platform)\sharedfx\$(var.FrameworkName)">
-          <RegistryValue Action="write" Name="$(var.FrameworkDisplayVersion)" Type="integer" Value="1" KeyPath="yes"/>
-        </RegistryKey>
-      </Component>
-    </ComponentGroup>
-    
-    <!-- Set registry keys to allow WER to genereate correct dumps-->
-    <ComponentGroup Id="WerRelatedKeys">
-      <Component Directory="TARGETDIR">
-        <RegistryKey Root="HKLM" Key="SOFTWARE\Microsoft\Windows\Windows Error Reporting\RuntimeExceptionHelperModules">
-          <RegistryValue Action="write" Name="[DOTNETHOME]shared\$(var.FrameworkName)\$(var.FrameworkDisplayVersion)\mscordaccore.dll" Type="integer" Value="0" KeyPath="yes"/>
-        </RegistryKey>
-      </Component>
-      
-      <Component Directory="TARGETDIR">
-        <RegistryKey Root="HKLM" Key="SOFTWARE\Microsoft\Windows NT\CurrentVersion\KnownManagedDebuggingDlls">
-          <RegistryValue Action="write" Name="[DOTNETHOME]shared\$(var.FrameworkName)\$(var.FrameworkDisplayVersion)\mscordaccore.dll" Type="integer" Value="0" KeyPath="yes"/>
-        </RegistryKey>
-      </Component>
-      
-      <Component Directory="TARGETDIR">
-        <RegistryKey Root="HKLM" Key="SOFTWARE\Microsoft\Windows NT\CurrentVersion\KnownFunctionTableDlls">
-          <RegistryValue Action="write" Name="[DOTNETHOME]shared\$(var.FrameworkName)\$(var.FrameworkDisplayVersion)\mscordaccore.dll" Type="integer" Value="0" KeyPath="yes"/>
-        </RegistryKey>
-      </Component>
-      
-      <Component Directory="TARGETDIR">
-        <RegistryKey Root="HKLM" Key="SOFTWARE\Microsoft\Windows NT\CurrentVersion\MiniDumpAuxiliaryDlls">
-          <RegistryValue Action="write" Name="[DOTNETHOME]shared\$(var.FrameworkName)\$(var.FrameworkDisplayVersion)\coreclr.dll" Type="string" Value="[DOTNETHOME]shared\$(var.FrameworkName)\$(var.FrameworkDisplayVersion)\mscordaccore.dll" KeyPath="yes"/>
-        </RegistryKey>
-      </Component>
-    </ComponentGroup>
-  </Fragment>
-</Wix>
-
-
diff --git a/src/installer/pkg/packaging/windows/sharedframework/sharedframework.wxs b/src/installer/pkg/packaging/windows/sharedframework/sharedframework.wxs
deleted file mode 100644 (file)
index 2e7c14e..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
-    <?include "Variables.wxi" ?>
-    <Product Id="*" Name="$(var.ProductName)" Language="$(var.ProductLanguage)" Version="$(var.ProductVersion)" Manufacturer="$(var.Manufacturer)" UpgradeCode="$(var.UpgradeCode)">
-        <Package Compressed="yes" InstallScope="perMachine" InstallerVersion="200" />
-
-        <MajorUpgrade DowngradeErrorMessage="$(var.DowngradeErrorMessage)" Schedule="afterInstallInitialize"/>
-
-        <MediaTemplate CompressionLevel="high" EmbedCab="yes"/>
-
-        <Feature Id="MainFeature" Title="Main Feature" Level="1">
-            <ComponentGroupRef Id="InstallFiles" />
-            <ComponentGroupRef Id="AuthoredRegistryKeys"/>
-            <ComponentGroupRef Id="WerRelatedKeys"/>
-            <Component Id="BreadcrumbStoreFolder" Directory="BreadcrumbStore" Guid="{DA957490-EA59-42B9-B9D6-3E80F6FB0ED0}">
-                <CreateFolder Directory="BreadcrumbStore">
-                    <Permission
-                        User="Everyone"
-                        CreateChild="no"
-                        CreateFile="yes"
-                        Delete="no"
-                        DeleteChild="no"
-                        Read="yes"
-                        ReadAttributes="yes"
-                        ReadExtendedAttributes="yes"
-                        ReadPermission="yes"
-                        Traverse="yes" />
-                    <Permission
-                        User="SYSTEM"
-                        GenericAll="yes" />
-                    <Permission
-                        User="Administrators"
-                        GenericAll="yes" />
-                </CreateFolder>
-            </Component>
-        </Feature>
-        <Feature Id="Provider" Absent="disallow" AllowAdvertise="no" Description="Used for Ref Counting" Display="hidden" Level="1" InstallDefault="local" Title="RefCounting" TypicalDefault="install">
-            <ComponentRef Id="$(var.DependencyKeyId)" />
-        </Feature>
-
-        <Property Id="MSIFASTINSTALL" Value="7" />
-
-        <WixVariable Id="WixUILicenseRtf" Value="$(var.MicrosoftEula)" />
-
-        <Property Id="WIXUI_INSTALLDIR" Value="DOTNETHOME"/>
-        <UIRef Id="WixUI_InstallDir" />
-
-        <CustomActionRef Id="WixBroadcastEnvironmentChange" />
-    </Product>
-    <Fragment>
-        <Directory Id="TARGETDIR" Name="SourceDir">
-            <Directory Id="$(var.Program_Files)">
-                <Directory Id="DOTNETHOME" Name="dotnet" />
-            </Directory>
-            <Directory Id="CommonAppDataFolder">
-              <Directory Id="MicrosoftCommonAppData" Name="Microsoft">
-                <Directory Id="NetFrameworkCommonAppData" Name="NetFramework">
-                  <Directory Id="BreadcrumbStore" Name="BreadcrumbStore" />
-                </Directory>
-              </Directory>
-            </Directory>
-        </Directory>
-    </Fragment>
-</Wix>
index 2461aed..a1655af 100644 (file)
         "CommonTypes": [ ]
     },
     {
+        "Name": "Microsoft.NETCore.App.Internal",
+        "Description": "Transport package for .NET Core App runtime assets.",
+        "CommonTypes": [ ]
+    },
+    {
         "Name": "Microsoft.NETCore.App.Ref",
         "Description": "A set of .NET APIs that are included in the default .NET Core application model. Contains reference assemblies, documentation, and other design-time assets.",
         "CommonTypes": [ ]
diff --git a/src/installer/pkg/projects/netcoreapp/pkg/Microsoft.NETCore.App.Internal.pkgproj b/src/installer/pkg/projects/netcoreapp/pkg/Microsoft.NETCore.App.Internal.pkgproj
new file mode 100644 (file)
index 0000000..9880edc
--- /dev/null
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
+
+  <PropertyGroup>
+    <PreventImplementationReference Condition="'$(PackageTargetRuntime)' != ''">true</PreventImplementationReference>
+    <BuildTargetPath>build/$(NETCoreAppFramework)</BuildTargetPath>
+    <PlatformManifestTargetPath>$(BuildTargetPath)</PlatformManifestTargetPath>
+    <FileVersionPropsTargetPath>$(BuildTargetPath)</FileVersionPropsTargetPath>
+  </PropertyGroup>
+
+  <!-- Identity / Reference package content -->
+  <ItemGroup Condition="'$(PackageTargetRuntime)' == ''">
+    <!-- reference RID specific packages to generate lineup -->
+    <ProjectReference Include="@(RuntimeProject)" />
+
+    <!-- references the host packages -->
+    <Dependency Include="Microsoft.NETCore.DotNetHostPolicy">
+       <Version>$(HostPolicyVersion)</Version>
+       <TargetFramework>$(NETCoreAppFramework)</TargetFramework>
+    </Dependency>
+  </ItemGroup>
+
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+</Project>
index 087ffdb..c176570 100644 (file)
@@ -1,34 +1,53 @@
 <?xml version="1.0" encoding="utf-8"?>
 <Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <ExcludeDepprojReference>true</ExcludeDepprojReference>
+  </PropertyGroup>
+
   <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
 
   <PropertyGroup>
-    <PreventImplementationReference Condition="'$(PackageTargetRuntime)' != ''">true</PreventImplementationReference>
-    <BuildTargetPath>build/$(NETCoreAppFramework)</BuildTargetPath>
-    <PlatformManifestTargetPath>$(BuildTargetPath)</PlatformManifestTargetPath>
-    <FileVersionPropsTargetPath>$(BuildTargetPath)</FileVersionPropsTargetPath>
+    <!-- Exclude runtime.json from the package. -->
+    <IncludeRuntimeJson>false</IncludeRuntimeJson>
+    <IsLineupPackage>false</IsLineupPackage>
 
-    <GenerateRuntimeGraph>true</GenerateRuntimeGraph>
+    <!-- Prevent old baseline dependencies. -->
+    <ExcludeLineupReference>true</ExcludeLineupReference>
 
-    <!-- NETCoreApp sfx is still built by old tooling. Switchover is pending validation. -->
-    <GenerateSharedFramework>false</GenerateSharedFramework>
-  </PropertyGroup>
+    <BuildRuntimePackages>false</BuildRuntimePackages>
 
-  <!-- Identity / Reference package content -->
-  <ItemGroup Condition="'$(PackageTargetRuntime)' == ''">
-    <!-- reference RID specific packages to generate lineup -->
-    <ProjectReference Include="@(RuntimeProject)" />
+    <GenerateSharedFramework>true</GenerateSharedFramework>
+    <GenerateRuntimeGraph>true</GenerateRuntimeGraph>
+
+    <!--
+      Make sure the installer file is generated with the name from /dir.props. This allows the
+      existing infra to bundle it without any changes.
+    -->
+    <InstallerFile>$(SharedFrameworkInstallerFile)</InstallerFile>
 
-    <!-- references the host packages -->
-    <Dependency Include="Microsoft.NETCore.DotNetHostPolicy">
-       <Version>$(HostPolicyVersion)</Version>
-       <TargetFramework>$(NETCoreAppFramework)</TargetFramework>
-    </Dependency>
+    <!-- Lay out the sfx in the legacy location for old packaging to keep working for now. -->
+    <SharedFrameworkLayoutDir>$(SharedFrameworkPublishDir)</SharedFrameworkLayoutDir>
 
-    <File Include="$(MSBuildProjectName).targets">
-      <TargetPath>$(BuildTargetPath)</TargetPath>
-    </File>
+    <!-- These components are installed by the root shared framework, but not others. -->
+    <IncludeWerRelatedKeys>true</IncludeWerRelatedKeys>
+    <IncludeBreadcrumbStoreFolder>true</IncludeBreadcrumbStoreFolder>
+  </PropertyGroup>
+  
+  <ItemGroup>
+    <Dependency Include="Microsoft.NETCore.Platforms" Version="$(MicrosoftNETCorePlatformsPackageVersion)" />
   </ItemGroup>
 
   <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
+
+  <!--
+    Use the internal package to generate the shared framework. Allows the shared framework to
+    continue to have the correct name without other workarounds.
+  -->
+  <Target Name="GetSharedFrameworkPackageReferences"
+          Returns="@(SharedFrameworkPackageReference)">
+    <ItemGroup>
+      <SharedFrameworkPackageReference Include="Microsoft.NETCore.App.Internal" Version="$(Version)" />
+      <SharedFrameworkPackageReference Include="Microsoft.NETCore.DotNetHost" Version="$(HostVersion)" />
+    </ItemGroup>
+  </Target>
 </Project>
diff --git a/src/installer/pkg/projects/netcoreapp/pkg/Microsoft.NETCore.App.targets b/src/installer/pkg/projects/netcoreapp/pkg/Microsoft.NETCore.App.targets
deleted file mode 100644 (file)
index 48d6da6..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-
-  <Target Name="EnsureNETCoreAppRuntime" 
-          Condition="'$(RuntimeIdentifier)' != '' AND '$(EnsureNETCoreAppRuntime)' != 'false'" 
-          AfterTargets="RunResolvePackageDependencies">
-    <ItemGroup>
-      <_netCoreAppPackageDependencies 
-          Include="@(PackageDependencies->WithMetadataValue('ParentPackage', '$(MSBuildThisFileName)/$(_Microsoft_NETCore_App_Version)'))" />
-      <_activeRIDNetCoreAppPackageDependencies 
-          Include="@(_netCoreAppPackageDependencies->WithMetadataValue('ParentTarget', '$(NuGetTargetMoniker)/$(RuntimeIdentifier)'))" />
-      <_activeTFMNetCoreAppPackageDependencies 
-          Include="@(_netCoreAppPackageDependencies->WithMetadataValue('ParentTarget', '$(NuGetTargetMoniker)'))" />
-      <_ridSpecificNetCoreAppPackageDependencies 
-          Include="@(_activeRIDNetCoreAppPackageDependencies)" 
-          Exclude="@(_activeTFMNetCoreAppPackageDependencies)" />
-    </ItemGroup>
-    
-    <Error Condition="'@(_ridSpecificNetCoreAppPackageDependencies)' == ''"
-           Text="Project is targeting runtime '$(RuntimeIdentifier)' but did not resolve any runtime-specific packages for the '$(MSBuildThisFileName)' package.  This runtime may not be supported by .NET Core." />
-  </Target>
-</Project>
\ No newline at end of file
index 3d64106..cd54021 100644 (file)
@@ -15,7 +15,7 @@
   </PropertyGroup>
 
   <!-- Redistribute package content from other nuget packages. -->
-  <ItemGroup Condition="'$(FrameworkPackType)' != 'apphost'">
+  <ItemGroup Condition="'$(FrameworkPackType)' != 'apphost' AND '$(ExcludeDepprojReference)' != 'true'">
     <ProjectReference Include="..\src\netcoreapp.depproj">
       <AdditionalProperties Condition="'$(PackageTargetRuntime)' != ''">NuGetRuntimeIdentifier=$(PackageTargetRuntime)</AdditionalProperties>
     </ProjectReference>
diff --git a/src/installer/sharedFramework/framework/Program.cs b/src/installer/sharedFramework/framework/Program.cs
deleted file mode 100644 (file)
index 4aa370b..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-using System;
-
-namespace ConsoleApplication
-{
-    public class Program
-    {
-        public static void Main(string[] args)
-        {
-        }
-    }
-}
\ No newline at end of file
diff --git a/src/installer/sharedFramework/framework/framework.csproj b/src/installer/sharedFramework/framework/framework.csproj
deleted file mode 100644 (file)
index 52e6553..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<Project Sdk="Microsoft.NET.Sdk">
-
-  <PropertyGroup>
-    <OutputType>Exe</OutputType>
-  </PropertyGroup>
-
-</Project>
diff --git a/src/installer/sharedFramework/lockedhost/lockedhost.csproj b/src/installer/sharedFramework/lockedhost/lockedhost.csproj
deleted file mode 100644 (file)
index 3878513..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-<Project Sdk="Microsoft.NET.Sdk">
-
-  <PropertyGroup>
-    <GenerateAssemblyInfo>false</GenerateAssemblyInfo>
-    <DisableImplicitFrameworkReferences>true</DisableImplicitFrameworkReferences>
-    <CopyBuildOutputToPublishDirectory>false</CopyBuildOutputToPublishDirectory>
-    <CopyOutputSymbolsToPublishDirectory>false</CopyOutputSymbolsToPublishDirectory>
-    <NoWarn>2008;8021</NoWarn>
-  </PropertyGroup>
-
-  <ItemGroup>
-    <PackageReference Include="Microsoft.NETCore.DotNetHostResolver" Version="$(HostResolverVersion)" />
-    <PackageReference Include="Microsoft.NETCore.DotNetHost" Version="$(HostVersion)" />
-  </ItemGroup>
-
-</Project>
diff --git a/src/installer/sharedFramework/sharedFramework.proj b/src/installer/sharedFramework/sharedFramework.proj
deleted file mode 100644 (file)
index 6782480..0000000
+++ /dev/null
@@ -1,165 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
-  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.props))\dir.props" />
-  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), dir.targets))\dir.targets" />
-
-  <UsingTask TaskName="ChangeEntryPointLibraryName" AssemblyFile="$(LocalBuildToolsTaskDir)core-setup.tasks.dll"/>
-  <UsingTask TaskName="ReplaceFileContents" AssemblyFile="$(LocalBuildToolsTaskDir)core-setup.tasks.dll"/>
-  <UsingTask TaskName="ProcessSharedFrameworkDeps" AssemblyFile="$(LocalBuildToolsTaskDir)core-setup.tasks.dll" />
-
-  <PropertyGroup>
-    <BuildTargets>
-      PublishSharedFrameworkAndSharedHost;
-      GenerateRuntimeGraph;
-      CopyHostArtifactsToSharedFramework;
-      GenerateVersionFile;
-    </BuildTargets>
-  </PropertyGroup>
-
-  <PropertyGroup>
-    <CommonProjectArgs>$(MSBuildPassThroughPropertyList) /p:TargetFramework=$(NETCoreAppFramework) /p:RuntimeIdentifier=$(PackageTargetRid)</CommonProjectArgs>
-
-    <!-- SFP is short for SharedFrameworkPublish. Using an abreviation to prevent long path issues. -->
-    <SharedFrameworkIntermediatePackagesDir>$(IntermediateOutputRootPath)SFP.packages\</SharedFrameworkIntermediatePackagesDir>
-    <SharedFrameworkNameAndVersionRoot>$(SharedFrameworkPublishDir)shared\$(SharedFrameworkName)\$(SharedFrameworkNugetVersion)</SharedFrameworkNameAndVersionRoot>
-  </PropertyGroup>
-
-  <Target Name="Build" DependsOnTargets="$(BuildTargets)" />
-
-  <Target Name="PublishSharedFrameworkAndSharedHost"
-          DependsOnTargets="RestoreLockedCoreHost">
-
-    <PropertyGroup>
-      <SharedFrameworkSourceRoot>$(MSBuildThisFileDirectory)framework</SharedFrameworkSourceRoot>
-      <CommonSharedFrameworkArgs>$(CommonProjectArgs) /p:RuntimeFrameworkVersion=$(SharedFrameworkNugetVersion)</CommonSharedFrameworkArgs>
-    </PropertyGroup>
-
-    <RemoveDir Directories="$(SharedFrameworkNameAndVersionRoot)" />
-
-    <!-- Specify a separate 'packages' directory in case we are building an already built version of Microsoft.NETCore.App and the $(PackagesDir)
-         already contains the same version as we are building.  (ex. building source-build for `2.0.0` when `2.0.0` has already shipped.
-    -->
-    <Exec Command="$(DotnetRestoreCommandNoPackages) --source $(PackageOutputPath) --packages $(SharedFrameworkIntermediatePackagesDir) $(CommonSharedFrameworkArgs)"
-          WorkingDirectory="$(SharedFrameworkSourceRoot)" />
-
-    <!-- We publish to a sub folder of the PublishRoot so tools like heat and zip can generate folder structures easier. -->
-    <Exec Command="$(DotnetToolCommand) publish --no-restore --output $(SharedFrameworkNameAndVersionRoot) $(CommonSharedFrameworkArgs)"
-          WorkingDirectory="$(SharedFrameworkSourceRoot)" />
-
-    <!-- Clean deps.json -->
-    <ChangeEntryPointLibraryName DepsFile="$(SharedFrameworkNameAndVersionRoot)/framework.deps.json" />
-
-    <!-- Clean up artifacts that dotnet-publish generates which we don't need -->
-    <ItemGroup>
-      <ToDelete Include="$(SharedFrameworkNameAndVersionRoot)\framework" />
-      <ToDelete Include="$(SharedFrameworkNameAndVersionRoot)\framework.exe" />
-      <ToDelete Include="$(SharedFrameworkNameAndVersionRoot)\framework.dll" />
-      <ToDelete Include="$(SharedFrameworkNameAndVersionRoot)\framework.pdb" />
-      <ToDelete Include="$(SharedFrameworkNameAndVersionRoot)\framework.runtimeconfig.json" />
-      <ToDelete Include="$(SharedFrameworkNameAndVersionRoot)\apphost$(ExeSuffix)" />
-      <ToDelete Include="$(SharedFrameworkNameAndVersionRoot)\$(LibPrefix)hostfxr$(LibSuffix)" />
-      <ToDelete Include="$(SharedFrameworkNameAndVersionRoot)\$(LibPrefix)comhost$(LibSuffix)" />
-      <ToDelete Include="$(SharedFrameworkNameAndVersionRoot)\$(LibPrefix)ijwhost$(LibSuffix)" />
-      <ToDelete Include="$(SharedFrameworkNameAndVersionRoot)\ijwhost.lib" />
-    </ItemGroup>
-
-    <Message Text="To delete: @(ToDelete)" />
-    <Delete Files="@(ToDelete)" />
-
-    <!-- Rename deps file -->
-    <Move SourceFiles="$(SharedFrameworkNameAndVersionRoot)\framework.deps.json"
-          DestinationFiles="$(SharedFrameworkNameAndVersionRoot)\$(SharedFrameworkName).deps.json" />
-
-    <!-- Use the muxer we intended to consume (either restored a shipped version or the one we built) -->
-    <!-- Ensure the host is executable.  See https://github.com/NuGet/Home/issues/4424 -->
-    <Exec Command="chmod u+x $(CoreHostLockedDir)dotnet$(ExeSuffix)"
-          Condition="'$(OSGroup)' != 'Windows_NT'" />
-    <Copy SourceFiles="$(CoreHostLockedDir)dotnet$(ExeSuffix)" DestinationFolder="$(SharedFrameworkPublishDir)" />
-
-    <!--  Use the FXR Resolver we intended to consume (either restored a shipped version or the one we built) -->
-    <Copy SourceFiles="$(CoreHostLockedDir)$(LibPrefix)hostfxr$(LibSuffix)" DestinationFolder="$(SharedFrameworkPublishDir)\host\fxr\$(HostResolverVersion)" />
-
-    <!-- Copy symbols to publish folder -->
-    <ItemGroup>
-      <SharedFrameworkSymbols Include="$(PackageSymbolsBinDir)Microsoft.NETCore.App/**/*.pdb" />
-      <SharedFrameworkSymbols Include="$(PackageSymbolsBinDir)Microsoft.NETCore.App/**/*$(SymbolFileExtension)" />
-      <SharedFrameworkSymbols Include="$(PackageSymbolsBinDir)Microsoft.NETCore.App/**/*$(CrossGenSymbolExtension)"
-                              Condition="'$(CrossGenSymbolExtension)' != ''" />
-    </ItemGroup>
-    <RemoveDir Directories="$(SharedFrameworkPublishSymbolsDir)"
-               Condition="Exists('$(SharedFrameworkPublishSymbolsDir)')" />
-    <MakeDir Directories="$(SharedFrameworkPublishSymbolsDir)" />
-    <Copy SourceFiles="@(SharedFrameworkSymbols)" DestinationFolder="$(SharedFrameworkPublishSymbolsDir)" />
-  </Target>
-
-  <Target Name="GenerateVersionFile"
-          DependsOnTargets="GetLatestCommitHash">
-
-    <!-- Generate .version file -->
-    <ItemGroup>
-      <VersionLines Include="$(LatestCommit)" />
-      <VersionLines Include="$(SharedFrameworkNugetVersion)" />
-    </ItemGroup>
-
-    <WriteLinesToFile
-      File="$(SharedFrameworkNameAndVersionRoot)\.version"
-      Lines="@(VersionLines)"
-      Overwrite="true" />
-  </Target>
-
-  <!-- TODO: Why do we need to have this is M.N.App references the expected version? However,
-             I have noticed that without this, M.N.App publish results in having an older (1.1.x)
-             hostpolicy binary.
-  -->
-  <Target Name="CopyHostArtifactsToSharedFramework">
-    <ItemGroup>
-      <!-- Hostpolicy should be the latest and not the locked version as it is supposed to evolve for -->
-      <!-- the framework and has a tight coupling with coreclr's API in the framework. -->
-      <HostArtifacts Include="$(CoreHostOutputDir)\$(HostPolicyBaseName)" />
-    </ItemGroup>
-    <Copy SourceFiles="@(HostArtifacts)" DestinationFolder="$(SharedFrameworkNameAndVersionRoot)" />
-  </Target>
-
-  <Target Name="GenerateRuntimeGraph">
-    <PropertyGroup>
-      <SharedFrameworkAssetsFile>$(IntermediateOutputRootPath)/framework/project.assets.json</SharedFrameworkAssetsFile>
-      <SharedFrameworkDepsFile>$(SharedFrameworkNameAndVersionRoot)\$(SharedFrameworkName).deps.json</SharedFrameworkDepsFile>
-      <RuntimeGraphGeneratorRuntime Condition="'$(OSGroup)'=='Windows_NT'">win</RuntimeGraphGeneratorRuntime>
-      <RuntimeGraphGeneratorRuntime Condition="'$(OSGroup)'=='OSX'">osx</RuntimeGraphGeneratorRuntime>
-      <RuntimeGraphGeneratorRuntime Condition="'$(OSGroup)'=='FreeBSD'">freebsd</RuntimeGraphGeneratorRuntime>
-      <RuntimeGraphGeneratorRuntime Condition="'$(RuntimeGraphGeneratorRuntime)'==''">linux</RuntimeGraphGeneratorRuntime>
-    </PropertyGroup>
-
-    <ItemGroup>
-      <TrimPkgsFromDeps Include="runtime.$(PackageTargetRid).microsoft.netcore.dotnetapphost" />
-      <TrimPkgsFromDeps Include="runtime.$(PackageTargetRid).microsoft.netcore.dotnethostresolver" />
-      <TrimPkgsFromDeps Include="microsoft.netcore.dotnetapphost" />
-      <TrimPkgsFromDeps Include="microsoft.netcore.dotnethostresolver" />
-    </ItemGroup>
-
-    <ProcessSharedFrameworkDeps AssetsFilePath="$(SharedFrameworkAssetsFile)"
-                                DepsFilePath="$(SharedFrameworkDepsFile)"
-                                PackagesToRemove="@(TrimPkgsFromDeps)"
-                                Runtime="$(RuntimeGraphGeneratorRuntime)"
-                                BuildToolsTaskDir="$(BuildToolsTaskDir)" />
-  </Target>
-
-  <Target Name="RestoreLockedCoreHost">
-    <PropertyGroup>
-      <LockedHostSourceRoot>$(MSBuildThisFileDirectory)lockedhost</LockedHostSourceRoot>
-      <CommonLockedHostArgs>$(CommonProjectArgs) /p:HostResolverVersion=$(HostResolverVersion) /p:HostVersion=$(HostVersion)</CommonLockedHostArgs>
-    </PropertyGroup>
-
-    <RemoveDir Directories="$(CoreHostLockedDir)" />
-
-    <!-- Specify a separate 'packages' directory in case we are building an already built version of Microsoft.NETCore.DotNetHost and the $(PackagesDir)
-         already contains the same version as we are building.  (ex. building source-build for `2.0.0` when `2.0.0` has already shipped.
-    -->
-    <Exec Command="$(DotnetRestoreCommandNoPackages) --source $(PackageOutputPath) --packages $(SharedFrameworkIntermediatePackagesDir) $(CommonLockedHostArgs)"
-          WorkingDirectory="$(LockedHostSourceRoot)" />
-
-    <Exec Command="$(DotnetToolCommand) publish --no-restore --output $(CoreHostLockedDir) $(CommonLockedHostArgs)"
-          WorkingDirectory="$(LockedHostSourceRoot)" />
-  </Target>
-
-</Project>
diff --git a/src/installer/test/Assets/TestProjects/Directory.Build.props b/src/installer/test/Assets/TestProjects/Directory.Build.props
new file mode 100644 (file)
index 0000000..da5bb19
--- /dev/null
@@ -0,0 +1,4 @@
+<Project>
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory).., Directory.Build.props))\Directory.Build.props" />
+  <Import Project="$(MSBuildThisFileDirectory)MNADeprecationWorkaround.props" />
+</Project>
diff --git a/src/installer/test/Assets/TestProjects/MNADeprecationWorkaround.props b/src/installer/test/Assets/TestProjects/MNADeprecationWorkaround.props
new file mode 100644 (file)
index 0000000..4ed66ef
--- /dev/null
@@ -0,0 +1,18 @@
+<Project>
+
+  <!--
+    Starting with 3.0, Microsoft.NETCore.App (MNA) is a dummy package, no longer providing any build
+    or runtime assets. For compatibility with existing tests, Microsoft.NETCore.App.Internal (MNAI)
+    now exists as an internal compatibility package. It contains the assets MNA used to have.
+
+    Inject the MNAI package with an opportunity to disable for non-3.0 projects.
+  -->
+  <PropertyGroup>
+    <UseMicrosoftNETCoreAppInternalWorkaround Condition="'$(UseMicrosoftNETCoreAppInternalWorkaround)' == ''">true</UseMicrosoftNETCoreAppInternalWorkaround>
+  </PropertyGroup>
+
+  <ItemGroup Condition="'$(UseMicrosoftNETCoreAppInternalWorkaround)' == 'true'">
+    <PackageReference Include="Microsoft.NETCore.App.Internal" Version="$(MNAVersion)" />
+  </ItemGroup>
+
+</Project>
index 83efdd4..b4ea72e 100644 (file)
@@ -1,4 +1,6 @@
-<Project Sdk="Microsoft.NET.Sdk">
+<Project>
+
+  <Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
 
   <PropertyGroup>
     <TargetFramework>$(NETCoreAppFramework)</TargetFramework>
     <PackageReference Include="Newtonsoft.Json" Version="9.0.1" />
   </ItemGroup>
 
+  <Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
+
+  <!--
+    Work around "dotnet store" relying on Microsoft.NETCore.App. See MNADeprecationWorkaround.props.
+
+    Explicit Sdk.targets import is required to override this.
+  -->
+
+  <!-- BEGIN copy: Taken and modified from 'Tools\dotnetcli\sdk\2.1.401\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.CrossGen.targets' -->
+
+  <Target Name="_RestoreCrossgen"
+          DependsOnTargets="PrepforRestoreForComposeStore;
+                           _SetupStageForCrossgen;"
+          Condition="$(SkipOptimization) != 'true' ">
+    <!-- Was:
+    <MSBuild Projects="$(MSBuildProjectFullPath)"
+                 Targets="Restore"
+                 Properties="RestoreGraphProjectInput=$(MSBuildProjectFullPath);
+                             DisableImplicitFrameworkReferences=true;
+                             RestoreOutputPath=$(_CrossProjFileDir);
+                             StorePackageName=$(MicrosoftNETPlatformLibrary);
+                             StorePackageVersion=$(RuntimeFrameworkVersion);"/>
+    -->
+    <MSBuild Projects="$(MSBuildProjectFullPath)"
+                 Targets="Restore"
+                 Properties="RestoreGraphProjectInput=$(MSBuildProjectFullPath);
+                             DisableImplicitFrameworkReferences=true;
+                             RestoreOutputPath=$(_CrossProjFileDir);
+                             StorePackageName=Microsoft.NETCore.App.Internal;
+                             StorePackageVersion=$(RuntimeFrameworkVersion);"/>
+
+    <ResolvePublishAssemblies ProjectPath="$(MSBuildProjectFullPath)"
+                              AssetsFilePath="$(_CrossProjAssetsFile)"
+                              TargetFramework="$(_TFM)"
+                              RuntimeIdentifier="$(RuntimeIdentifier)"
+                              PlatformLibraryName="$(MicrosoftNETPlatformLibrary)"
+                              ExcludeFromPublishPackageReferences="@(_ExcludeFromPublishPackageReference)"
+                              IsSelfContained="$(SelfContained)"
+                              PreserveStoreLayout="false">
+
+      <Output TaskParameter="AssembliesToPublish" ItemName="CrossgenResolvedAssembliesToPublish" />
+    </ResolvePublishAssemblies>
+
+    <!-- Copy managed files to  a flat temp directory for passing it as ref for crossgen -->
+    <Copy SourceFiles = "@(CrossgenResolvedAssembliesToPublish)"
+          DestinationFolder="$(_NetCoreRefDir)"
+          OverwriteReadOnlyFiles="$(OverwriteReadOnlyFiles)"
+          Retries="$(CopyRetryCount)"
+          RetryDelayMilliseconds="$(CopyRetryDelayMilliseconds)"
+          UseHardlinksIfPossible="$(CreateHardLinksForPublishFilesIfPossible)"
+          UseSymboliclinksIfPossible="$(CreateSymbolicLinksForPublishFilesIfPossible)">
+
+      <Output TaskParameter="DestinationFiles" ItemName="FileWrites"/>
+    </Copy>
+  </Target>
+
+  <!-- END copy -->
+
 </Project>
diff --git a/src/installer/test/Assets/TestProjects/StandaloneApp20/Directory.Build.props b/src/installer/test/Assets/TestProjects/StandaloneApp20/Directory.Build.props
new file mode 100644 (file)
index 0000000..15b3000
--- /dev/null
@@ -0,0 +1,10 @@
+<Project>
+
+  <!-- This project isn't 3.0, don't use workaround. -->
+  <PropertyGroup>
+    <UseMicrosoftNETCoreAppInternalWorkaround>false</UseMicrosoftNETCoreAppInternalWorkaround>
+  </PropertyGroup>
+
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory).., Directory.Build.props))\Directory.Build.props" />
+
+</Project>
diff --git a/src/installer/test/Assets/TestProjects/StandaloneApp21/Directory.Build.props b/src/installer/test/Assets/TestProjects/StandaloneApp21/Directory.Build.props
new file mode 100644 (file)
index 0000000..15b3000
--- /dev/null
@@ -0,0 +1,10 @@
+<Project>
+
+  <!-- This project isn't 3.0, don't use workaround. -->
+  <PropertyGroup>
+    <UseMicrosoftNETCoreAppInternalWorkaround>false</UseMicrosoftNETCoreAppInternalWorkaround>
+  </PropertyGroup>
+
+  <Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory).., Directory.Build.props))\Directory.Build.props" />
+
+</Project>