param (
-$targetFramework = "netcoreapp3.0",
+$frameworkVersion = "3.0",
$runtimeVersion = "3.0.0-*",
$refDirName = "netcoreapp30_compat",
$rid = "win7-x64"
return $matches[0]
}
-$repoRoot = ((get-item $PSScriptRoot).parent.parent.parent.FullName);
+$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE = 1
+
+$repoRoot = ((get-item $PSScriptRoot).parent.parent.parent.FullName)
$dotnetPath = -join($repoRoot, "\Tools\dotnetcli\dotnet.exe")
$csprojPath = -join($PSScriptRoot, "\", (Get-ChildItem $PSScriptRoot"\*.csproj" | Select-Object -ExpandProperty Name))
$packagesCachePath = -join($repoRoot, "\packages")
$localPackageSourcePath = -join($repoRoot, "\bin\packages\Debug\")
+$targetFramework = -join("netcoreapp", $frameworkVersion)
if (!(Test-Path $localPackageSourcePath))
{
Write-Output "Calling dotnet restore"
& $dotnetPath restore --packages $packagesCachePath /p:RestoreSources="$restoreSources" /p:TargetFramework=$targetFramework /p:CompatibilityPackageVersion=$compatPackageVersion /p:PrivateCorefxPackageVersion=$privatePackageVersion /p:RuntimeIdentifiers=$rid $csprojPath
-Write-Output "Calling dotnet publish"
-& $dotnetPath publish -r $rid /p:RestoreSources="$restoreSources" /p:TargetFramework=$targetFramework /p:CompatibilityPackageVersion=$compatPackageVersion /p:RuntimeFrameworkVersion=$runtimeFramework /p:PrivateCorefxPackageVersion=$privatePackageVersion /p:RuntimeIdentifiers=$rid $csprojPath
-
$outputPath = -join($PSScriptRoot, "\bin\Debug\", $targetFramework, "\", $rid, "\publish\refs\")
+Write-Output "Calling dotnet publish"
+& $dotnetPath publish -r $rid -o $outputPath /p:NugetMonikerVersion=$frameworkVersion /p:RestoreSources="$restoreSources" /p:TargetFramework=$targetFramework /p:CompatibilityPackageVersion=$compatPackageVersion /p:RuntimeFrameworkVersion=$runtimeFramework /p:PrivateCorefxPackageVersion=$privatePackageVersion /p:RuntimeIdentifiers=$rid $csprojPath
+
if (!(Test-Path $outputPath))
{
Write-Error -Message (-join("There was an error while publishing for framework: ", $targetFramework))
}
New-Item $refPath -ItemType directory
-Copy-Item (-join($outputPath, "*")) $refPath
+Remove-Item (-join($outputPath, "Microsoft.Windows.Compatibility.Validation.dll")) -force
+Copy-Item (-join($outputPath, "*.dll")) $refPath