Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/dotnet/runtime.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/eng
diff options
context:
space:
mode:
authorViktor Hofer <viktor.hofer@microsoft.com>2020-07-23 18:20:26 +0300
committerGitHub <noreply@github.com>2020-07-23 18:20:26 +0300
commit809a06f45161ae686a06b9e9ccc2f45097b91657 (patch)
treedaa6d29750bc49c463679fc189ae2ecb6618438d /eng
parente8c4169b4fc4eb9a71f296b3bd2e96db16d32d35 (diff)
Remove depprojs in favor of PackageReferences (#35606)
- Remove depprojs which currently binplace external references into the RefPath folders in favor of PackageReference and PackageDownload items. - Build all configurations by default when building an individual project (either on the CLI or inside VS) same as with the official SDK. This enables .NETFramework Test Explorer support. - Centrally define libraries that compose the shared framework instead of in each Directory.Build.props file to be able to build the targeting pack first and consume it in the OOB libraries. - Use ProjectReferences to reference OOB projects. Compile against the reference assembly but use the implementation assembly app-local during runtime. - Remove OOBs from the testhost and remove the testhost folder for .NETFramework as it isn't required anymore. - Only binplace for $(NetCoreAppCurrent) to compose a) the targeting pack, b) the runtime pack, c) the testhost, d) a full closure for the shims. - Use Targeting Packs for OOB projects (with their implicit assembly references) but still explicitly define granular references for .NETCoreApp configurations (DisableImplicitAssemblyReferences switch). Use the implicit targeting pack references in some Microsoft.Extensions.* cases. - Remove placeholder configurations as they aren't needed anymore with explicit P2Ps vs Targeting Pack references. - Remove implicit assembly references (ie for .NETFramework, mscorlib) - Remove AssemblySearchPath hacks that were introduced with b7c4cb7 as the targeting pack is now used by default. - Reduce unnecessary .NETFramework configurations that were added to run tests in favor of the already existing ref&src configurations. - Stop hardcoding the paths for wasm assemblies and use the returned TargetPath of the ProjectReferences. - Addressed formatting (ItemGroups, References at the bottom of the project file, ordering of references, use LibrariesProjectRoot instead of a relative path, unnecessary AssemblyName and RootNamespace properties which are identical to the project name, ordering of tfms) - Revert "fix clean (#33758)"
Diffstat (limited to 'eng')
-rw-r--r--eng/AvoidRestoreCycleOnSelfReference.targets14
-rw-r--r--eng/BeforeTargetFrameworkInference.targets4
-rw-r--r--eng/Configurations.props2
-rw-r--r--eng/Subsets.props9
-rw-r--r--eng/Version.Details.xml2
-rw-r--r--eng/Versions.props37
-rw-r--r--eng/build.ps12
-rwxr-xr-xeng/build.sh2
-rw-r--r--eng/illink.targets2
-rw-r--r--eng/pipelines/coreclr/templates/perf-job.yml6
-rw-r--r--eng/pipelines/libraries/base-job.yml6
-rw-r--r--eng/pipelines/libraries/build-job.yml4
-rw-r--r--eng/pipelines/libraries/helix-queues-setup.yml12
-rw-r--r--eng/pipelines/libraries/outerloop.yml2
-rw-r--r--eng/pipelines/libraries/run-test-job.yml4
-rw-r--r--eng/pipelines/runtime.yml2
-rw-r--r--eng/referenceAssemblies.props8
-rw-r--r--eng/referenceFromRuntime.targets124
-rw-r--r--eng/references.targets91
-rw-r--r--eng/resolveContract.targets49
-rw-r--r--eng/restore/repoRestore.props1
-rw-r--r--eng/targetingpacks.targets106
-rw-r--r--eng/testing/.runsettings4
-rw-r--r--eng/testing/RunnerTemplate.cmd6
-rw-r--r--eng/testing/netfx.exe.config1
-rw-r--r--eng/testing/outerBuild.targets8
-rw-r--r--eng/testing/runsettings.targets1
-rw-r--r--eng/testing/runtimeConfiguration.targets40
-rw-r--r--eng/testing/tests.mobile.targets15
-rw-r--r--eng/testing/tests.props2
-rw-r--r--eng/testing/tests.targets10
-rw-r--r--eng/testing/xunit/xunit.console.targets10
-rw-r--r--eng/testing/xunit/xunit.targets7
33 files changed, 304 insertions, 289 deletions
diff --git a/eng/AvoidRestoreCycleOnSelfReference.targets b/eng/AvoidRestoreCycleOnSelfReference.targets
new file mode 100644
index 00000000000..cb665cb070d
--- /dev/null
+++ b/eng/AvoidRestoreCycleOnSelfReference.targets
@@ -0,0 +1,14 @@
+<Project>
+ <!-- Set PackageId to a temporary value to avoid NuGet restore cycle error NU1108: https://github.com/NuGet/Home/issues/6754 -->
+ <PropertyGroup>
+ <_PackageIdTemp>$(PackageId)</_PackageIdTemp>
+ <PackageId>$(PackageId)_temp</PackageId>
+ </PropertyGroup>
+
+ <Target Name="_UpdatePackageId"
+ BeforeTargets="$(PackDependsOn)" >
+ <PropertyGroup>
+ <PackageId>$(_PackageIdTemp)</PackageId>
+ </PropertyGroup>
+ </Target>
+</Project> \ No newline at end of file
diff --git a/eng/BeforeTargetFrameworkInference.targets b/eng/BeforeTargetFrameworkInference.targets
index 92adb5df635..abef4c8981a 100644
--- a/eng/BeforeTargetFrameworkInference.targets
+++ b/eng/BeforeTargetFrameworkInference.targets
@@ -6,10 +6,6 @@
<TargetFramework>$(TargetFramework.SubString(0, $(TargetFramework.IndexOf('-'))))</TargetFramework>
</PropertyGroup>
- <PropertyGroup>
- <RefPath>$([MSBuild]::NormalizeDirectory('$(RefRootPath)', '$(TargetFramework)'))</RefPath>
- </PropertyGroup>
-
<Import Project="$(MSBuildThisDirectory)targetframeworksuffix.props" Condition="'$(DesignTimeBuild)' == 'true'" />
<PropertyGroup>
diff --git a/eng/Configurations.props b/eng/Configurations.props
index aa8e9add17d..59424f7cc30 100644
--- a/eng/Configurations.props
+++ b/eng/Configurations.props
@@ -29,8 +29,6 @@
<NETCoreAppFramework>$(NetCoreAppCurrent)</NETCoreAppFramework>
<SharedFrameworkName>Microsoft.NETCore.App</SharedFrameworkName>
<NetCoreAppCurrentBrandName>.NET $(NetCoreAppCurrentVersion)</NetCoreAppCurrentBrandName>
-
- <NetFrameworkCurrent>net472</NetFrameworkCurrent>
<MinimiumSupportedWindowsPlatform>WINDOWS7.0</MinimiumSupportedWindowsPlatform>
</PropertyGroup>
diff --git a/eng/Subsets.props b/eng/Subsets.props
index 958389db150..ba103417c83 100644
--- a/eng/Subsets.props
+++ b/eng/Subsets.props
@@ -59,7 +59,7 @@
<DefaultMonoSubsets Condition="'$(MonoEnableLLVM)' == 'true' and '$(MonoLLVMDir)' == ''">mono.llvm+</DefaultMonoSubsets>
<DefaultMonoSubsets>$(DefaultMonoSubsets)mono.runtime+mono.corelib</DefaultMonoSubsets>
- <DefaultLibrariesSubsets>libs.depprojs+libs.native+libs.ref+libs.src+libs.pretest+libs.packages</DefaultLibrariesSubsets>
+ <DefaultLibrariesSubsets>libs.native+libs.ref+libs.src+libs.pretest+libs.packages</DefaultLibrariesSubsets>
<DefaultInstallerSubsets>corehost+installer.managed+installer.depprojs+installer.pkgprojs+bundles+installers+installer.tests</DefaultInstallerSubsets>
<DefaultInstallerSubsets Condition="'$(RuntimeFlavor)' == 'Mono'">installer.pkgprojs</DefaultInstallerSubsets>
@@ -95,7 +95,6 @@
<!-- Libs -->
<SubsetName Include="Libs" Description="The libraries native part, refs and source assemblies, test infra and packages, but NOT the tests (use Libs.Tests to request those explicitly)" />
- <SubsetName Include="Libs.Depprojs" Description="The libraries upfront restore projects." />
<SubsetName Include="Libs.Native" Description="The native libraries used in the shared framework." />
<SubsetName Include="Libs.Ref" Description="The managed reference libraries." />
<SubsetName Include="Libs.Src" Description="The managed implementation libraries." />
@@ -177,12 +176,6 @@
</ItemGroup>
<!-- Libraries sets -->
- <ItemGroup Condition="$(_subset.Contains('+libs.depprojs+'))">
- <LibrariesRestoreProject Include="$(LibrariesProjectRoot)restore\depproj.proj">
- <AdditionalProperties Condition="'$(LibrariesConfiguration)' != ''">Configuration=$(LibrariesConfiguration)</AdditionalProperties>
- </LibrariesRestoreProject>
- </ItemGroup>
-
<ItemGroup Condition="$(_subset.Contains('+libs.native+'))">
<ProjectToBuild Include="$(LibrariesProjectRoot)Native\build-native.proj" Category="libs" />
</ItemGroup>
diff --git a/eng/Version.Details.xml b/eng/Version.Details.xml
index 2940b3c13c7..cf9414cfae4 100644
--- a/eng/Version.Details.xml
+++ b/eng/Version.Details.xml
@@ -46,7 +46,7 @@
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>ff5d4b6c8dbdaeacb6e6159d3f8185118dffd915</Sha>
</Dependency>
- <Dependency Name="Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk" Version="5.0.0-beta.20364.3">
+ <Dependency Name="Microsoft.DotNet.Build.Tasks.TargetFramework.Sdk" Version="5.0.0-beta.20372.2">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>ff5d4b6c8dbdaeacb6e6159d3f8185118dffd915</Sha>
</Dependency>
diff --git a/eng/Versions.props b/eng/Versions.props
index c06cc9058ab..4d00ac9bfe4 100644
--- a/eng/Versions.props
+++ b/eng/Versions.props
@@ -18,6 +18,7 @@
<UsingToolMicrosoftNetCompilers>true</UsingToolMicrosoftNetCompilers>
<UsingToolIbcOptimization>true</UsingToolIbcOptimization>
<UsingToolXliff>false</UsingToolXliff>
+ <UsingToolNetFrameworkReferenceAssemblies>true</UsingToolNetFrameworkReferenceAssemblies>
<!-- Blob storage container that has the "Latest" channel to publish to. -->
<ContainerName>dotnet</ContainerName>
<ChecksumContainerName>$(ContainerName)</ChecksumContainerName>
@@ -56,10 +57,10 @@
<MicrosoftDotNetCodeAnalysisVersion>5.0.0-beta.20364.3</MicrosoftDotNetCodeAnalysisVersion>
<MicrosoftDotNetGenAPIVersion>5.0.0-beta.20364.3</MicrosoftDotNetGenAPIVersion>
<MicrosoftDotNetGenFacadesVersion>5.0.0-beta.20364.3</MicrosoftDotNetGenFacadesVersion>
- <MicrosoftDotNetXUnitExtensionsVersion>5.0.0-beta.20364.3</MicrosoftDotNetXUnitExtensionsVersion>
+ <MicrosoftDotNetXUnitExtensionsVersion>5.0.0-beta.20367.6</MicrosoftDotNetXUnitExtensionsVersion>
<MicrosoftDotNetXUnitConsoleRunnerVersion>2.5.1-beta.20364.3</MicrosoftDotNetXUnitConsoleRunnerVersion>
<MicrosoftDotNetBuildTasksPackagingVersion>5.0.0-beta.20364.3</MicrosoftDotNetBuildTasksPackagingVersion>
- <MicrosoftDotNetRemoteExecutorVersion>5.0.0-beta.20364.3</MicrosoftDotNetRemoteExecutorVersion>
+ <MicrosoftDotNetRemoteExecutorVersion>5.0.0-beta.20367.6</MicrosoftDotNetRemoteExecutorVersion>
<MicrosoftDotNetVersionToolsTasksVersion>5.0.0-beta.20364.3</MicrosoftDotNetVersionToolsTasksVersion>
<!-- Installer dependencies -->
<MicrosoftNETCoreAppVersion>5.0.0-preview.4.20202.18</MicrosoftNETCoreAppVersion>
@@ -69,7 +70,36 @@
<!-- CoreClr dependencies -->
<MicrosoftNETCoreILAsmVersion>5.0.0-preview.8.20359.4</MicrosoftNETCoreILAsmVersion>
<!-- Libraries dependencies -->
+ <SystemBuffersVersion>4.5.1</SystemBuffersVersion>
+ <SystemCollectionsVersion>4.3.0</SystemCollectionsVersion>
+ <SystemCollectionsConcurrentVersion>4.3.0</SystemCollectionsConcurrentVersion>
+ <SystemComponentModelAnnotationsVersion>4.7.0</SystemComponentModelAnnotationsVersion>
+ <SystemDataSqlClientVersion>4.8.1</SystemDataSqlClientVersion>
+ <SystemDiagnosticsContractsVersion>4.3.0</SystemDiagnosticsContractsVersion>
+ <SystemDiagnosticsDebugVersion>4.3.0</SystemDiagnosticsDebugVersion>
+ <SystemDiagnosticsTracingVersion>4.3.0</SystemDiagnosticsTracingVersion>
+ <SystemDynamicRuntimeVersion>4.3.0</SystemDynamicRuntimeVersion>
+ <SystemLinqExpressionsVersion>4.3.0</SystemLinqExpressionsVersion>
+ <SystemMemoryVersion>4.5.4</SystemMemoryVersion>
+ <SystemNetHttpVersion>4.3.4</SystemNetHttpVersion>
+ <SystemNetPrimitivesVersion>4.3.1</SystemNetPrimitivesVersion>
+ <SystemNumericsVectorsVersion>4.5.0</SystemNumericsVectorsVersion>
+ <SystemResourcesResourceManagerVersion>4.3.0</SystemResourcesResourceManagerVersion>
+ <SystemRuntimeVersion>4.3.1</SystemRuntimeVersion>
+ <SystemRuntimeExtensionsVersion>4.3.1</SystemRuntimeExtensionsVersion>
+ <SystemRuntimeInteropServicesVersion>4.3.0</SystemRuntimeInteropServicesVersion>
+ <SystemRuntimeInteropServicesRuntimeInformationVersion>4.3.0</SystemRuntimeInteropServicesRuntimeInformationVersion>
+ <SystemRuntimeSerializationPrimitivesVersion>4.3.0</SystemRuntimeSerializationPrimitivesVersion>
+ <SystemSecurityCryptographyAlgorithmsVersion>4.3.1</SystemSecurityCryptographyAlgorithmsVersion>
+ <SystemSecurityCryptographyCngVersion>4.7.0</SystemSecurityCryptographyCngVersion>
+ <SystemSecurityCryptographyPkcsVersion>4.7.0</SystemSecurityCryptographyPkcsVersion>
+ <SystemSecurityCryptographyOpenSslVersion>4.7.0</SystemSecurityCryptographyOpenSslVersion>
<SystemTextJsonVersion>5.0.0-preview.4.20202.18</SystemTextJsonVersion>
+ <SystemThreadingVersion>4.3.0</SystemThreadingVersion>
+ <SystemThreadingTasksExtensionsVersion>4.5.4</SystemThreadingTasksExtensionsVersion>
+ <SystemValueTupleVersion>4.5.0</SystemValueTupleVersion>
+ <MicrosoftBclAsyncInterfacesVersion>1.1.1</MicrosoftBclAsyncInterfacesVersion>
+ <MicrosoftWin32PrimitivesVersion>4.3.0</MicrosoftWin32PrimitivesVersion>
<runtimenativeSystemIOPortsVersion>5.0.0-alpha.1.19563.3</runtimenativeSystemIOPortsVersion>
<!-- Runtime-Assets dependencies -->
<SystemComponentModelTypeConverterTestDataVersion>5.0.0-beta.20364.1</SystemComponentModelTypeConverterTestDataVersion>
@@ -82,6 +112,7 @@
<SystemWindowsExtensionsTestDataVersion>5.0.0-beta.20364.1</SystemWindowsExtensionsTestDataVersion>
<!-- Standard dependencies -->
<NETStandardLibraryVersion>2.2.0-prerelease.19564.1</NETStandardLibraryVersion>
+ <NetStandardLibrary20Version>2.0.3</NetStandardLibrary20Version>
<!-- dotnet-optimization dependencies -->
<optimizationwindows_ntx64IBCCoreFxVersion>99.99.99-master-20200228.3</optimizationwindows_ntx64IBCCoreFxVersion>
<optimizationlinuxx64IBCCoreFxVersion>99.99.99-master-20200228.3</optimizationlinuxx64IBCCoreFxVersion>
@@ -101,8 +132,6 @@
<RefOnlyMicrosoftBuildUtilitiesCoreVersion>$(RefOnlyMicrosoftBuildVersion)</RefOnlyMicrosoftBuildUtilitiesCoreVersion>
<RefOnlyNugetProjectModelVersion>4.9.4</RefOnlyNugetProjectModelVersion>
<RefOnlyNugetPackagingVersion>4.9.4</RefOnlyNugetPackagingVersion>
- <!-- System.Data.SqlClient -->
- <SystemDataSqlClientVersion>4.8.0</SystemDataSqlClientVersion>
<!-- Testing -->
<MicrosoftNETTestSdkVersion>16.8.0-preview-20200716-03</MicrosoftNETTestSdkVersion>
<MicrosoftDotNetXHarnessTestRunnersXunitVersion>1.0.0-prerelease.20352.3</MicrosoftDotNetXHarnessTestRunnersXunitVersion>
diff --git a/eng/build.ps1 b/eng/build.ps1
index f8b205bd393..016ed15d203 100644
--- a/eng/build.ps1
+++ b/eng/build.ps1
@@ -65,7 +65,7 @@ function Get-Help() {
Write-Host "Libraries settings:"
Write-Host " -allconfigurations Build packages for all build configurations."
Write-Host " -coverage Collect code coverage when testing."
- Write-Host " -framework (-f) Build framework: net5.0 or net472."
+ Write-Host " -framework (-f) Build framework: net5.0 or net48."
Write-Host " [Default: net5.0]"
Write-Host " -testnobuild Skip building tests when invoking -test."
Write-Host " -testscope Scope tests, allowed values: innerloop, outerloop, all."
diff --git a/eng/build.sh b/eng/build.sh
index eb0cb586ebf..da8e3770f59 100755
--- a/eng/build.sh
+++ b/eng/build.sh
@@ -60,7 +60,7 @@ usage()
echo "Libraries settings:"
echo " --allconfigurations Build packages for all build configurations."
echo " --coverage Collect code coverage when testing."
- echo " --framework (-f) Build framework: net5.0 or net472."
+ echo " --framework (-f) Build framework: net5.0 or net48."
echo " [Default: net5.0]"
echo " --testnobuild Skip building tests when invoking -test."
echo " --testscope Test scope, allowed values: innerloop, outerloop, all."
diff --git a/eng/illink.targets b/eng/illink.targets
index 601b0b798fb..79eb5d40964 100644
--- a/eng/illink.targets
+++ b/eng/illink.targets
@@ -27,7 +27,7 @@
<PropertyGroup>
<ILLinkTasksDir>$([MSBuild]::NormalizeDirectory('$(PkgMicrosoft_NET_ILLink_Tasks)', 'tools'))</ILLinkTasksDir>
<ILLinkTasksPath Condition="'$(ILLinkTasksPath)' == '' and '$(MSBuildRuntimeType)' == 'core'">$(ILLinkTasksDir)netcoreapp3.0/ILLink.Tasks.dll</ILLinkTasksPath>
- <ILLinkTasksPath Condition="'$(ILLinkTasksPath)' == '' and '$(MSBuildRuntimeType)' != 'core'">$(ILLinkTasksDir)$(NetFrameworkCurrent)/ILLink.Tasks.dll</ILLinkTasksPath>
+ <ILLinkTasksPath Condition="'$(ILLinkTasksPath)' == '' and '$(MSBuildRuntimeType)' != 'core'">$(ILLinkTasksDir)net472/ILLink.Tasks.dll</ILLinkTasksPath>
<ILLinkTrimAssemblyPath>$(IntermediateOutputPath)$(TargetName)$(TargetExt)</ILLinkTrimAssemblyPath>
<ILLinkTrimAssemblySymbols>$(IntermediateOutputPath)$(TargetName).pdb</ILLinkTrimAssemblySymbols>
<ILLinkTrimInputPath>$(IntermediateOutputPath)PreTrim/</ILLinkTrimInputPath>
diff --git a/eng/pipelines/coreclr/templates/perf-job.yml b/eng/pipelines/coreclr/templates/perf-job.yml
index 4284a79368f..d0cc3cee0a5 100644
--- a/eng/pipelines/coreclr/templates/perf-job.yml
+++ b/eng/pipelines/coreclr/templates/perf-job.yml
@@ -91,10 +91,12 @@ jobs:
displayName: Create Core_Root
condition: and(succeeded(), ne(variables.runtimeFlavorName, 'Mono'))
- - script: "build.cmd -subset libs.pretest -configuration release -ci -arch $(archType) -testscope innerloop /p:RuntimeArtifactsPath=$(librariesDownloadDir)\\bin\\mono\\$(osGroup).$(archType).$(buildConfigUpper) /p:RuntimeFlavor=mono;xcopy $(Build.SourcesDirectory)\\artifacts\\bin\\testhost\\$(_Framework)-$(osGroup)-$(buildConfigUpper)-$(archType)\\* $(Build.SourcesDirectory)\\.dotnet-mono /E /I /Y;copy $(Build.SourcesDirectory)\\artifacts\\bin\\coreclr\\$(osGroup).$(archType).$(buildConfigUpper)\\corerun.exe $(Build.SourcesDirectory)\\.dotnet-mono\\shared\\Microsoft.NETCore.App\\5.0.0\\corerun.exe"
+ # Copy the runtime directory into the testhost folder to include OOBs.
+
+ - script: "build.cmd -subset libs.pretest -configuration release -ci -arch $(archType) -testscope innerloop /p:RuntimeArtifactsPath=$(librariesDownloadDir)\\bin\\mono\\$(osGroup).$(archType).$(buildConfigUpper) /p:RuntimeFlavor=mono;xcopy $(Build.SourcesDirectory)\\artifacts\\bin\\runtime\\$(_Framework)-$(osGroup)-$(buildConfigUpper)-$(archType)\\* $(Build.SourcesDirectory)\\artifacts\\bin\\testhost\\$(_Framework)-$(osGroup)-$(buildConfigUpper)-$(archType)\\shared\\Microsoft.NETCore.App\\5.0.0 /E /I /Y;xcopy $(Build.SourcesDirectory)\\artifacts\\bin\\testhost\\$(_Framework)-$(osGroup)-$(buildConfigUpper)-$(archType)\\* $(Build.SourcesDirectory)\\.dotnet-mono /E /I /Y;copy $(Build.SourcesDirectory)\\artifacts\\bin\\coreclr\\$(osGroup).$(archType).$(buildConfigUpper)\\corerun.exe $(Build.SourcesDirectory)\\.dotnet-mono\\shared\\Microsoft.NETCore.App\\5.0.0\\corerun.exe"
displayName: "Create mono dotnet (Windows)"
condition: and(and(succeeded(), eq(variables.runtimeFlavorName, 'Mono')), eq(variables.osGroup, 'Windows_NT'))
- - script: "mkdir $(Build.SourcesDirectory)/.dotnet-mono;./build.sh -subset libs.pretest -configuration release -ci -arch $(archType) -testscope innerloop /p:RuntimeArtifactsPath=$(librariesDownloadDir)/bin/mono/$(osGroup).$(archType).$(buildConfigUpper) /p:RuntimeFlavor=mono;cp $(Build.SourcesDirectory)/artifacts/bin/testhost/$(_Framework)-$(osGroup)-$(buildConfigUpper)-$(archType)/* $(Build.SourcesDirectory)/.dotnet-mono -r;cp $(Build.SourcesDirectory)/artifacts/bin/coreclr/$(osGroup).$(archType).$(buildConfigUpper)/corerun $(Build.SourcesDirectory)/.dotnet-mono/shared/Microsoft.NETCore.App/5.0.0/corerun"
+ - script: "mkdir $(Build.SourcesDirectory)/.dotnet-mono;./build.sh -subset libs.pretest -configuration release -ci -arch $(archType) -testscope innerloop /p:RuntimeArtifactsPath=$(librariesDownloadDir)/bin/mono/$(osGroup).$(archType).$(buildConfigUpper) /p:RuntimeFlavor=mono;cp $(Build.SourcesDirectory)/artifacts/bin/runtime/$(_Framework)-$(osGroup)-$(buildConfigUpper)-$(archType)/* $(Build.SourcesDirectory)/artifacts/bin/testhost/$(_Framework)-$(osGroup)-$(buildConfigUpper)-$(archType)/shared/Microsoft.NETCore.App/5.0.0 -rf;cp $(Build.SourcesDirectory)/artifacts/bin/testhost/$(_Framework)-$(osGroup)-$(buildConfigUpper)-$(archType)/* $(Build.SourcesDirectory)/.dotnet-mono -r;cp $(Build.SourcesDirectory)/artifacts/bin/coreclr/$(osGroup).$(archType).$(buildConfigUpper)/corerun $(Build.SourcesDirectory)/.dotnet-mono/shared/Microsoft.NETCore.App/5.0.0/corerun"
displayName: "Create mono dotnet (Linux)"
condition: and(and(succeeded(), eq(variables.runtimeFlavorName, 'Mono')), ne(variables.osGroup, 'Windows_NT'))
diff --git a/eng/pipelines/libraries/base-job.yml b/eng/pipelines/libraries/base-job.yml
index bf5a9a2321f..2ae778e8939 100644
--- a/eng/pipelines/libraries/base-job.yml
+++ b/eng/pipelines/libraries/base-job.yml
@@ -4,7 +4,7 @@ parameters:
archType: ''
osSubgroup: ''
crossrootfsDir: ''
- framework: ''
+ framework: 'net5.0'
isOfficialAllConfigurations: false
isSourceBuild: false
liveRuntimeBuildConfig: ''
@@ -25,10 +25,10 @@ parameters:
jobs:
- template: /eng/common/templates/job/job.yml
parameters:
- ${{ if notIn(parameters.framework, 'allConfigurations', 'net472') }}:
+ ${{ if notIn(parameters.framework, 'allConfigurations', 'net48') }}:
displayName: ${{ format('Libraries {0} {1}{2} {3} {4}', parameters.displayName, parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }}
name: ${{ format('libraries_{0}_{1}{2}_{3}_{4}', parameters.name, parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }}
- ${{ if in(parameters.framework, 'allConfigurations', 'net472') }}:
+ ${{ if in(parameters.framework, 'allConfigurations', 'net48') }}:
displayName: ${{ format('Libraries {0} {1} {2} {3} {4}', parameters.displayName, parameters.osGroup, parameters.framework, parameters.archType, parameters.buildConfig) }}
name: ${{ format('libraries_{0}_{1}_{2}{3}_{4}_{5}', parameters.name, parameters.framework, parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }}
diff --git a/eng/pipelines/libraries/build-job.yml b/eng/pipelines/libraries/build-job.yml
index f4b02cf0621..4854b682716 100644
--- a/eng/pipelines/libraries/build-job.yml
+++ b/eng/pipelines/libraries/build-job.yml
@@ -4,7 +4,7 @@ parameters:
osSubgroup: ''
archType: ''
crossrootfsDir: ''
- framework: ''
+ framework: 'net5.0'
isOfficialBuild: false
isOfficialAllConfigurations: false
runtimeVariant: ''
@@ -65,7 +65,7 @@ jobs:
- ${{ if eq(parameters.osGroup, 'Browser') }}:
- EMSDK_PATH: /usr/local/emscripten
- # Tests only run for 'allConfiguration' and 'net472' build-jobs
+ # Tests only run for 'allConfiguration' and 'net48' build-jobs
# If platform is in testBuildPlatforms we build tests as well.
- ${{ if or(eq(parameters.runTests, true), containsValue(parameters.testBuildPlatforms, parameters.platform)) }}:
- _subset: libs+libs.tests
diff --git a/eng/pipelines/libraries/helix-queues-setup.yml b/eng/pipelines/libraries/helix-queues-setup.yml
index 58d1f89fe3c..33d0ea5aa9d 100644
--- a/eng/pipelines/libraries/helix-queues-setup.yml
+++ b/eng/pipelines/libraries/helix-queues-setup.yml
@@ -88,7 +88,7 @@ jobs:
# Windows_NT x64
- ${{ if eq(parameters.platform, 'Windows_NT_x64') }}:
# netcoreapp
- - ${{ if notIn(parameters.jobParameters.framework, 'allConfigurations', 'net472') }}:
+ - ${{ if notIn(parameters.jobParameters.framework, 'allConfigurations', 'net48') }}:
- ${{ if eq(parameters.jobParameters.isFullMatrix, true) }}:
- Windows.81.Amd64.Open
- Windows.10.Amd64.ServerRS5.Open
@@ -101,8 +101,8 @@ jobs:
- ${{ if ne(parameters.jobParameters.runtimeFlavor, 'mono') }}:
- (Windows.Nano.1809.Amd64.Open)windows.10.amd64.serverrs5.open@mcr.microsoft.com/dotnet-buildtools/prereqs:nanoserver-1809-helix-amd64-08e8e40-20200107182504
- # NET472
- - ${{ if eq(parameters.jobParameters.framework, 'net472') }}:
+ # .NETFramework
+ - ${{ if eq(parameters.jobParameters.framework, 'net48') }}:
- Windows.10.Amd64.Client19H1.Open
# AllConfigurations
@@ -112,7 +112,7 @@ jobs:
# Windows_NT x86
- ${{ if eq(parameters.platform, 'Windows_NT_x86') }}:
# netcoreapp
- - ${{ if notIn(parameters.jobParameters.framework, 'allConfigurations', 'net472') }}:
+ - ${{ if notIn(parameters.jobParameters.framework, 'allConfigurations', 'net48') }}:
- ${{ if eq(parameters.jobParameters.isFullMatrix, true) }}:
- Windows.7.Amd64.Open
- Windows.10.Amd64.ServerRS5.Open
@@ -124,8 +124,8 @@ jobs:
- Windows.7.Amd64.Open
- Windows.10.Amd64.Server19H1.Open
- # NET472
- - ${{ if eq(parameters.jobParameters.framework, 'net472') }}:
+ # .NETFramework
+ - ${{ if eq(parameters.jobParameters.framework, 'net48') }}:
- Windows.10.Amd64.Client19H1.Open
# Windows_NT arm
diff --git a/eng/pipelines/libraries/outerloop.yml b/eng/pipelines/libraries/outerloop.yml
index 9afbf206e5f..d88481ea37d 100644
--- a/eng/pipelines/libraries/outerloop.yml
+++ b/eng/pipelines/libraries/outerloop.yml
@@ -99,6 +99,6 @@ jobs:
jobParameters:
isOfficialBuild: ${{ variables['isOfficialBuild'] }}
isFullMatrix: ${{ variables['isFullMatrix'] }}
- framework: net472
+ framework: net48
runTests: true
testScope: outerloop \ No newline at end of file
diff --git a/eng/pipelines/libraries/run-test-job.yml b/eng/pipelines/libraries/run-test-job.yml
index 6c5e397d4dd..faa5ab29e30 100644
--- a/eng/pipelines/libraries/run-test-job.yml
+++ b/eng/pipelines/libraries/run-test-job.yml
@@ -3,7 +3,7 @@ parameters:
osGroup: ''
osSubgroup: ''
archType: ''
- framework: ''
+ framework: 'net5.0'
isOfficialBuild: false
liveRuntimeBuildConfig: ''
runtimeFlavor: 'coreclr'
@@ -55,7 +55,7 @@ jobs:
- ${{ if ne(parameters.dependsOn[0], '') }}:
- ${{ parameters.dependsOn }}
- ${{ if eq(parameters.dependsOn[0], '') }}:
- - ${{ if notIn(parameters.framework, 'allConfigurations', 'net472') }}:
+ - ${{ if notIn(parameters.framework, 'allConfigurations', 'net48') }}:
- ${{ format('libraries_build_{0}{1}_{2}_{3}', parameters.osGroup, parameters.osSubgroup, parameters.archType, parameters.buildConfig) }}
# tests are built as part of product build
- ${{ if or(ne(parameters.archType, parameters.dependsOnTestArchitecture), ne(parameters.buildConfig, parameters.dependsOnTestBuildConfiguration)) }}:
diff --git a/eng/pipelines/runtime.yml b/eng/pipelines/runtime.yml
index 831fa959900..17afa74cdb3 100644
--- a/eng/pipelines/runtime.yml
+++ b/eng/pipelines/runtime.yml
@@ -576,7 +576,7 @@ jobs:
helixQueuesTemplate: /eng/pipelines/libraries/helix-queues-setup.yml
jobParameters:
isFullMatrix: ${{ variables.isFullMatrix }}
- framework: net472
+ framework: net48
runTests: true
testScope: innerloop
condition: >-
diff --git a/eng/referenceAssemblies.props b/eng/referenceAssemblies.props
index a5e0e553f12..94508fa244a 100644
--- a/eng/referenceAssemblies.props
+++ b/eng/referenceAssemblies.props
@@ -1,9 +1,9 @@
<Project>
<PropertyGroup Condition="'$(BuildAllProjects)' == 'true' and
- !$(BuildTargetFramework.StartsWith('netstandard'))">
- <AdditionalBuildTargetFrameworks Condition="!$(BuildTargetFramework.StartsWith('net45'))">$(AdditionalBuildTargetFrameworks);netstandard2.0</AdditionalBuildTargetFrameworks>
- <AdditionalBuildTargetFrameworks Condition="!$(BuildTargetFramework.StartsWith('netcoreapp2.0')) and
- !$(BuildTargetFramework.StartsWith('net4'))">$(AdditionalBuildTargetFrameworks);netstandard2.1</AdditionalBuildTargetFrameworks>
+ !$(BuildTargetFramework.StartsWith('netstandard')) and
+ !$(BuildTargetFramework.StartsWith('net4'))">
+ <AdditionalBuildTargetFrameworks>$(AdditionalBuildTargetFrameworks);netstandard2.0</AdditionalBuildTargetFrameworks>
+ <AdditionalBuildTargetFrameworks Condition="!$(BuildTargetFramework.StartsWith('netcoreapp2.0'))">$(AdditionalBuildTargetFrameworks);netstandard2.1</AdditionalBuildTargetFrameworks>
</PropertyGroup>
<PropertyGroup>
diff --git a/eng/referenceFromRuntime.targets b/eng/referenceFromRuntime.targets
deleted file mode 100644
index 34d0eb49199..00000000000
--- a/eng/referenceFromRuntime.targets
+++ /dev/null
@@ -1,124 +0,0 @@
-<Project>
- <PropertyGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp' and '$(TargetFramework)' != '$(NetCoreAppCurrent)'">
- <PrepareProjectReferencesDependsOn>
- AddRuntimeProjectReference;
- $(PrepareProjectReferencesDependsOn);
- </PrepareProjectReferencesDependsOn>
- <ResolveReferencesDependsOn>
- AddRuntimeProjectReference;
- $(ResolveReferencesDependsOn);
- </ResolveReferencesDependsOn>
- <CleanDependsOn>
- AddRuntimeProjectReference;
- $(CleanDependsOn)
- </CleanDependsOn>
- </PropertyGroup>
-
- <PropertyGroup>
- <RuntimeProjectFile>$([MSBuild]::NormalizePath('$(LibrariesProjectRoot)', 'restore', 'runtime', 'runtime.depproj'))</RuntimeProjectFile>
- </PropertyGroup>
-
- <Target Name="AddRuntimeProjectReference"
- Condition="'$(IsTestProject)' != 'true' and '$(IsTestSupportProject)' != 'true' and '@(ReferenceFromRuntime)' != ''">
- <Error Text="ReferenceFromRuntime may not be used from reference assemblies."
- Condition="'$(IsReferenceAssembly)' == 'true' and '$(AllowReferenceFromRuntime)' != 'true'" />
-
- <ItemGroup>
- <ProjectReference Include="$(RuntimeProjectFile)">
- <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
- <OutputItemType>_referencePathFromRestoredRuntime</OutputItemType>
- </ProjectReference>
- </ItemGroup>
- </Target>
-
- <Target Name="GetFilesFromRuntime" Returns="@(RuntimeFiles)" DependsOnTargets="GetFilesFromCoreClr;GetFilesFromMono">
- <ItemGroup>
- <RuntimeFiles Include="@(RuntimeFiles)" />
- </ItemGroup>
- </Target>
-
- <!--
- The check must use != Mono because we don't consistently set this value to CoreCLR
- https://github.com/dotnet/runtime/issues/32884
- -->
- <Target Name="GetFilesFromCoreCLR"
- Condition="'$(RuntimeFlavor)' != 'Mono'"
- Returns="@(RuntimeFiles)"
- DependsOnTargets="ResolveRuntimeFilesFromLocalBuild" />
-
- <Target Name="GetFilesFromMono"
- Condition="'$(RuntimeFlavor)' == 'Mono'"
- Returns="@(RuntimeFiles)"
- DependsOnTargets="ResolveRuntimeFilesFromLocalBuild" />
-
- <Target Name="FilterReferenceFromRuntime"
- AfterTargets="ResolveProjectReferences"
- Condition="'@(ReferenceFromRuntime)' != ''">
-
- <Error Condition="'$(IsReferenceAssembly)' == 'true' and '$(AllowReferenceFromRuntime)' != 'true'" Text="ReferenceFromRuntime may not be used from reference assemblies." />
-
- <MSBuild Projects="$(MSBuildProjectFile)" Targets="GetFilesFromRuntime" Condition="'$(TargetFramework)' == '$(NetCoreAppCurrent)'">
- <Output TaskParameter="TargetOutputs" ItemName="RuntimeFiles" />
- </MSBuild>
-
- <ItemGroup>
- <_referencePathFromRuntime Include="@(RuntimeFiles)" Private="false" />
- <_referencePathFromRuntime Include="@(_referencePathFromRestoredRuntime)" Private="false" />
- <!-- If this is a test project, also use the $(RuntimePath) to find a @(ReferenceFromRuntime) assembly. -->
- <_referencePathFromRuntime Include="@(ReferenceFromRuntime->'$(RuntimePath)%(Identity).dll')" Condition="'$(IsTestProject)' == 'true' or '$(IsTestSupportProject)' == 'true'" />
- <!-- transform to filename in order to intersect -->
- <_referencePathFromRuntimeByFileName Include="@(_referencePathFromRuntime->'%(FileName)')" Condition="'%(_referencePathFromRuntime.Extension)' == '.dll'" >
- <ReferencePath>%(Identity)</ReferencePath>
- </_referencePathFromRuntimeByFileName>
- </ItemGroup>
-
- <RemoveDuplicates Inputs="@(_referencePathFromRuntimeByFileName)">
- <Output TaskParameter="Filtered" ItemName="_referencePathFromRuntimeByFileNameFiltered" />
- </RemoveDuplicates>
-
- <ItemGroup>
-
- <!-- intersect with ReferenceFromRuntime -->
- <_filteredReferencePathFromRuntimeByFileName Include="@(_referencePathFromRuntimeByFileNameFiltered)"
- Condition="'@(_referencePathFromRuntimeByFileNameFiltered)' == '@(ReferenceFromRuntime)' and '%(Identity)' != ''">
- <Aliases>@(ReferenceFromRuntime->'%(Aliases)')</Aliases>
- </_filteredReferencePathFromRuntimeByFileName>
-
- <_remainingReferenceFromRuntime Include="@(ReferenceFromRuntime)" Exclude="@(_filteredReferencePathFromRuntimeByFileName)" />
-
- <!-- Fallback and check for native images for the references as well -->
- <_remainingReferenceFromRuntimeWithNI Include="@(_remainingReferenceFromRuntime->'%(Identity).ni')">
- <OriginalReferenceFromRuntime>%(Identity)</OriginalReferenceFromRuntime>
- </_remainingReferenceFromRuntimeWithNI>
-
- <_filteredReferencePathFromRuntimeByFileName Include="@(_referencePathFromRuntimeByFileNameFiltered)"
- Condition="'@(_referencePathFromRuntimeByFileNameFiltered)' == '@(_remainingReferenceFromRuntimeWithNI)' and '%(Identity)' != ''">
- <Aliases>@(_remainingReferenceFromRuntimeWithNI->'%(Aliases)')</Aliases>
- </_filteredReferencePathFromRuntimeByFileName>
-
- <_missingReferenceFromRuntime Include="@(_remainingReferenceFromRuntimeWithNI)" Exclude="@(_filteredReferencePathFromRuntimeByFileName)" />
-
- <!-- transform back to path -->
- <!-- We are adding two items(with and without aliases) for references having Aliases. The major reason behind this to not use the Aliases for all the types in that reference. -->
- <!-- We can't use a Reference item for both since only the first one will be kept. -->
- <!-- Aliases provides no way to encode both an alias and a non-aliased reference : https://github.com/dotnet/roslyn/issues/42604 -->
- <!-- Use ReferencePath for the second reference so it will still be passed to the compiler. -->
- <Reference Include="@(_filteredReferencePathFromRuntimeByFileName->'%(ReferencePath)')" />
- <_aliasedReferencePathFromRuntime Include="@(_filteredReferencePathFromRuntimeByFileName->'%(ReferencePath)')" Condition="'%(_filteredReferencePathFromRuntimeByFileName.Aliases)' != ''" />
- <ReferencePath Include="@(_aliasedReferencePathFromRuntime)" Aliases=""/>
- </ItemGroup>
-
- <Error Condition="'@(_missingReferenceFromRuntime)' != ''"
- Text="Could not resolve ReferenceFromRuntime item(s) '%(_missingReferenceFromRuntime.OriginalReferenceFromRuntime)' from '$(RuntimeProjectFile)'." />
- </Target>
-
- <Target Name="RemoveAliasedReferenceFromRuntime"
- AfterTargets="CoreCompile"
- Condition="'@(_aliasedReferencePathFromRuntime)' != ''">
- <!-- SDK's GenerateBuildDependencyFile will break when they encounter two identical reference paths, fix by removing the aliased ones -->
- <ItemGroup>
- <ReferencePath Remove="@(_aliasedReferencePathFromRuntime)"/>
- </ItemGroup>
- </Target>
-
-</Project>
diff --git a/eng/references.targets b/eng/references.targets
index efcac7d0515..0f3ea17b4a4 100644
--- a/eng/references.targets
+++ b/eng/references.targets
@@ -1,67 +1,56 @@
<Project>
<PropertyGroup>
- <ContractDependencyPaths>$(RefPath)</ContractDependencyPaths>
- <FrameworkPathOverride>$(RefPath)</FrameworkPathOverride>
- <AssemblySearchPaths>$(AssemblySearchPaths);$(RefPath);{RawFileName}</AssemblySearchPaths>
<!-- Disable RAR from transitively discovering dependencies for References -->
<_FindDependencies>false</_FindDependencies>
- <!--
- We don't use any of MSBuild's resolution logic for resolving the framework, so just set these two properties to any folder
- that exists to skip the GenerateReferenceAssemblyPaths task (not target) and to prevent it from outputting a warning (MSB3644).
- Need to set these after the common targets import.
- -->
- <_TargetFrameworkDirectories>$(MSBuildThisFileDirectory)</_TargetFrameworkDirectories>
- <_FullFrameworkReferenceAssemblyPaths>$(MSBuildThisFileDirectory)</_FullFrameworkReferenceAssemblyPaths>
- </PropertyGroup>
- <PropertyGroup Condition="'$(IncludeDefaultReferences)' == ''">
- <IncludeDefaultReferences Condition="'$(MSBuildProjectExtension)' == '.csproj'">true</IncludeDefaultReferences>
- <IncludeDefaultReferences Condition="'$(MSBuildProjectExtension)' == '.vbproj'">true</IncludeDefaultReferences>
</PropertyGroup>
- <Target Name="SetupDefaultReferences">
- <ItemGroup Condition="'$(IncludeDefaultReferences)' == 'true'">
- <!-- netstandard is a default reference whenever building for NETStandard or building an implementation assembly -->
- <DefaultReference Condition="('$(TargetFrameworkIdentifier)' == '.NETStandard' or '$(IsReferenceAssembly)' != 'true') and Exists('$(RefPath)netstandard.dll')" Include="netstandard" />
- </ItemGroup>
- </Target>
- <Target Name="UpdateReferenceItems" DependsOnTargets="SetupDefaultReferences" BeforeTargets="AddReferencesDynamically">
- <ItemGroup>
- <Reference Include="@(DefaultReference)" />
- </ItemGroup>
- <ItemGroup>
- <!-- Simple name references will be resolved from the targeting pack folders and should never be copied to output -->
- <Reference Condition="'%(Reference.Extension)' != '.dll'">
- <Private>false</Private>
- </Reference>
- </ItemGroup>
- </Target>
+ <!-- netstandard is a default reference whenever building an implementation assembly for .NETCoreApp. -->
+ <ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp' and
+ '$(IsSourceProject)' == 'true'">
+ <Reference Include="netstandard"
+ Private="false" />
+ </ItemGroup>
- <Target Name="AddDefaultTestReferences" BeforeTargets="SetupDefaultReferences" Condition="'$(IsTestProject)' == 'true' or '$(IsTestSupportProject)' == 'true'">
- <ItemGroup>
- <DefaultReferenceExclusions Include="@(ReferenceFromRuntime)"/>
+ <!-- If a CoreLib ProjectReference is present, make all P2P assets non transitive. -->
+ <ItemGroup Condition="'@(ProjectReference)' != '' and
+ @(ProjectReference->AnyHaveMetadataValue('Identity', '$(CoreLibProject)'))">
+ <ProjectReference Update="@(ProjectReference)"
+ PrivateAssets="all" />
+ </ItemGroup>
- <!-- Reference everything in the targeting pack directory -->
- <DefaultReferenceDirs Include="$(RefPath)" />
- <DefaultReferenceItems Include="%(DefaultReferenceDirs.Identity)/*.dll" />
+ <!-- Project references shouldn't be copied to the output for non test apps. -->
+ <ItemDefinitionGroup Condition="'$(IsTestProject)' != 'true' and '$(IsTestSupportProject)' != 'true'">
+ <ProjectReference>
+ <Private>false</Private>
+ </ProjectReference>
+ </ItemDefinitionGroup>
- <DefaultReferenceExclusions>
- <RefDir>%(DefaultReferenceDirs.Identity)</RefDir>
- </DefaultReferenceExclusions>
- <_defaultReferenceExclusionsFullPath Include="%(DefaultReferenceExclusions.RefDir)%(DefaultReferenceExclusions.Identity).dll" />
-
- <!-- Ensure conflict resolution can see these references. -->
- <Reference Include="%(DefaultReferenceItems.FullPath)" Private="false" />
+ <!-- Filter out transitive P2Ps which should be excluded. -->
+ <Target Name="FilterTransitiveProjectReferences"
+ AfterTargets="IncludeTransitiveProjectReferences"
+ Condition="'$(DisableTransitiveProjectReferences)' != 'true' and
+ '@(DefaultReferenceExclusion)' != ''">
+ <ItemGroup>
+ <_transitiveProjectReferenceWithExclusion Include="@(ProjectReference)">
+ <Exclusion>%(DefaultReferenceExclusion.Identity)</Exclusion>
+ </_transitiveProjectReferenceWithExclusion>
+ <ProjectReference Remove="@(_transitiveProjectReferenceWithExclusion)"
+ Condition="'%(_transitiveProjectReferenceWithExclusion.NuGetPackageId)' == '%(_transitiveProjectReferenceWithExclusion.Exclusion)'" />
</ItemGroup>
</Target>
- <Target Name="RemoveConflictResolutionAssetsForTests"
- AfterTargets="_HandlePackageFileConflicts"
- DependsOnTargets="AddDefaultTestReferences"
- Condition="'@(_defaultReferenceExclusionsFullPath)' != ''">
+ <!-- Make shared framework assemblies not app-local (non private). -->
+ <Target Name="UpdateProjectReferencesWithPrivateAttribute"
+ AfterTargets="AssignProjectConfiguration"
+ BeforeTargets="PrepareProjectReferences"
+ Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp' and
+ ('$(IsTestProject)' == 'true' or '$(IsTestSupportProject)' == 'true') and
+ '@(ProjectReferenceWithConfiguration)' != ''">
<ItemGroup>
- <Reference Remove="@(_defaultReferenceExclusionsFullPath)" />
+ <ProjectReferenceWithConfiguration PrivateAssets="all"
+ Private="false"
+ Condition="$(NetCoreAppLibrary.Contains('$([System.IO.Path]::GetFileNameWithoutExtension('%(MSBuildSourceProjectFile)'));'))" />
</ItemGroup>
</Target>
- <Target Name="AddReferencesDynamically" BeforeTargets="PrepareForBuild" />
-</Project> \ No newline at end of file
+</Project>
diff --git a/eng/resolveContract.targets b/eng/resolveContract.targets
index 2f59f5d9a51..6f4bb0e253e 100644
--- a/eng/resolveContract.targets
+++ b/eng/resolveContract.targets
@@ -1,8 +1,18 @@
<Project>
+ <PropertyGroup>
+ <ContractDependencyPaths Condition="'$(DisableImplicitFrameworkReferences)' == 'true' and
+ '$(TargetFrameworkIdentifier)' == '.NETCoreApp'">$(MicrosoftNetCoreAppRefPackRefDir)</ContractDependencyPaths>
+ <!-- Use implementation referencepath if no contract tfm is set. -->
+ <ContractDependencyPaths Condition="'$(ContractDependencyPaths)' == ''">$(ContractDependencyPaths);@(ReferencePath->'%(RelativeDir)'->Distinct())</ContractDependencyPaths>
+ </PropertyGroup>
+
<PropertyGroup Condition="'$(IsSourceProject)' == 'true'">
- <ContractProject Condition="'$(ContractProject)' == ''">$(LibrariesProjectRoot)$(MSBuildProjectName)/ref/$(MSBuildProjectName).csproj</ContractProject>
+ <ContractProject Condition="'$(ContractProject)' == ''">$(LibrariesProjectRoot)$(MSBuildProjectName)\ref\$(MSBuildProjectName).csproj</ContractProject>
<HasMatchingContract Condition="'$(HasMatchingContract)' == '' and Exists('$(ContractProject)')">true</HasMatchingContract>
- <ContractAssemblyPath Condition="'$(ContractAssemblyPath)' == ''">$(RefPath)/$(MSBuildProjectName).dll</ContractAssemblyPath>
+ <ContractAssemblyPath Condition="'$(ContractAssemblyPath)' == '' and
+ '$(TargetFrameworkIdentifier)' == '.NETCoreApp' and
+ $([MSBuild]::VersionGreaterThanOrEquals($(TargetFrameworkVersion), '$(NETCoreAppCurrentVersion)'))">$(NetCoreAppCurrentRefPath)$(TargetFileName)</ContractAssemblyPath>
+ <ContractAssemblyPath Condition="'$(ContractAssemblyPath)' == ''">$([MSBuild]::NormalizePath('$(BaseOutputPath)', 'ref', '$(TargetFramework)-$(Configuration)', '$(TargetFileName)'))</ContractAssemblyPath>
<!-- Disable API compat if the project doesn't have reference assembly -->
<RunApiCompat Condition="'$(HasMatchingContract)' != 'true'">false</RunApiCompat>
@@ -10,8 +20,43 @@
<ItemGroup Condition="'$(HasMatchingContract)' == 'true'">
<ResolvedMatchingContract Condition="Exists('$(ContractAssemblyPath)')" Include="$(ContractAssemblyPath)" />
+ <!-- If the contract doesn't exist in the default contract output path add a project reference to the contract project to resolve -->
+ <ProjectReference Condition="'@(ResolvedMatchingContract)' == ''" Include="$(ContractProject)">
+ <ReferenceOutputAssembly>false</ReferenceOutputAssembly>
+ <OutputItemType>ResolvedMatchingContract</OutputItemType>
+ </ProjectReference>
</ItemGroup>
<!-- intentionally empty since we no longer need a target -->
<Target Name="ResolveMatchingContract" />
+
+ <!-- Allow P2Ps that target a source project to build against the corresponding ref project. -->
+ <Target Name="AnnotateTargetPathWithTargetPlatformMonikerWithReferenceAssembly"
+ Condition="'$(HasMatchingContract)' == 'true'"
+ AfterTargets="GetTargetPathWithTargetPlatformMoniker">
+ <ItemGroup>
+ <TargetPathWithTargetPlatformMoniker ReferenceAssembly="@(ResolvedMatchingContract)" />
+ </ItemGroup>
+ </Target>
+
+ <Target Name="HandleReferenceAssemblyAttributeForProjectReferences"
+ AfterTargets="ResolveProjectReferences"
+ BeforeTargets="FindReferenceAssembliesForReferences"
+ Condition="'@(ProjectReference)' != '' and '@(_ResolvedProjectReferencePaths)' != ''">
+ <!-- If we have a ProjectReference to CoreLib, we need to compile against implementation assemblies. -->
+ <PropertyGroup Condition="@(_ResolvedProjectReferencePaths->AnyHaveMetadataValue('MSBuildSourceProjectFile', '$(CoreLibProject)'))">
+ <CompileUsingReferenceAssemblies>false</CompileUsingReferenceAssemblies>
+ </PropertyGroup>
+ <!-- Clear the ReferenceAssembly attribute on resolved P2Ps that set SkipUseReferenceAssembly to true. -->
+ <ItemGroup>
+ <_resolvedP2PFiltered Include="@(ProjectReference)">
+ <ProjectReferenceItemSpec>$([System.IO.Path]::GetFullPath('%(ProjectReference.Identity)'))</ProjectReferenceItemSpec>
+ <SkipUseReferenceAssembly>%(ProjectReference.SkipUseReferenceAssembly)</SkipUseReferenceAssembly>
+ </_resolvedP2PFiltered>
+ <_ResolvedProjectReferencePaths Update="@(_resolvedProjectReferenceFiltred)"
+ Condition="'%(_resolvedP2PFiltered.ProjectReferenceItemSpec)' == '%(_resolvedP2PFiltered.MSBuildSourceProjectFile)' and
+ '%(_resolvedP2PFiltered.SkipUseReferenceAssembly)' == 'true'"
+ ReferenceAssembly="" />
+ </ItemGroup>
+ </Target>
</Project> \ No newline at end of file
diff --git a/eng/restore/repoRestore.props b/eng/restore/repoRestore.props
index 300c542e8cb..d2ca92d6db0 100644
--- a/eng/restore/repoRestore.props
+++ b/eng/restore/repoRestore.props
@@ -1,5 +1,6 @@
<Project TreatAsLocalProperty="ExcludeRestorePackageImports">
<PropertyGroup>
+ <ToolSetCommonDirectory>$(RepoRoot)artifacts\toolset\Common\</ToolSetCommonDirectory>
<RestoreUseStaticGraphEvaluation>false</RestoreUseStaticGraphEvaluation>
<!-- Need to set ProjectAssetsFile to something so it doesn't get set to the Tools.proj assets file when we import the generated props -->
<ProjectAssetsFile Condition="'$(ProjectAssetsFile)' == ''">unused</ProjectAssetsFile>
diff --git a/eng/targetingpacks.targets b/eng/targetingpacks.targets
new file mode 100644
index 00000000000..e39ce8fdada
--- /dev/null
+++ b/eng/targetingpacks.targets
@@ -0,0 +1,106 @@
+<Project>
+ <PropertyGroup Condition="'$(DisableImplicitFrameworkReferences)' != 'true' and
+ '$(TargetFrameworkIdentifier)' == '.NETCoreApp' and
+ $([MSBuild]::VersionGreaterThanOrEquals($(TargetFrameworkVersion), '$(NETCoreAppCurrentVersion)'))">
+ <_UseLocalTargetingRuntimePack>true</_UseLocalTargetingRuntimePack>
+ <EnableTargetingPackDownload>false</EnableTargetingPackDownload>
+ </PropertyGroup>
+
+ <!-- .NETCoreApp 2.x DisableImplicitAssemblyReferences support. -->
+ <Choose>
+ <When Condition="'$(DisableImplicitAssemblyReferences)' == 'true' and
+ '$(TargetFrameworkIdentifier)' == '.NETCoreApp' and
+ $([MSBuild]::VersionLessThan($(TargetFrameworkVersion), '3.0'))">
+ <PropertyGroup>
+ <MicrosoftNetCoreAppRefPackRefDir>$(PkgMicrosoft_NETCore_App)\ref\$(_ShortFrameworkIdentifier)$(_ShortFrameworkVersion)\</MicrosoftNetCoreAppRefPackRefDir>
+ </PropertyGroup>
+ <ItemGroup>
+ <PackageReference Update="Microsoft.NETCore.App"
+ ExcludeAssets="all"
+ GeneratePathProperty="true" />
+ </ItemGroup>
+ </When>
+ </Choose>
+
+ <!-- Simple name references will be resolved from the targeting pack folders and should never be copied to the output. -->
+ <ItemGroup>
+ <Reference Update="@(Reference)">
+ <Private Condition="'%(Reference.Extension)' != '.dll'">false</Private>
+ </Reference>
+ </ItemGroup>
+
+ <!-- .NETCoreApp > 2.x DisableImplicitAssemblyReferences support. -->
+ <Target Name="RemoveFrameworkReferences"
+ BeforeTargets="_HandlePackageFileConflicts"
+ AfterTargets="ResolveTargetingPackAssets"
+ Condition="'$(DisableImplicitAssemblyReferences)' == 'true' and
+ '$(TargetFrameworkIdentifier)' == '.NETCoreApp' and
+ $([MSBuild]::VersionGreaterThanOrEquals($(TargetFrameworkVersion), '3.0'))">
+ <PropertyGroup>
+ <MicrosoftNetCoreAppRefPackRefDir>%(ResolvedFrameworkReference.TargetingPackPath)\ref\$(_ShortFrameworkIdentifier)$(_ShortFrameworkVersion)\</MicrosoftNetCoreAppRefPackRefDir>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Remove="@(Reference)"
+ Condition="'%(Reference.FrameworkReferenceName)' == '$(SharedFrameworkName)'" />
+ </ItemGroup>
+ </Target>
+
+ <!-- Add the resolved targeting pack to the assembly search path. -->
+ <Target Name="UseTargetingPackForAssemblySearchPaths"
+ BeforeTargets="ResolveAssemblyReferences;
+ DesignTimeResolveAssemblyReferences"
+ Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'">
+ <PropertyGroup>
+ <AssemblySearchPaths>$(AssemblySearchPaths);$(MicrosoftNetCoreAppRefPackRefDir.TrimEnd('/\'))</AssemblySearchPaths>
+ <DesignTimeAssemblySearchPaths>$(DesignTimeAssemblySearchPaths);$(MicrosoftNetCoreAppRefPackRefDir.TrimEnd('/\'))</DesignTimeAssemblySearchPaths>
+ </PropertyGroup>
+ </Target>
+
+ <!-- Use local targeting pack for NetCoreAppCurrent. -->
+ <Target Name="UpdateTargetingAndRuntimePack"
+ Condition="'$(_UseLocalTargetingRuntimePack)' == 'true'"
+ AfterTargets="ResolveFrameworkReferences">
+ <ItemGroup>
+ <ResolvedTargetingPack Path="$(MicrosoftNetCoreAppRefPackDir.TrimEnd('/\'))"
+ NuGetPackageVersion="$(ProductVersion)"
+ PackageDirectory="$(MicrosoftNetCoreAppRefPackDir.TrimEnd('/\'))"
+ Condition="'%(ResolvedTargetingPack.RuntimeFrameworkName)' == '$(SharedFrameworkName)' and
+ Exists('$(MicrosoftNetCoreAppRefPackDataDir)FrameworkList.xml')" />
+ <ResolvedRuntimePack PackageDirectory="$(MicrosoftNetCoreAppRuntimePackDir)"
+ Condition="'%(ResolvedRuntimePack.FrameworkName)' == '$(SharedFrameworkName)'" />
+ <ResolvedFrameworkReference TargetingPackPath="$(MicrosoftNetCoreAppRefPackDir.TrimEnd('/\'))"
+ TargetingPackVersion="$(ProductVersion)"
+ Condition="'%(Identity)' == '$(SharedFrameworkName)'" />
+ </ItemGroup>
+ </Target>
+
+ <!-- Update the local targeting pack's version as it's written into the runtimeconfig.json file to select the shared framework. -->
+ <Target Name="UpdateRuntimeFrameworkVersion"
+ Condition="'$(_UseLocalTargetingRuntimePack)' == 'true'"
+ AfterTargets="ResolveTargetingPackAssets">
+ <ItemGroup>
+ <RuntimeFramework Version="$(ProductVersion)"
+ Condition="'%(RuntimeFramework.FrameworkName)' == '$(SharedFrameworkName)'" />
+ </ItemGroup>
+ </Target>
+
+ <!-- Filter out conflicting implicit assembly references. -->
+ <Target Name="FilterImplicitAssemblyReferences"
+ Condition="'$(DisableImplicitAssemblyReferences)' != 'true'"
+ DependsOnTargets="ResolveProjectReferences"
+ AfterTargets="ResolveTargetingPackAssets">
+ <ItemGroup>
+ <_targetingPackReferenceExclusion Include="$(TargetName)" />
+ <_targetingPackReferenceExclusion Include="@(_ResolvedProjectReferencePaths->'%(Filename)')" />
+ <_targetingPackReferenceExclusion Include="@(DefaultReferenceExclusion)" />
+ </ItemGroup>
+
+ <ItemGroup>
+ <_targetingPackReferenceWithExclusion Include="@(Reference)">
+ <Exclusion>%(_targetingPackReferenceExclusion.Identity)</Exclusion>
+ </_targetingPackReferenceWithExclusion>
+ <Reference Remove="@(_targetingPackReferenceWithExclusion)"
+ Condition="'%(_targetingPackReferenceWithExclusion.ExternallyResolved)' == 'true' and '%(_targetingPackReferenceWithExclusion.Filename)' == '%(_targetingPackReferenceWithExclusion.Exclusion)'" />
+ </ItemGroup>
+ </Target>
+</Project> \ No newline at end of file
diff --git a/eng/testing/.runsettings b/eng/testing/.runsettings
index fabc0310a7a..cf00c4a4673 100644
--- a/eng/testing/.runsettings
+++ b/eng/testing/.runsettings
@@ -18,10 +18,6 @@
<!-- Filter out failing (wrong framwork, platform, runtime or activeissue) tests -->
<TestCaseFilter>$$TESTCASEFILTER$$</TestCaseFilter>
<DotNetHostPath>$$DOTNETHOSTPATH$$</DotNetHostPath>
- <EnvironmentVariables>
- <!-- Use our self-built framework on .NET Framework -->
- <DEVPATH>$$DEVPATH$$</DEVPATH>
- </EnvironmentVariables>
</RunConfiguration>
<LoggerRunSettings>
<Loggers>
diff --git a/eng/testing/RunnerTemplate.cmd b/eng/testing/RunnerTemplate.cmd
index fe28e9157a6..10737eabe70 100644
--- a/eng/testing/RunnerTemplate.cmd
+++ b/eng/testing/RunnerTemplate.cmd
@@ -41,12 +41,6 @@ set EXECUTION_DIR=%~dp0
:argparser_end
-if not defined RUNTIME_PATH (
- echo error: -r^|--runtime-path argument is required.
- call :usage
- exit /b -1
-)
-
:: Don't use a globally installed SDK.
set DOTNET_MULTILEVEL_LOOKUP=0
diff --git a/eng/testing/netfx.exe.config b/eng/testing/netfx.exe.config
index ed7d7d08243..e131497fc76 100644
--- a/eng/testing/netfx.exe.config
+++ b/eng/testing/netfx.exe.config
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
- <developmentMode developerInstallation="true" />
<UseRandomizedStringHashAlgorithm enabled="1" />
</runtime>
</configuration> \ No newline at end of file
diff --git a/eng/testing/outerBuild.targets b/eng/testing/outerBuild.targets
index 4623b0e54d2..c071944c21d 100644
--- a/eng/testing/outerBuild.targets
+++ b/eng/testing/outerBuild.targets
@@ -1,8 +1,12 @@
<Project>
<Target Name="Test" DependsOnTargets="GetProjectWithBestTargetFrameworks">
<MSBuild Projects="@(InnerBuildProjectsWithBestTargetFramework)"
- Targets="Test"
- BuildInParallel="$(BuildInParallel)">
+ Targets="Test">
+ </MSBuild>
+ </Target>
+ <Target Name="VSTest" DependsOnTargets="GetProjectWithBestTargetFrameworks">
+ <MSBuild Projects="@(InnerBuildProjectsWithBestTargetFramework)"
+ Targets="VSTest">
</MSBuild>
</Target>
</Project> \ No newline at end of file
diff --git a/eng/testing/runsettings.targets b/eng/testing/runsettings.targets
index 10496127b8a..5a2c9a84d68 100644
--- a/eng/testing/runsettings.targets
+++ b/eng/testing/runsettings.targets
@@ -36,7 +36,6 @@
.Replace('$$DISABLEPARALLELIZATION$$', '$([MSBuild]::ValueOrDefault('$(TestDisableParallelization)', 'false'))')
.Replace('$$DISABLEAPPDOMAIN$$', '$([MSBuild]::ValueOrDefault('$(TestDisableAppDomain)', 'false'))')
.Replace('$$TESTCASEFILTER$$', '$(_testFilter)')
- .Replace('$$DEVPATH$$', '$(TestHostRootPath)')
.Replace('$$DOTNETHOSTPATH$$', '$(TestHostRootPath)$([System.IO.Path]::GetFileName('$(DotNetTool)'))'))</RunSettingsFileContent>
</PropertyGroup>
diff --git a/eng/testing/runtimeConfiguration.targets b/eng/testing/runtimeConfiguration.targets
index f687adfad40..d69182992c7 100644
--- a/eng/testing/runtimeConfiguration.targets
+++ b/eng/testing/runtimeConfiguration.targets
@@ -1,45 +1,31 @@
<Project>
<PropertyGroup>
- <!-- Copies the app.config file to the OutDir. -->
- <TestRuntimeConfigurationFile Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">$(MSBuildThisFileDirectory)netfx.exe.config</TestRuntimeConfigurationFile>
-
<!-- By default copy the test runtime config file for executable test projects (+ test support projects). -->
- <GenerateRuntimeConfigurationFiles Condition="'$(IsTestProject)' == 'true' or '$(OutputType.ToLower())' == 'exe'">true</GenerateRuntimeConfigurationFiles>
+ <IsTestProjectOrExecutable Condition="'$(IsTestProject)' == 'true' or
+ '$(OutputType.ToLower())' == 'exe'">true</IsTestProjectOrExecutable>
+ <GenerateRuntimeConfigurationFiles Condition="'$(GenerateRuntimeConfigurationFiles)' == '' and
+ '$(TargetFrameworkIdentifier)' == '.NETCoreApp' and
+ '$(IsTestProjectOrExecutable)' == 'true'">true</GenerateRuntimeConfigurationFiles>
+ <GenerateAppConfigurationFile Condition="'$(IsTestProjectOrExecutable)' == 'true' and
+ '$(TargetFrameworkIdentifier)' == '.NETFramework'">true</GenerateAppConfigurationFile>
+ <AppConfig Condition="'$(GenerateAppConfigurationFile)' == 'true'">$(MSBuildThisFileDirectory)netfx.exe.config</AppConfig>
+ <!-- TODO: Change in RemoteExecutor -->
+ <RemoteClientAppConfigFile Condition="'$(GenerateAppConfigurationFile)' == 'true'">$(TargetPath).config</RemoteClientAppConfigFile>
</PropertyGroup>
- <ItemGroup Condition="'$(GenerateRuntimeConfigurationFiles)' == 'true'">
- <None Include="$(TestRuntimeConfigurationFile)"
- Condition="Exists('$(TestRuntimeConfigurationFile)')"
- Link="$(TargetName).exe.config"
- CopyToOutputDirectory="PreserveNewest"
- Visible="false" />
+ <ItemGroup Condition="'$(IsTestProjectOrExecutable)' == 'true'">
<!--
Include deps.json and runtimeconfig.json in ContentWithTargetPath so they will
be copied to the output folder of projects that reference this one.
Tracking issue: https://github.com/dotnet/sdk/issues/1675
-->
<ContentWithTargetPath Include="$(ProjectDepsFilePath)"
- Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp' and '$(GenerateDependencyFile)' == 'true'"
+ Condition="'$(GenerateDependencyFile)' == 'true'"
CopyToOutputDirectory="PreserveNewest"
TargetPath="$(ProjectDepsFileName)" />
<ContentWithTargetPath Include="$(ProjectRuntimeConfigFilePath)"
- Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'"
+ Condition="'$(GenerateRuntimeConfigurationFiles)' == 'true'"
CopyToOutputDirectory="PreserveNewest"
TargetPath="$(ProjectRuntimeConfigFileName)" />
</ItemGroup>
-
- <!--
- We disabled implicit framework references but still want to be treated as framework dependent:
- 1. To have runtimeTargets in the deps file.
- 2. To populate the framework node in the runtimeconfig's runtimeOptions
- To do this we manually set the RuntimeFramework.
- At that point restore and conflict resolution already happened therefore setting the item here has no side effects.
- -->
- <Target Name="_SetRuntimeFrameworksForTestAssemblies"
- Condition="'$(SelfContained)' != 'true' and '$(MSBuildProjectExtension)' != '.depproj'"
- BeforeTargets="GenerateBuildDependencyFile">
- <ItemGroup>
- <RuntimeFramework Include="Microsoft.NETCore.App" Version="$(ProductVersion)" />
- </ItemGroup>
- </Target>
</Project> \ No newline at end of file
diff --git a/eng/testing/tests.mobile.targets b/eng/testing/tests.mobile.targets
index 5622b19e249..dc7dd97397e 100644
--- a/eng/testing/tests.mobile.targets
+++ b/eng/testing/tests.mobile.targets
@@ -183,21 +183,8 @@
</ItemGroup>
</Target>
- <Target Name="AddFrameworkReference">
- <ItemGroup>
- <FrameworkReference Include="$(SharedFrameworkName)" />
- </ItemGroup>
- </Target>
-
- <Target Name="UpdateRuntimePack"
- DependsOnTargets="AddFrameworkReference;ResolveFrameworkReferences">
- <ItemGroup>
- <ResolvedRuntimePack Update="@(ResolvedRuntimePack)" PackageDirectory="$(MicrosoftNetCoreAppRuntimePackDir)" />
- </ItemGroup>
- </Target>
-
<Target Name="PublishTestAsSelfContained"
Condition="'$(IsCrossTargetingBuild)' != 'true'"
AfterTargets="Build"
- DependsOnTargets="UpdateRuntimePack;Publish;BundleTestAppleApp;BundleTestAndroidApp;BundleTestWasmApp;ArchiveTests" />
+ DependsOnTargets="Publish;BundleTestAppleApp;BundleTestAndroidApp;BundleTestWasmApp;ArchiveTests" />
</Project>
diff --git a/eng/testing/tests.props b/eng/testing/tests.props
index bf2f93fcceb..65664f7f749 100644
--- a/eng/testing/tests.props
+++ b/eng/testing/tests.props
@@ -29,8 +29,6 @@
<RuntimeIdentifier>$(PackageRID)</RuntimeIdentifier>
<SelfContained>true</SelfContained>
- <EnableTargetingPackDownload>false</EnableTargetingPackDownload>
- <PlatformManifestFile />
</PropertyGroup>
<!-- Provide runtime options to Mono (interpreter, aot, debugging, etc) -->
diff --git a/eng/testing/tests.targets b/eng/testing/tests.targets
index 757ff016360..2fe669a10ba 100644
--- a/eng/testing/tests.targets
+++ b/eng/testing/tests.targets
@@ -19,11 +19,6 @@
<RunScriptHost Condition="'$(TargetOS)' != 'Windows_NT'">$(RunScriptHostDir)dotnet</RunScriptHost>
</PropertyGroup>
- <!-- Set env variable to use the local netfx assemblies instead of the ones in the GAC. -->
- <ItemGroup Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework'">
- <RunScriptCommands Include="set DEVPATH=%RUNTIME_PATH%" />
- </ItemGroup>
-
<PropertyGroup>
<ArchiveTestsAfterTargets>PrepareForRun</ArchiveTestsAfterTargets>
@@ -96,7 +91,10 @@
<Target Name="RunTests">
<PropertyGroup>
- <RunTestsCommand>"$(RunScriptOutputPath)" --runtime-path "$(TestHostRootPath.TrimEnd('\/'))"</RunTestsCommand>
+ <RunTestsCommand>"$(RunScriptOutputPath)"</RunTestsCommand>
+ <!-- Use runtime path only for the live built shared framework (NetCoreAppCurrent). -->
+ <RunTestsCommand Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp' and
+ $([MSBuild]::VersionGreaterThanOrEquals($(TargetFrameworkVersion), '$(NETCoreAppCurrentVersion)'))">$(RunTestsCommand) --runtime-path "$(TestHostRootPath.TrimEnd('\/'))"</RunTestsCommand>
<RunTestsCommand Condition="'$(TestRspFile)' != '' and '$(RuntimeFlavor)' != 'Mono'">$(RunTestsCommand) --rsp-file "$(TestRspFile)"</RunTestsCommand>
<RunTestsCommand Condition="'$(TargetsMobile)' == 'true'">"$(RunScriptOutputPath)" $(AssemblyName) $(TargetArchitecture)</RunTestsCommand>
<RunTestsCommand Condition="'$(TargetOS)' == 'Browser'">"$(RunScriptOutputPath)" $(JSEngine) $(AssemblyName).dll $(_withoutCategories.Replace(';', ' -notrait category='))</RunTestsCommand>
diff --git a/eng/testing/xunit/xunit.console.targets b/eng/testing/xunit/xunit.console.targets
index 6364d461124..5b71327e964 100644
--- a/eng/testing/xunit/xunit.console.targets
+++ b/eng/testing/xunit/xunit.console.targets
@@ -43,19 +43,17 @@
<!-- Overwrite the runner config file with the app local one. -->
<Target Name="OverwriteDesktopTestRunnerConfigs"
- Condition="'$(GenerateRuntimeConfigurationFiles)' == 'true' and '$(TargetFrameworkIdentifier)' == '.NETFramework'"
+ Condition="'$(TargetFrameworkIdentifier)' == '.NETFramework' and
+ '$(GenerateAppConfigurationFile)' == 'true' and
+ '@(AppConfigWithTargetPath)' != ''"
AfterTargets="CopyFilesToOutputDirectory">
-
<ItemGroup>
- <_testRunnerConfigSourceFile Include="$(TargetDir)$(TargetName).exe.config" />
<_testRunnerConfigDestFile Include="$(TargetDir)xunit.console.exe.config" />
</ItemGroup>
- <Copy SourceFiles="@(_testRunnerConfigSourceFile)"
- Condition="'@(_testRunnerConfigSourceFile)' != ''"
+ <Copy SourceFiles="@(AppConfigWithTargetPath)"
DestinationFiles="@(_testRunnerConfigDestFile)"
SkipUnchangedFiles="true" />
-
</Target>
<!-- ResolveAssemblyReferences is the target that populates ReferenceCopyLocalPaths which is what is copied to output directory. -->
diff --git a/eng/testing/xunit/xunit.targets b/eng/testing/xunit/xunit.targets
index b14d3b7cbf2..feb429aab6b 100644
--- a/eng/testing/xunit/xunit.targets
+++ b/eng/testing/xunit/xunit.targets
@@ -1,4 +1,11 @@
<Project>
+ <ItemGroup>
+ <!-- Upgrade the NETStandard.Library transitive xunit dependency to avoid transitive 1.x NS dependencies. -->
+ <PackageReference Include="NETStandard.Library"
+ Version="$(NetStandardLibrary20Version)"
+ Condition="'$(TargetFrameworkIdentifier)' == '.NETCoreApp'" />
+ </ItemGroup>
+
<!-- Run target (F5) support. -->
<PropertyGroup>
<RunWorkingDirectory>$(OutDir)</RunWorkingDirectory>