From bb360cbff8e7f5dd47084f23bc76340f53c61910 Mon Sep 17 00:00:00 2001 From: Medeni Baykal <433724+Haplois@users.noreply.github.com> Date: Fri, 13 Nov 2020 11:01:27 +0100 Subject: [PATCH] Fixed assembly loading issue for netcoreapp. (#2631) --- scripts/build.ps1 | 18 ++++++---- scripts/verify-nupkgs.ps1 | 2 +- ...rosoft.TestPlatform.TestHost.NetCore.props | 10 ++++++ .../nuspec/TestPlatform.TestHost.nuspec | 33 +++++++++---------- src/package/sign/sign.proj | 4 +++ 5 files changed, 43 insertions(+), 24 deletions(-) diff --git a/scripts/build.ps1 b/scripts/build.ps1 index 7fc073d38c..15150b7ada 100644 --- a/scripts/build.ps1 +++ b/scripts/build.ps1 @@ -375,20 +375,26 @@ function Publish-Package # Copy the .NET core x86 and x64 testhost exes from tempPublish to required folder New-Item -ItemType directory -Path $testhostCore20PackageX64Dir -Force | Out-Null - Copy-Item $testhostCore20PackageTempX64Dir\testhost* $testhostCore20PackageX64Dir -Force -recurse + Copy-Item $testhostCore20PackageTempX64Dir\testhost* $testhostCore20PackageX64Dir -Force -Recurse + Copy-Item $testhostCore20PackageTempX64Dir\Microsoft.TestPlatform.PlatformAbstractions.dll $testhostCore20PackageX64Dir -Force + New-Item -ItemType directory -Path $testhostCore20PackageX86Dir -Force | Out-Null - Copy-Item $testhostCore20PackageTempX86Dir\testhost.x86* $testhostCore20PackageX86Dir -Force -recurse + Copy-Item $testhostCore20PackageTempX86Dir\testhost.x86* $testhostCore20PackageX86Dir -Force -Recurse + Copy-Item $testhostCore20PackageTempX86Dir\Microsoft.TestPlatform.PlatformAbstractions.dll $testhostCore20PackageX86Dir -Force New-Item -ItemType directory -Path $testhostCore10PackageX64Dir -Force | Out-Null - Copy-Item $testhostCore10PackageTempX64Dir\testhost* $testhostCore10PackageX64Dir -Force -recurse + Copy-Item $testhostCore10PackageTempX64Dir\testhost* $testhostCore10PackageX64Dir -Force -Recurse + Copy-Item $testhostCore20PackageTempX64Dir\Microsoft.TestPlatform.PlatformAbstractions.dll $testhostCore10PackageX64Dir -Force + New-Item -ItemType directory -Path $testhostCore10PackageX86Dir -Force | Out-Null - Copy-Item $testhostCore10PackageTempX86Dir\testhost.x86* $testhostCore10PackageX86Dir -Force -recurse + Copy-Item $testhostCore10PackageTempX86Dir\testhost.x86* $testhostCore10PackageX86Dir -Force -Recurse + Copy-Item $testhostCore10PackageTempX86Dir\Microsoft.TestPlatform.PlatformAbstractions.dll $testhostCore10PackageX86Dir -Force # Copy over the Full CLR built testhost package assemblies to the Core CLR and Full CLR package folder. $coreCLRFull_Dir = "TestHost" $fullDestDir = Join-Path $coreCLR20PackageDir $coreCLRFull_Dir New-Item -ItemType directory -Path $fullDestDir -Force | Out-Null - Copy-Item $testhostFullPackageDir\* $fullDestDir -Force -recurse + Copy-Item $testhostFullPackageDir\* $fullDestDir -Force -Recurse Set-ScriptFailedOnError @@ -396,7 +402,7 @@ function Publish-Package Publish-PackageInternal $dataCollectorProject $TPB_TargetFramework472 $fullDestDir New-Item -ItemType directory -Path $fullCLRPackage451Dir -Force | Out-Null - Copy-Item $testhostFullPackageDir\* $fullCLRPackage451Dir -Force -recurse + Copy-Item $testhostFullPackageDir\* $fullCLRPackage451Dir -Force -Recurse Set-ScriptFailedOnError diff --git a/scripts/verify-nupkgs.ps1 b/scripts/verify-nupkgs.ps1 index dc458e51bd..1a259031d7 100644 --- a/scripts/verify-nupkgs.ps1 +++ b/scripts/verify-nupkgs.ps1 @@ -21,7 +21,7 @@ function Verify-Nuget-Packages($packageDirectory) "Microsoft.TestPlatform.Extensions.TrxLogger" = 33; "Microsoft.TestPlatform.ObjectModel" = 178; "Microsoft.TestPlatform.Portable" = 566; - "Microsoft.TestPlatform.TestHost" = 197; + "Microsoft.TestPlatform.TestHost" = 210; "Microsoft.TestPlatform.TranslationLayer" = 121} $nugetPackages = Get-ChildItem -Filter "*.nupkg" $packageDirectory | % { $_.FullName} diff --git a/src/package/nuspec/Microsoft.TestPlatform.TestHost.NetCore.props b/src/package/nuspec/Microsoft.TestPlatform.TestHost.NetCore.props index b57ffe1287..32ff965b58 100644 --- a/src/package/nuspec/Microsoft.TestPlatform.TestHost.NetCore.props +++ b/src/package/nuspec/Microsoft.TestPlatform.TestHost.NetCore.props @@ -11,6 +11,11 @@ PreserveNewest False + + Microsoft.TestPlatform.PlatformAbstractions.dll + PreserveNewest + False + @@ -23,5 +28,10 @@ PreserveNewest False + + Microsoft.TestPlatform.PlatformAbstractions.dll + PreserveNewest + False + \ No newline at end of file diff --git a/src/package/nuspec/TestPlatform.TestHost.nuspec b/src/package/nuspec/TestPlatform.TestHost.nuspec index 39d1a8e8b2..4e74cb8f3c 100644 --- a/src/package/nuspec/TestPlatform.TestHost.nuspec +++ b/src/package/nuspec/TestPlatform.TestHost.nuspec @@ -40,45 +40,44 @@ - - - - + + - - - + + + + + + - - - - + + - - + + + + - - - - + + diff --git a/src/package/sign/sign.proj b/src/package/sign/sign.proj index a1cf0dc0d5..67b7e8b404 100644 --- a/src/package/sign/sign.proj +++ b/src/package/sign/sign.proj @@ -389,8 +389,10 @@ + + @@ -402,8 +404,10 @@ + +