Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move codebase to netcoreapp3.1 #3861

Merged
merged 35 commits into from
Jul 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
28e9a84
Fix TraitCollection label
Evangelink Jul 15, 2022
2312f29
Add build var TargetNetFxVersion
Evangelink Jul 15, 2022
a461ba2
Add Directory.Build.props for new variable
Evangelink Jul 18, 2022
bd04a52
Move to netcoreapp3.1
Evangelink Jul 18, 2022
ddc7748
More changes
Evangelink Jul 18, 2022
1525c34
More updates
Evangelink Jul 18, 2022
8d6d5d4
Update packages
Evangelink Jul 18, 2022
432625c
Update test/Microsoft.TestPlatform.AcceptanceTests/Extension/NetCoreT…
Evangelink Jul 18, 2022
4af9e43
Update src/Microsoft.TestPlatform.Execution.Shared/DebuggerBreakpoint.cs
Evangelink Jul 18, 2022
ae0e88b
Avoid potential ArgumentNullException
Evangelink Jul 18, 2022
e6864bf
Fix some warnings
Evangelink Jul 18, 2022
ba7705e
API is not available in netcoreapp
Evangelink Jul 18, 2022
e421f60
More removal
Evangelink Jul 18, 2022
3801bfe
Test
Evangelink Jul 18, 2022
5dd92e0
Fix unit tests
Evangelink Jul 19, 2022
54fb44b
Fix failing acceptance tests
Evangelink Jul 19, 2022
34279b5
More simplification
Evangelink Jul 19, 2022
e0b5f90
Fix acceptance tests?
Evangelink Jul 20, 2022
db86217
Ensure properties are defined for isolated acceptance tests
Evangelink Jul 20, 2022
26fb2c1
More updates
Evangelink Jul 21, 2022
9cfc71a
More fixes
Evangelink Jul 22, 2022
d3d64cb
Remove no longer needed code
Evangelink Jul 22, 2022
41b81d9
Add trick to bump netcoreapp version
Evangelink Jul 22, 2022
3d87612
Fix unit test
Evangelink Jul 22, 2022
382fde3
Fixeeesss
Evangelink Jul 25, 2022
5d17117
Address review comments
Evangelink Jul 25, 2022
4e02a3b
Undo changes to installed net core frameworks
Evangelink Jul 25, 2022
a4b328c
Install .net core 3.1.25 instead of 3.1.24
Evangelink Jul 26, 2022
4c31266
Add back 3.1.24 and keep 3.1.25
Evangelink Jul 26, 2022
0c9bdb3
Install runtime 3.1.27
Evangelink Jul 26, 2022
21d6c3b
Merge branch 'main' into netcoreapp3.1
nohwnd Jul 27, 2022
11371e2
605 files?
nohwnd Jul 27, 2022
aff5545
Add logging for arguments, revert later
nohwnd Jul 27, 2022
1ed6dad
Test can run on Linux
Evangelink Jul 27, 2022
303f7e4
Explain RunSpecificTestsShouldWorkWithFrameworkInCompatibleWarning test
nohwnd Jul 27, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
<Project>
<PropertyGroup>
<TargetNetFxVersion>net462</TargetNetFxVersion>
<TargetNetCoreVersion>netcoreapp3.1</TargetNetCoreVersion>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This cannot be true for source build. We need to build with net6.0 or preferably net7.0

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe naming is poor, it's actually "min supported version". In case of source build this isn't used.

</PropertyGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>netcoreapp1.0</TargetFramework>
<TargetFrameworks Condition=" '$(DotNetBuildFromSource)' == 'true' ">netcoreapp3.1</TargetFrameworks>
<TargetFramework>$(TargetNetCoreVersion)</TargetFramework>
<OutputType>Exe</OutputType>
</PropertyGroup>
<ItemGroup>
Expand All @@ -13,4 +12,4 @@
<PackageReference Include="System.Runtime.InteropServices.RuntimeInformation" Version="4.3.0" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
</ItemGroup>
</Project>
</Project>
4 changes: 2 additions & 2 deletions samples/UnitTestProject/UnitTestProject.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="..\..\scripts\build\TestPlatform.Dependencies.props" />
<PropertyGroup>
<TargetFrameworks>netcoreapp1.0;$(TargetNetFxVersion)</TargetFrameworks>
<TargetFrameworks Condition=" '$(DotNetBuildFromSource)' == 'true' ">netcoreapp3.1</TargetFrameworks>
<TargetFrameworks>$(TargetNetFxVersion);$(TargetNetCoreVersion)</TargetFrameworks>
<TargetFrameworks Condition=" '$(DotNetBuildFromSource)' == 'true' ">$(TargetNetCoreVersion)</TargetFrameworks>
<OutputType Condition=" '$(TargetFramework)' != '$(TargetNetFxVersion)' ">Exe</OutputType>
<AssemblyName>UnitTestProject</AssemblyName>
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
Expand Down
190 changes: 75 additions & 115 deletions scripts/build.ps1

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ DOTNET_CLI_VERSION=$_ReadGlobalVersion
TPB_Solution="TestPlatform.sln"
TPB_Build_From_Source_Solution="TestPlatform_BuildFromSource.sln"
TPB_TargetFramework="net462"
TPB_TargetFrameworkCore="netcoreapp2.1"
TPB_TargetFrameworkCore="netcoreapp3.1"
TPB_Configuration=$CONFIGURATION
TPB_TargetRuntime=$TARGET_RUNTIME
TPB_Version=$(test -z $VERSION_SUFFIX && echo $VERSION || echo $VERSION-$VERSION_SUFFIX)
Expand Down
2 changes: 2 additions & 0 deletions scripts/build/TestAssets.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
<!-- Not able to add TargetFrameworks here due to: https://github.com/dotnet/sdk/issues/1110 -->
<NetCoreAppTargetFramework Condition="'$(TargetFramework)' != '' AND $(TargetFramework.StartsWith('netcoreapp'))">true</NetCoreAppTargetFramework>
<CheckEolTargetFramework>false</CheckEolTargetFramework>
<TargetNetFxVersion Condition=" '$(TargetNetFxVersion)' == '' ">net462</TargetNetFxVersion>
<TargetNetCoreVersion Condition=" '$(TargetNetCoreVersion)' == '' ">netcoreapp3.1</TargetNetCoreVersion>
</PropertyGroup>

<Import Project="$(MSBuildThisFileDirectory)TestPlatform.Dependencies.props" Condition=" '$(DependencyVersionsImported)' != 'true' "/>
Expand Down
10 changes: 5 additions & 5 deletions scripts/perf/perf.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Param(
[System.String] $TargetRuntime = "win7-x64",

[Parameter(Mandatory=$false)]
[ValidateSet("netcoreapp2.1", "net462")]
[ValidateSet("netcoreapp3.1", "net462")]
[Alias("f")]
[System.String] $TargetFramework,

Expand Down Expand Up @@ -40,11 +40,11 @@ $env:TP_OUT_DIR = Join-Path $env:TP_ROOT_DIR "artifacts"
# Test configuration
#
$TPT_TargetFrameworkFullCLR = "net462"
$TPT_TargetFramework20Core = "netcoreapp2.1"
$TPT_TargetFramework31Core = "netcoreapp3.1"
Write-Verbose "Setup build configuration."
$Script:TPT_Configuration = $Configuration
$Script:TPT_SourceFolders = @(Join-Path $env:TP_ROOT_DIR "test\TestAssets")
$Script:TPT_TargetFrameworks =@($TPT_TargetFramework20Core, $TPT_TargetFrameworkFullCLR)
$Script:TPT_TargetFrameworks =@($TPT_TargetFramework31Core, $TPT_TargetFrameworkFullCLR)
$Script:TPT_TargetFramework = $TargetFramework
$Script:TPT_TargetRuntime = $TargetRuntime
$Script:TPT_Pattern = $Pattern
Expand Down Expand Up @@ -151,11 +151,11 @@ function Get-ConsoleRunnerPath($runner, $targetFrameWork)
{
if($runner -eq "vstest.console")
{
if($targetFrameWork -eq $TPT_TargetFramework20Core)
if($targetFrameWork -eq $TPT_TargetFramework31Core)
{
$vstestConsoleFileName = "vstest.console.dll"
$targetRunTime = ""
$vstestConsolePath = Join-Path (Get-PackageDirectory $TPT_TargetFramework20Core $targetRuntime) $vstestConsoleFileName
$vstestConsolePath = Join-Path (Get-PackageDirectory $TPT_TargetFramework31Core $targetRuntime) $vstestConsoleFileName
} else {
$vstestConsoleFileName = "vstest.console.exe"
$targetRunTime = $Script:TPT_TargetRuntime
Expand Down
4 changes: 2 additions & 2 deletions scripts/test.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ $env:NUGET_PACKAGES = $env:TP_PACKAGES_DIR
#
$TPT_TargetFrameworkNet462 = "net462"
$TPT_TargetFrameworkNet48 = "net48"
$TPT_TargetFrameworkCore21 = "netcoreapp2.1"
$TPT_TargetFrameworkCore31 = "netcoreapp3.1"
$TPT_TargetFrameworkNet60 = "net6.0"
Write-Verbose "Setup build configuration."
$Script:TPT_Configuration = $Configuration
Expand Down Expand Up @@ -231,7 +231,7 @@ function Invoke-Test
{
$vstestConsoleFileName = "vstest.console.dll"
$targetRunTime = ""
$vstestConsolePath = Join-Path (Get-PackageDirectory $TPT_TargetFrameworkCore21 $targetRuntime) $vstestConsoleFileName
$vstestConsolePath = Join-Path (Get-PackageDirectory $TPT_TargetFrameworkCore31 $targetRuntime) $vstestConsoleFileName
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion scripts/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ DOTNET_CLI_VERSION="latest"
# Build configuration
#
TPB_Solution="TestPlatform.sln"
TPB_TargetFrameworkCore="netcoreapp2.1"
TPB_TargetFrameworkCore="netcoreapp3.1"
TPB_Configuration=$CONFIGURATION
TPB_TargetRuntime=$TARGET_RUNTIME
TPB_Verbose=$VERBOSE
Expand Down
10 changes: 5 additions & 5 deletions scripts/verify-nupkgs.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@ function Verify-Nuget-Packages($packageDirectory, $version)
Write-Log "Starting Verify-Nuget-Packages."
$expectedNumOfFiles = @{
"Microsoft.CodeCoverage" = 57;
"Microsoft.NET.Test.Sdk" = 24;
"Microsoft.NET.Test.Sdk" = 18;
"Microsoft.TestPlatform" = 605;
"Microsoft.TestPlatform.Build" = 21;
"Microsoft.TestPlatform.CLI" = 498;
"Microsoft.TestPlatform.CLI" = 499;
"Microsoft.TestPlatform.Extensions.TrxLogger" = 35;
"Microsoft.TestPlatform.ObjectModel" = 209;
"Microsoft.TestPlatform.ObjectModel" = 180;
"Microsoft.TestPlatform.AdapterUtilities" = 62;
"Microsoft.TestPlatform.Portable" = 598;
"Microsoft.TestPlatform.TestHost" = 208;
"Microsoft.TestPlatform.Portable" = 597;
"Microsoft.TestPlatform.TestHost" = 153;
"Microsoft.TestPlatform.TranslationLayer" = 123;
"Microsoft.TestPlatform.Internal.Uwp" = 86;
}
Expand Down
4 changes: 4 additions & 0 deletions shared/NullableAttributes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ internal sealed class DoesNotReturnIfAttribute : Attribute
public bool ParameterValue { get; }
}

#endif

#if NETFRAMEWORK || WINDOWS_UWP || NETSTANDARD && !NETSTANDARD2_1 || NETCOREAPP && !NET5_0_OR_GREATER
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These 2 attributes are only available in .NET 5.0+ so I moved them to a different section.


/// <summary>Specifies that the method or property will ensure that the listed field and property members have not-null values.</summary>
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
internal sealed class MemberNotNullAttribute : Attribute
Expand Down
1 change: 0 additions & 1 deletion src/Microsoft.TestPlatform.Client/TestPlatform.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
using System.IO;
using System.Linq;
using System.Reflection;
using System.Reflection.Metadata;

using Microsoft.VisualStudio.TestPlatform.Client.Discovery;
using Microsoft.VisualStudio.TestPlatform.Client.Execution;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<Import Project="$(TestPlatformRoot)scripts/build/TestPlatform.Settings.targets" />
<PropertyGroup>
<AssemblyName>Microsoft.TestPlatform.CoreUtilities</AssemblyName>
<TargetFrameworks>net6.0;netstandard2.0;netstandard1.3;$(TargetNetFxVersion)</TargetFrameworks>
<TargetFrameworks>net6.0;netstandard2.0;netstandard1.3;$(TargetNetFxVersion);$(TargetNetCoreVersion)</TargetFrameworks>
<IsTestProject>false</IsTestProject>
<TargetFrameworks Condition="'$(OS)' == 'Windows_NT'">$(TargetFrameworks);uap10.0;netstandard1.0</TargetFrameworks>
<TargetFrameworks Condition=" '$(DotNetBuildFromSource)' == 'true' ">net6.0</TargetFrameworks>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#nullable enable
Microsoft.VisualStudio.TestPlatform.Utilities.ConsoleOutput
Microsoft.VisualStudio.TestPlatform.Utilities.ConsoleOutput.Write(string? message, Microsoft.VisualStudio.TestPlatform.Utilities.OutputLevel level) -> void
Microsoft.VisualStudio.TestPlatform.Utilities.ConsoleOutput.WriteLine(string? message, Microsoft.VisualStudio.TestPlatform.Utilities.OutputLevel level) -> void
Microsoft.VisualStudio.TestPlatform.Utilities.OutputExtensions
static Microsoft.VisualStudio.TestPlatform.ObjectModel.EqtTrace.TraceLevel.get -> Microsoft.VisualStudio.TestPlatform.ObjectModel.PlatformTraceLevel
static Microsoft.VisualStudio.TestPlatform.ObjectModel.EqtTrace.TraceLevel.set -> void
static Microsoft.VisualStudio.TestPlatform.Utilities.ConsoleOutput.Instance.get -> Microsoft.VisualStudio.TestPlatform.Utilities.ConsoleOutput!
static Microsoft.VisualStudio.TestPlatform.Utilities.OutputExtensions.Error(this Microsoft.VisualStudio.TestPlatform.Utilities.IOutput! output, bool appendPrefix, string! format, params object?[]? args) -> void
static Microsoft.VisualStudio.TestPlatform.Utilities.OutputExtensions.Information(this Microsoft.VisualStudio.TestPlatform.Utilities.IOutput! output, bool appendPrefix, string! format, params object?[]? args) -> void
static Microsoft.VisualStudio.TestPlatform.Utilities.OutputExtensions.Information(this Microsoft.VisualStudio.TestPlatform.Utilities.IOutput! output, bool appendPrefix, System.ConsoleColor foregroundColor, string! format, params object?[]? args) -> void
static Microsoft.VisualStudio.TestPlatform.Utilities.OutputExtensions.Warning(this Microsoft.VisualStudio.TestPlatform.Utilities.IOutput! output, bool appendPrefix, string! format, params object?[]? args) -> void
static Microsoft.VisualStudio.TestPlatform.Utilities.OutputExtensions.Write(this Microsoft.VisualStudio.TestPlatform.Utilities.IOutput! output, string! message, Microsoft.VisualStudio.TestPlatform.Utilities.OutputLevel level, System.ConsoleColor foregroundColor) -> void
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public static TraceLevel TraceLevel

#endif

#if NETSTANDARD || NET
#if NETSTANDARD || NET || NETCOREAPP3_1
Evangelink marked this conversation as resolved.
Show resolved Hide resolved
public static PlatformTraceLevel TraceLevel
{
get
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,12 @@ public override int LaunchDataCollector(IDictionary<string, string?>? environmen
TPDebug.Assert(currentProcessPath is not null, "currentProcessPath is not null");

// If current process is dotnet/dotnet.exe and you are here, datacollector.exe/datacollector.arm64.exe is present in TestHost folder.
string dataCollectorProcessName = _processHelper.GetCurrentProcessArchitecture() == PlatformArchitecture.ARM64 ? DataCollectorProcessNameArm64 : DataCollectorProcessName;
string dataCollectorProcessName = _processHelper.GetCurrentProcessArchitecture() == PlatformArchitecture.ARM64
? DataCollectorProcessNameArm64
: DataCollectorProcessName;
string dataCollectorProcessPath = currentProcessPath.EndsWith("dotnet", StringComparison.OrdinalIgnoreCase)
|| currentProcessPath.EndsWith("dotnet.exe", StringComparison.OrdinalIgnoreCase)
? Path.Combine(dataCollectorDirectory, "TestHost", dataCollectorProcessName)
? Path.Combine(dataCollectorDirectory, "TestHostNetFramework", dataCollectorProcessName)
: Path.Combine(dataCollectorDirectory, dataCollectorProcessName);

var argumentsString = string.Join(" ", commandLineArguments);
Expand Down
22 changes: 3 additions & 19 deletions src/Microsoft.TestPlatform.Execution.Shared/DebuggerBreakpoint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ internal static class DebuggerBreakpoint
{
internal static void AttachVisualStudioDebugger(string environmentVariable)
{
#if NETCOREAPP1_0
return;
#else
if (string.IsNullOrWhiteSpace(environmentVariable))
{
throw new ArgumentException($"'{nameof(environmentVariable)}' cannot be null or whitespace.", nameof(environmentVariable));
Expand Down Expand Up @@ -53,14 +50,10 @@ internal static void AttachVisualStudioDebugger(string environmentVariable)

Break();
}
#endif
}

private static bool AttachVs(Process process, int? vsPid)
{
#if NETCOREAPP1_0
return false;
#else
// The way we attach VS is not compatible with .NET Core 2.1 and .NET Core 3.1, but works in .NET Framework and .NET.
// We could call the library code directly here for .NET, and .NET Framework, but then we would also need to package it
// together with testhost. So instead we always run the executable, and pass path to it using env variable.
Expand All @@ -84,29 +77,20 @@ private static bool AttachVs(Process process, int? vsPid)
attachVsProcess.WaitForExit();

return attachVsProcess.ExitCode == 0;
#endif
}

private static string? FindAttachVs()
{
#if NETCOREAPP1_0
return null;
#else

var fromPath = FindOnPath("AttachVS.exe");
if (fromPath != null)
{
return fromPath;
}


# if NETCOREAPP
var parent = AppContext.BaseDirectory;
#else
// Don't use current process MainModule here, it resolves to dotnet if you invoke
// dotnet vstest.console.dll, or dotnet testhost.dll. Use the entry assembly instead.
var parent = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location);
#endif
var parent = Path.GetDirectoryName(Assembly.GetEntryAssembly()!.Location);
while (parent != null)
{
var path = Path.Combine(parent, @"src\AttachVS\bin\Debug\net472\AttachVS.exe");
Expand All @@ -120,12 +104,12 @@ private static bool AttachVs(Process process, int? vsPid)
}

return parent;
#endif
}

private static string? FindOnPath(string exeName)
{
var paths = Environment.GetEnvironmentVariable("PATH").Split(';');
// TODO: Skip when PATH is not defined.
var paths = Environment.GetEnvironmentVariable("PATH")!.Split(';');
Evangelink marked this conversation as resolved.
Show resolved Hide resolved
foreach (var p in paths)
{
var path = Path.Combine(p, exeName);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<Import Project="$(TestPlatformRoot)scripts/build/TestPlatform.Settings.targets" />
<PropertyGroup>
<AssemblyName>Microsoft.VisualStudio.TestPlatform.ObjectModel</AssemblyName>
<TargetFrameworks>$(TargetNetFxVersion);netcoreapp2.1;netcoreapp1.0;netstandard2.0;netstandard1.3</TargetFrameworks>
<TargetFrameworks>$(TargetNetFxVersion);$(TargetNetCoreVersion);netstandard2.0;netstandard1.3</TargetFrameworks>
<TargetFrameworks Condition="'$(OS)' == 'Windows_NT'">$(TargetFrameworks);uap10.0;netstandard1.0</TargetFrameworks>
Evangelink marked this conversation as resolved.
Show resolved Hide resolved
<TargetFrameworks Condition=" '$(DotNetBuildFromSource)' == 'true' ">net6.0</TargetFrameworks>
<PackageId>Microsoft.TestPlatform.ObjectModel</PackageId>
Expand Down Expand Up @@ -43,7 +43,7 @@
<PackageReference Include="System.Runtime" Version="4.3.0" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard1.3' OR '$(TargetFramework)' == 'netcoreapp1.0'">
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard1.3'">
<PackageReference Include="System.Reflection.Metadata" Version="1.6.0" />
<PackageReference Include="System.ComponentModel.EventBasedAsync" Version="4.3.0" />
<PackageReference Include="System.ComponentModel.TypeConverter" Version="4.3.0" />
Expand All @@ -58,7 +58,7 @@
<PackageReference Include="NuGet.Frameworks" Version="4.6.4" />
</ItemGroup>

<ItemGroup Condition="!$(TargetFramework.StartsWith('netstandard1')) AND '$(TargetFramework)' != 'uap10.0' AND '$(TargetFramework)' != 'netcoreapp1.0'">
<ItemGroup Condition="!$(TargetFramework.StartsWith('netstandard1')) AND '$(TargetFramework)' != 'uap10.0'">
<PackageReference Include="System.Reflection.Metadata" Version="1.6.0" />
<PackageReference Include="NuGet.Frameworks" Version="$(NuGetFrameworksVersion)" />
</ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,13 @@ private static ISymbolReader GetSymbolReader(string? binaryPath)

// For remote scenario, also look for pdb in current directory, (esp for UWP)
// The alternate search path should be an input from Adapters, but since it is not so currently adding a HACK
pdbFilePath = !File.Exists(pdbFilePath) ? Path.Combine(Directory.GetCurrentDirectory(), Path.GetFileName(pdbFilePath)!) : pdbFilePath;
pdbFilePath = !File.Exists(pdbFilePath)
? Path.Combine(Directory.GetCurrentDirectory(), Path.GetFileName(pdbFilePath)!)
: pdbFilePath;

if (File.Exists(pdbFilePath))
{
using var stream = new FileHelper().GetStream(pdbFilePath, FileMode.Open, FileAccess.Read);
using var stream = new FileHelper().GetStream(pdbFilePath!, FileMode.Open, FileAccess.Read);
return PortablePdbReader.IsPortable(stream) ? new PortableSymbolReader() : new FullSymbolReader();
}
else
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ public static bool ContainsDataCollector(IXPathNavigable runSettingDocument, str
var navigator = runSettingDocument.CreateNavigator();
var nodes = navigator!.Select("/RunSettings/DataCollectionRunSettings/DataCollectors/DataCollector");

foreach (XPathNavigator dataCollectorNavigator in nodes)
foreach (XPathNavigator? dataCollectorNavigator in nodes)
{
var uri = dataCollectorNavigator.GetAttribute("uri", string.Empty);
var uri = dataCollectorNavigator?.GetAttribute("uri", string.Empty);
if (string.Equals(dataCollectorUri, uri, StringComparison.OrdinalIgnoreCase))
{
return true;
Expand Down Expand Up @@ -101,10 +101,10 @@ public static IList<string> GetDataCollectorsFriendlyName(string? runsettingsXml
var runSettingsNavigator = document.CreateNavigator();
var nodes = runSettingsNavigator!.Select("/RunSettings/DataCollectionRunSettings/DataCollectors/DataCollector");

foreach (XPathNavigator dataCollectorNavigator in nodes)
foreach (XPathNavigator? dataCollectorNavigator in nodes)
{
var friendlyName = dataCollectorNavigator.GetAttribute("friendlyName", string.Empty);
friendlyNameList.Add(friendlyName);
var friendlyName = dataCollectorNavigator?.GetAttribute("friendlyName", string.Empty);
friendlyNameList.Add(friendlyName!);
}
}

Expand Down
Loading