diff --git a/BUILDGUIDE.md b/BUILDGUIDE.md index febe1c2214..090c238c04 100644 --- a/BUILDGUIDE.md +++ b/BUILDGUIDE.md @@ -209,7 +209,7 @@ Tests can be built and run with custom Target Frameworks. See the below examples ```bash > msbuild /t:BuildTestsNetCore /p:TargetNetCoreVersion=netcoreapp3.1 # Build the tests for custom TargetFramework (.NET Core) -# Applicable values: netcoreapp2.1 | netcoreapp2.2 | netcoreapp3.1 | netcoreapp5.0 +# Applicable values: netcoreapp2.1 | netcoreapp2.2 | netcoreapp3.1 | net5.0 ``` ### Running Tests: @@ -221,7 +221,7 @@ Tests can be built and run with custom Target Frameworks. See the below examples > dotnet test /p:TargetNetCoreVersion=netcoreapp3.1 ... # Use above property to run Functional Tests with custom TargetFramework (.NET Core) -# Applicable values: netcoreapp2.1 | netcoreapp2.2 | netcoreapp3.1 | netcoreapp5.0 +# Applicable values: netcoreapp2.1 | netcoreapp2.2 | netcoreapp3.1 | net5.0 ``` ## Using Managed SNI on Windows diff --git a/RunTests.cmd b/RunTests.cmd index 26e644547b..8eb9530dc7 100644 --- a/RunTests.cmd +++ b/RunTests.cmd @@ -21,9 +21,9 @@ call :pauseOnError msbuild /p:Configuration="Release" /t:BuildTestsNetCore /p:Re call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj" /p:Configuration="Release" /p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" /p:Platform="AnyCPU" /p:TargetNetCoreVersion=netcoreapp3.1 /p:ReferenceType=Package -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\package-netcore3.1-functional-anycpu.xml call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" /p:Configuration="Release" /p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" /p:Platform="AnyCPU" /p:TargetNetCoreVersion=netcoreapp3.1 /p:ReferenceType=Package -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\package-netcore3.1-manual-anycpu.xml -call :pauseOnError msbuild /p:Configuration="Release" /t:BuildTestsNetCore /p:ReferenceType=Package /p:TargetNetCoreVersion=netcoreapp5.0 -call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj" /p:Configuration="Release" /p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" /p:Platform="AnyCPU" /p:TargetNetCoreVersion=netcoreapp5.0 /p:ReferenceType=Package -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\package-netcore5.0-functional-anycpu.xml -call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" /p:Configuration="Release" /p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" /p:Platform="AnyCPU" /p:TargetNetCoreVersion=netcoreapp5.0 /p:ReferenceType=Package -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\package-netcore5.0-manual-anycpu.xml +call :pauseOnError msbuild /p:Configuration="Release" /t:BuildTestsNetCore /p:ReferenceType=Package /p:TargetNetCoreVersion=net5.0 +call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj" /p:Configuration="Release" /p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" /p:Platform="AnyCPU" /p:TargetNetCoreVersion=net5.0 /p:ReferenceType=Package -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\package-netcore5.0-functional-anycpu.xml +call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" /p:Configuration="Release" /p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" /p:Platform="AnyCPU" /p:TargetNetCoreVersion=net5.0 /p:ReferenceType=Package -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\package-net5.0-manual-anycpu.xml call :pauseOnError msbuild /p:Configuration="Release" /t:BuildTestsNetCore /p:ReferenceType=Package /p:Platform=x64 call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj" /p:Configuration="Release" /p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" /p:Platform="x64" /p:TargetNetCoreVersion=netcoreapp2.1 /p:ReferenceType=Package -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\package-netcore2.1-functional-x64.xml @@ -33,9 +33,9 @@ call :pauseOnError msbuild /p:Configuration="Release" /t:BuildTestsNetCore /p:Re call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj" /p:Configuration="Release" /p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" /p:Platform="x64" /p:TargetNetCoreVersion=netcoreapp3.1 /p:ReferenceType=Package -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\package-netcore3.1-functional-x64.xml call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" /p:Configuration="Release" /p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" /p:Platform="x64" /p:TargetNetCoreVersion=netcoreapp3.1 /p:ReferenceType=Package -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\package-netcore3.1-manual-x64.xml -call :pauseOnError msbuild /p:Configuration="Release" /t:BuildTestsNetCore /p:ReferenceType=Package /p:Platform=x64 /p:TargetNetCoreVersion=netcoreapp5.0 -call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj" /p:Configuration="Release" /p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" /p:Platform="x64" /p:TargetNetCoreVersion=netcoreapp5.0 /p:ReferenceType=Package -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\package-netcore5.0-functional-x64.xml -call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" /p:Configuration="Release" /p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" /p:Platform="x64" /p:TargetNetCoreVersion=netcoreapp5.0 /p:ReferenceType=Package -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\package-netcore5.0-manual-x64.xml +call :pauseOnError msbuild /p:Configuration="Release" /t:BuildTestsNetCore /p:ReferenceType=Package /p:Platform=x64 /p:TargetNetCoreVersion=net5.0 +call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj" /p:Configuration="Release" /p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" /p:Platform="x64" /p:TargetNetCoreVersion=net5.0 /p:ReferenceType=Package -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\package-netcore5.0-functional-x64.xml +call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" /p:Configuration="Release" /p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" /p:Platform="x64" /p:TargetNetCoreVersion=net5.0 /p:ReferenceType=Package -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\package-netcore5.0-manual-x64.xml call :pauseOnError msbuild /p:Configuration="Release" /t:BuildTestsNetCore /p:ReferenceType=Package /p:Platform=Win32 call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj" /p:Configuration="Release" /p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" /p:Platform="Win32" /p:TargetNetCoreVersion=netcoreapp2.1 /p:ReferenceType=Package -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\package-netcore2.1-functional-win32.xml @@ -45,9 +45,9 @@ call :pauseOnError msbuild /p:Configuration="Release" /t:BuildTestsNetCore /p:Re call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj" /p:Configuration="Release" /p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" /p:Platform="Win32" /p:TargetNetCoreVersion=netcoreapp3.1 /p:ReferenceType=Package -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\package-netcore3.1-functional-win32.xml call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" /p:Configuration="Release" /p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" /p:Platform="Win32" /p:TargetNetCoreVersion=netcoreapp3.1 /p:ReferenceType=Package -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\package-netcore3.1-manual-win32.xml -call :pauseOnError msbuild /p:Configuration="Release" /t:BuildTestsNetCore /p:ReferenceType=Package /p:Platform=Win32 /p:TargetNetCoreVersion=netcoreapp5.0 -call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj" /p:Configuration="Release" /p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" /p:Platform="Win32" /p:TargetNetCoreVersion=netcoreapp5.0 /p:ReferenceType=Package -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\package-netcore5.0-functional-win32.xml -call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" /p:Configuration="Release" /p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" /p:Platform="Win32" /p:TargetNetCoreVersion=netcoreapp5.0 /p:ReferenceType=Package -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\package-netcore5.0-manual-win32.xml +call :pauseOnError msbuild /p:Configuration="Release" /t:BuildTestsNetCore /p:ReferenceType=Package /p:Platform=Win32 /p:TargetNetCoreVersion=net5.0 +call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj" /p:Configuration="Release" /p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" /p:Platform="Win32" /p:TargetNetCoreVersion=net5.0 /p:ReferenceType=Package -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\package-netcore5.0-functional-win32.xml +call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" /p:Configuration="Release" /p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" /p:Platform="Win32" /p:TargetNetCoreVersion=net5.0 /p:ReferenceType=Package -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\package-netcore5.0-manual-win32.xml :: REFERENCE TYPE "NETSTANDARDPACKAGE" call :pauseOnError msbuild /p:Configuration="Release" /t:BuildTestsNetCore /p:ReferenceType=NetStandardPackage @@ -58,9 +58,9 @@ call :pauseOnError msbuild /p:Configuration="Release" /t:BuildTestsNetCore /p:Re call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj" /p:Configuration="Release" /p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" /p:Platform="AnyCPU" /p:TargetNetCoreVersion=netcoreapp3.1 /p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-netcore3.1-functional-anycpu.xml call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" /p:Configuration="Release" /p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" /p:Platform="AnyCPU" /p:TargetNetCoreVersion=netcoreapp3.1 /p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-netcore3.1-manual-anycpu.xml -call :pauseOnError msbuild /p:Configuration="Release" /t:BuildTestsNetCore /p:ReferenceType=NetStandardPackage /p:TargetNetCoreVersion=netcoreapp5.0 -call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj" /p:Configuration="Release" /p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" /p:Platform="AnyCPU" /p:TargetNetCoreVersion=netcoreapp5.0 /p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-netcore5.0-functional-anycpu.xml -call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" /p:Configuration="Release" /p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" /p:Platform="AnyCPU" /p:TargetNetCoreVersion=netcoreapp5.0 /p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-netcore5.0-manual-anycpu.xml +call :pauseOnError msbuild /p:Configuration="Release" /t:BuildTestsNetCore /p:ReferenceType=NetStandardPackage /p:TargetNetCoreVersion=net5.0 +call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj" /p:Configuration="Release" /p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" /p:Platform="AnyCPU" /p:TargetNetCoreVersion=net5.0 /p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-netcore5.0-functional-anycpu.xml +call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" /p:Configuration="Release" /p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" /p:Platform="AnyCPU" /p:TargetNetCoreVersion=net5.0 /p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-netcore5.0-manual-anycpu.xml call :pauseOnError msbuild /p:Configuration="Release" /t:BuildTestsNetFx /p:ReferenceType=NetStandardPackage /p:TargetNetFxVersion=net462 call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj" /p:Configuration="Release" /p:TestTargetOS="Windowsnetfx" --no-build -v n --filter "category!=nonnetfxtests&category!=failing&category!=nonwindowstests" /p:Platform="AnyCPU" /p:TargetNetFxVersion=net462 /p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-net462-functional-anycpu.xml @@ -78,9 +78,9 @@ call :pauseOnError msbuild /p:Configuration="Release" /t:BuildTestsNetCore /p:Re call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj" /p:Configuration="Release" /p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" /p:Platform="x64" /p:TargetNetCoreVersion=netcoreapp3.1 /p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-netcore3.1-functional-x64.xml call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" /p:Configuration="Release" /p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" /p:Platform="x64" /p:TargetNetCoreVersion=netcoreapp3.1 /p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-netcore3.1-manual-x64.xml -call :pauseOnError msbuild /p:Configuration="Release" /t:BuildTestsNetCore /p:ReferenceType=NetStandardPackage /p:Platform=x64 /p:TargetNetCoreVersion=netcoreapp5.0 -call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj" /p:Configuration="Release" /p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" /p:Platform="x64" /p:TargetNetCoreVersion=netcoreapp5.0 /p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-netcore5.0-functional-x64.xml -call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" /p:Configuration="Release" /p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" /p:Platform="x64" /p:TargetNetCoreVersion=netcoreapp5.0 /p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-netcore5.0-manual-x64.xml +call :pauseOnError msbuild /p:Configuration="Release" /t:BuildTestsNetCore /p:ReferenceType=NetStandardPackage /p:Platform=x64 /p:TargetNetCoreVersion=net5.0 +call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj" /p:Configuration="Release" /p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" /p:Platform="x64" /p:TargetNetCoreVersion=net5.0 /p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-netcore5.0-functional-x64.xml +call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" /p:Configuration="Release" /p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" /p:Platform="x64" /p:TargetNetCoreVersion=net5.0 /p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-netcore5.0-manual-x64.xml call :pauseOnError msbuild /p:Configuration="Release" /t:BuildTestsNetFx /p:ReferenceType=NetStandardPackage /p:Platform=x64 /p:TargetNetFxVersion=net462 call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj" /p:Configuration="Release" /p:TestTargetOS="Windowsnetfx" --no-build -v n --filter "category!=nonnetfxtests&category!=failing&category!=nonwindowstests" /p:Platform="x64" /p:TargetNetFxVersion=net462 /p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-net462-functional-x64.xml @@ -98,9 +98,9 @@ call :pauseOnError msbuild /p:Configuration="Release" /t:BuildTestsNetCore /p:Re call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj" /p:Configuration="Release" /p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" /p:Platform="Win32" /p:TargetNetCoreVersion=netcoreapp3.1 /p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-netcore3.1-functional-win32.xml call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" /p:Configuration="Release" /p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" /p:Platform="Win32" /p:TargetNetCoreVersion=netcoreapp3.1 /p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-netcore3.1-manual-win32.xml -call :pauseOnError msbuild /p:Configuration="Release" /t:BuildTestsNetCore /p:ReferenceType=NetStandardPackage /p:Platform=Win32 /p:TargetNetCoreVersion=netcoreapp5.0 -call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj" /p:Configuration="Release" /p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" /p:Platform="Win32" /p:TargetNetCoreVersion=netcoreapp5.0 /p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-netcore5.0-functional-win32.xml -call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" /p:Configuration="Release" /p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" /p:Platform="Win32" /p:TargetNetCoreVersion=netcoreapp5.0 /p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-netcore5.0-manual-win32.xml +call :pauseOnError msbuild /p:Configuration="Release" /t:BuildTestsNetCore /p:ReferenceType=NetStandardPackage /p:Platform=Win32 /p:TargetNetCoreVersion=net5.0 +call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj" /p:Configuration="Release" /p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" /p:Platform="Win32" /p:TargetNetCoreVersion=net5.0 /p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-netcore5.0-functional-win32.xml +call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" /p:Configuration="Release" /p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" /p:Platform="Win32" /p:TargetNetCoreVersion=net5.0 /p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-netcore5.0-manual-win32.xml call :pauseOnError msbuild /p:Configuration="Release" /t:BuildTestsNetFx /p:ReferenceType=NetStandardPackage /p:Platform=Win32 /p:TargetNetFxVersion=net462 call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj" /p:Configuration="Release" /p:TestTargetOS="Windowsnetfx" --no-build -v n --filter "category!=nonnetfxtests&category!=failing&category!=nonwindowstests" /p:Platform="Win32" /p:TargetNetFxVersion=net462 /p:ReferenceType=NetStandardPackage -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandardpackage-net462-functional-win32.xml @@ -121,9 +121,9 @@ call :pauseOnError msbuild /p:Configuration="Release" /t:BuildTestsNetCore /p:Re call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj" /p:Configuration="Release" /p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" /p:Platform="AnyCPU" /p:TargetNetCoreVersion=netcoreapp3.1 /p:ReferenceType=NetStandard -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandard-netcore3.1-functional-anycpu.xml call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" /p:Configuration="Release" /p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" /p:Platform="AnyCPU" /p:TargetNetCoreVersion=netcoreapp3.1 /p:ReferenceType=NetStandard -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandard-netcore3.1-manual-anycpu.xml -call :pauseOnError msbuild /p:Configuration="Release" /t:BuildTestsNetCore /p:ReferenceType=NetStandard /p:TargetNetCoreVersion=netcoreapp5.0 -call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj" /p:Configuration="Release" /p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" /p:Platform="AnyCPU" /p:TargetNetCoreVersion=netcoreapp5.0 /p:ReferenceType=NetStandard -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandard-netcore5.0-functional-anycpu.xml -call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" /p:Configuration="Release" /p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" /p:Platform="AnyCPU" /p:TargetNetCoreVersion=netcoreapp5.0 /p:ReferenceType=NetStandard -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandard-netcore5.0-manual-anycpu.xml +call :pauseOnError msbuild /p:Configuration="Release" /t:BuildTestsNetCore /p:ReferenceType=NetStandard /p:TargetNetCoreVersion=net5.0 +call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj" /p:Configuration="Release" /p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" /p:Platform="AnyCPU" /p:TargetNetCoreVersion=net5.0 /p:ReferenceType=NetStandard -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandard-netcore5.0-functional-anycpu.xml +call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" /p:Configuration="Release" /p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" /p:Platform="AnyCPU" /p:TargetNetCoreVersion=net5.0 /p:ReferenceType=NetStandard -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\netstandard-netcore5.0-manual-anycpu.xml :: TESTING 'NETSTANDARD' REFERENCE TYPE WITH .NET FRAMEWORK 4.6.1+ AS TARGET FRAMEWORK IS INVALID CASE AS PROJECT REFERENCE DOES NOT LOAD SNI.DLL IN .NET FRAMEWORK RUNTIME. :: CASE IS VERIFIED WITH RUNTIME.NATIVE.SYSTEM.DATA.SQLCLIENT.SNI AS WELL. TO TEST .NET FRAMEWORK TARGETS, USE 'NETSTANDARDPACKAGE' REFERENCE TYPE ONLY. @@ -142,9 +142,9 @@ call :pauseOnError msbuild /p:Configuration="Release" /t:BuildTestsNetCore /p:Ta call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj" /p:Configuration="Release" /p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" /p:Platform="AnyCPU" /p:TargetNetCoreVersion=netcoreapp3.1 /p:ReferenceType=Project -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\project-netcore3.1-functional-anycpu.xml call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" /p:Configuration="Release" /p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" /p:Platform="AnyCPU" /p:TargetNetCoreVersion=netcoreapp3.1 /p:ReferenceType=Project -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\project-netcore3.1-manual-anycpu.xml -call :pauseOnError msbuild /p:Configuration="Release" /t:BuildTestsNetCore /p:TargetNetCoreVersion=netcoreapp5.0 -call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj" /p:Configuration="Release" /p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" /p:Platform="AnyCPU" /p:TargetNetCoreVersion=netcoreapp5.0 /p:ReferenceType=Project -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\project-netcore5.0-functional-anycpu.xml -call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" /p:Configuration="Release" /p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" /p:Platform="AnyCPU" /p:TargetNetCoreVersion=netcoreapp5.0 /p:ReferenceType=Project -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\project-netcore5.0-manual-anycpu.xml +call :pauseOnError msbuild /p:Configuration="Release" /t:BuildTestsNetCore /p:TargetNetCoreVersion=net5.0 +call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\FunctionalTests\Microsoft.Data.SqlClient.Tests.csproj" /p:Configuration="Release" /p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" /p:Platform="AnyCPU" /p:TargetNetCoreVersion=net5.0 /p:ReferenceType=Project -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\project-netcore5.0-functional-anycpu.xml +call :pauseOnError dotnet test "src\Microsoft.Data.SqlClient\tests\ManualTests\Microsoft.Data.SqlClient.ManualTesting.Tests.csproj" /p:Configuration="Release" /p:TestTargetOS="Windowsnetcoreapp" --no-build -v n --filter "category!=nonnetcoreapptests&category!=failing&category!=nonwindowstests" /p:Platform="AnyCPU" /p:TargetNetCoreVersion=net5.0 /p:ReferenceType=Project -l:trx;LogFileName=..\..\..\..\..\artifacts\Results\project-netcore5.0-manual-anycpu.xml :: .NET FRAMEWORK REFERENCE TYPE "PROJECT" echo Building .NET Framework Tests diff --git a/src/Microsoft.Data.SqlClient/tests/FunctionalTests/AlwaysEncryptedTests/ExceptionsCertStore.cs b/src/Microsoft.Data.SqlClient/tests/FunctionalTests/AlwaysEncryptedTests/ExceptionsCertStore.cs index e4a311c7b6..8559c26e54 100644 --- a/src/Microsoft.Data.SqlClient/tests/FunctionalTests/AlwaysEncryptedTests/ExceptionsCertStore.cs +++ b/src/Microsoft.Data.SqlClient/tests/FunctionalTests/AlwaysEncryptedTests/ExceptionsCertStore.cs @@ -41,7 +41,7 @@ public void CertificateNotFound() Assert.Matches(expectedMessage, e.Message); } -#if NET46 +#if NETFX [Fact] [SkipOnTargetFramework(TargetFrameworkMonikers.Netcoreapp)] public void CertificateWithNoPrivateKey() @@ -68,7 +68,7 @@ public class ExceptionCertFixture : IDisposable public static string thumbprint; public static byte[] cek; public static byte[] encryptedCek; -#if NET46 +#if NETFX public static X509Certificate2 masterKeyCertificateNPK; // no private key public static string thumbprintNPK; // No private key public static string masterKeyPathNPK; @@ -84,7 +84,7 @@ public ExceptionCertFixture() certificatePath = string.Format("CurrentUser/My/{0}", thumbprint); cek = Utility.GenerateRandomBytes(32); encryptedCek = certStoreProvider.EncryptColumnEncryptionKey(certificatePath, "RSA_OAEP", cek); -#if NET46 +#if NETFX if(masterKeyCertificateNPK == null) { masterKeyCertificateNPK = Utility.CreateCertificateWithNoPrivateKey(); diff --git a/src/Microsoft.Data.SqlClient/tests/FunctionalTests/AlwaysEncryptedTests/SqlColumnEncryptionCspProviderShould.cs b/src/Microsoft.Data.SqlClient/tests/FunctionalTests/AlwaysEncryptedTests/SqlColumnEncryptionCspProviderShould.cs index 874d510a7d..8ffde57a15 100644 --- a/src/Microsoft.Data.SqlClient/tests/FunctionalTests/AlwaysEncryptedTests/SqlColumnEncryptionCspProviderShould.cs +++ b/src/Microsoft.Data.SqlClient/tests/FunctionalTests/AlwaysEncryptedTests/SqlColumnEncryptionCspProviderShould.cs @@ -183,6 +183,7 @@ public void Dispose() public static void AddKeyToCsp(string containerName) { + CspParameters cspParams = new CspParameters(); cspParams.KeyContainerName = containerName; RSACryptoServiceProvider rsaAlg = new RSACryptoServiceProvider(KEY_SIZE, cspParams); diff --git a/src/Microsoft.Data.SqlClient/tests/FunctionalTests/Microsoft.Data.SqlClient.Tests.csproj b/src/Microsoft.Data.SqlClient/tests/FunctionalTests/Microsoft.Data.SqlClient.Tests.csproj index d81e7d243e..339d74a6d9 100644 --- a/src/Microsoft.Data.SqlClient/tests/FunctionalTests/Microsoft.Data.SqlClient.Tests.csproj +++ b/src/Microsoft.Data.SqlClient/tests/FunctionalTests/Microsoft.Data.SqlClient.Tests.csproj @@ -2,23 +2,27 @@ false FunctionalTests - netcoreapp netfx + netcoreapp Debug;Release;net461-Release;net461-Debug;netcoreapp2.1-Debug;netcoreapp2.1-Release;netcoreapp3.1-Debug;netcoreapp3.1-Release AnyCPU;x86;x64 + $(DefineConstants);NETFX $(DefineConstants);NETCOREAPP + $(DefineConstants);NET50_OR_LATER $(ObjFolder)$(Configuration).$(Platform).$(AssemblyName) $(BinFolder)$(Configuration).$(Platform).$(AssemblyName) - - - + + + + + diff --git a/src/Microsoft.Data.SqlClient/tests/FunctionalTests/SqlCommandTest.cs b/src/Microsoft.Data.SqlClient/tests/FunctionalTests/SqlCommandTest.cs index ce81137140..c90a37b135 100644 --- a/src/Microsoft.Data.SqlClient/tests/FunctionalTests/SqlCommandTest.cs +++ b/src/Microsoft.Data.SqlClient/tests/FunctionalTests/SqlCommandTest.cs @@ -24,7 +24,7 @@ public void Constructor1() Assert.Null(cmd.Container); Assert.True(cmd.DesignTimeVisible); Assert.Null(cmd.Notification); -#if NET461 +#if NETFX // see https://github.com/dotnet/SqlClient/issues/17 Assert.True(cmd.NotificationAutoEnlist); #endif @@ -46,7 +46,7 @@ public void Constructor2() Assert.Null(cmd.Container); Assert.True(cmd.DesignTimeVisible); Assert.Null(cmd.Notification); -#if NET461 +#if NETFX // see https://github.com/dotnet/SqlClient/issues/17 Assert.True(cmd.NotificationAutoEnlist); #endif @@ -64,7 +64,7 @@ public void Constructor2() Assert.Null(cmd.Container); Assert.True(cmd.DesignTimeVisible); Assert.Null(cmd.Notification); -#if NET461 +#if NETFX // see https://github.com/dotnet/SqlClient/issues/17 Assert.True(cmd.NotificationAutoEnlist); #endif @@ -89,7 +89,7 @@ public void Constructor3() Assert.Null(cmd.Container); Assert.True(cmd.DesignTimeVisible); Assert.Null(cmd.Notification); -#if NET461 +#if NETFX // see https://github.com/dotnet/SqlClient/issues/17 Assert.True(cmd.NotificationAutoEnlist); #endif @@ -107,7 +107,7 @@ public void Constructor3() Assert.Null(cmd.Container); Assert.True(cmd.DesignTimeVisible); Assert.Null(cmd.Notification); -#if NET461 +#if NETFX // see https://github.com/dotnet/SqlClient/issues/17 Assert.True(cmd.NotificationAutoEnlist); #endif @@ -125,7 +125,7 @@ public void Constructor3() Assert.Null(cmd.Container); Assert.True(cmd.DesignTimeVisible); Assert.Null(cmd.Notification); -#if NET461 +#if NETFX // see https://github.com/dotnet/SqlClient/issues/17 Assert.True(cmd.NotificationAutoEnlist); #endif @@ -166,7 +166,7 @@ public void Constructor4() Assert.Null(cmd.Container); Assert.True(cmd.DesignTimeVisible); Assert.Null(cmd.Notification); -#if NET461 +#if NETFX // see https://github.com/dotnet/SqlClient/issues/17 Assert.True(cmd.NotificationAutoEnlist); #endif @@ -184,7 +184,7 @@ public void Constructor4() Assert.Null(cmd.Container); Assert.True(cmd.DesignTimeVisible); Assert.Null(cmd.Notification); -#if NET461 +#if NETFX // see https://github.com/dotnet/SqlClient/issues/17 Assert.True(cmd.NotificationAutoEnlist); #endif @@ -202,7 +202,7 @@ public void Constructor4() Assert.Null(cmd.Container); Assert.True(cmd.DesignTimeVisible); Assert.Null(cmd.Notification); -#if NET461 +#if NETFX // see https://github.com/dotnet/SqlClient/issues/17 Assert.True(cmd.NotificationAutoEnlist); #endif @@ -224,7 +224,7 @@ public void Clone() cmd.CommandType = CommandType.StoredProcedure; cmd.DesignTimeVisible = false; cmd.Notification = notificationReq; -#if NET461 +#if NETFX // see https://github.com/dotnet/SqlClient/issues/17 Assert.True(cmd.NotificationAutoEnlist); #endif @@ -240,7 +240,7 @@ public void Clone() Assert.Null(cmd.Connection); Assert.False(cmd.DesignTimeVisible); Assert.Same(notificationReq, cmd.Notification); -#if NET461 +#if NETFX // see https://github.com/dotnet/SqlClient/issues/17 Assert.True(cmd.NotificationAutoEnlist); #endif diff --git a/src/Microsoft.Data.SqlClient/tests/FunctionalTests/SqlExceptionTest.cs b/src/Microsoft.Data.SqlClient/tests/FunctionalTests/SqlExceptionTest.cs index 328f3643c2..3d749374ef 100644 --- a/src/Microsoft.Data.SqlClient/tests/FunctionalTests/SqlExceptionTest.cs +++ b/src/Microsoft.Data.SqlClient/tests/FunctionalTests/SqlExceptionTest.cs @@ -33,6 +33,7 @@ public void SerializationTest() Assert.Equal(e.StackTrace, sqlEx.StackTrace); } +#if !NET50_OR_LATER [Fact] [ActiveIssue("12161", TestPlatforms.AnyUnix)] public static void SqlExcpetionSerializationTest() @@ -53,6 +54,7 @@ public static void SqlExcpetionSerializationTest() } } } +#endif [Fact] public void JSONSerializationTest() diff --git a/src/Microsoft.Data.SqlClient/tests/ManualTests/AlwaysEncrypted/ConversionTests.cs b/src/Microsoft.Data.SqlClient/tests/ManualTests/AlwaysEncrypted/ConversionTests.cs index 202358c829..3746b9988c 100644 --- a/src/Microsoft.Data.SqlClient/tests/ManualTests/AlwaysEncrypted/ConversionTests.cs +++ b/src/Microsoft.Data.SqlClient/tests/ManualTests/AlwaysEncrypted/ConversionTests.cs @@ -67,7 +67,7 @@ public ConversionTests() certStoreProvider); databaseObjects.Add(columnEncryptionKey); - foreach(string connectionStr in DataTestUtility.AEConnStringsSetup) + foreach (string connectionStr in DataTestUtility.AEConnStringsSetup) { using (SqlConnection sqlConnection = new SqlConnection(connectionStr)) { @@ -1346,7 +1346,7 @@ private void SetParamSizeScalePrecision(ref SqlParameter param, ColumnMetaData c public void Dispose() { databaseObjects.Reverse(); - foreach(string connectionStr in DataTestUtility.AEConnStringsSetup) + foreach (string connectionStr in DataTestUtility.AEConnStringsSetup) { using (SqlConnection sqlConnection = new SqlConnection(connectionStr)) { @@ -1429,14 +1429,14 @@ public IEnumerator GetEnumerator() yield return new object[] { connStrAE, SqlDbType.DateTime2, SqlDbType.DateTime2 }; yield return new object[] { connStrAE, SqlDbType.DateTimeOffset, SqlDbType.DateTimeOffset }; yield return new object[] { connStrAE, SqlDbType.Float, SqlDbType.Float }; - yield return new object[] { connStrAE, SqlDbType.Real, SqlDbType.Real}; + yield return new object[] { connStrAE, SqlDbType.Real, SqlDbType.Real }; } } IEnumerator IEnumerable.GetEnumerator() => GetEnumerator(); } - + public class TestOutOfRangeValuesData : IEnumerable { public IEnumerator GetEnumerator() diff --git a/src/Microsoft.Data.SqlClient/tests/ManualTests/AlwaysEncrypted/CspProviderExt.cs b/src/Microsoft.Data.SqlClient/tests/ManualTests/AlwaysEncrypted/CspProviderExt.cs index 49dd608d99..ec635afd03 100644 --- a/src/Microsoft.Data.SqlClient/tests/ManualTests/AlwaysEncrypted/CspProviderExt.cs +++ b/src/Microsoft.Data.SqlClient/tests/ManualTests/AlwaysEncrypted/CspProviderExt.cs @@ -7,6 +7,9 @@ using System.Security.Cryptography.X509Certificates; using Microsoft.Data.SqlClient.ManualTesting.Tests.AlwaysEncrypted.Setup; using Xunit; +#if NET50_OR_LATER +using System.Runtime.Versioning; +#endif namespace Microsoft.Data.SqlClient.ManualTesting.Tests.AlwaysEncrypted { @@ -14,6 +17,9 @@ namespace Microsoft.Data.SqlClient.ManualTesting.Tests.AlwaysEncrypted /// Always Encrypted public CspProvider Manual tests. /// TODO: These tests are marked as Windows only for now but should be run for all platforms once the Master Key is accessible to this app from Azure Key Vault. /// +#if NET50_OR_LATER + [SupportedOSPlatform("windows")] +#endif [PlatformSpecific(TestPlatforms.Windows)] public class CspProviderExt { @@ -81,9 +87,10 @@ public void TestKeysFromCertificatesCreatedWithMultipleCryptoProviders(string co DatabaseHelper.InsertCustomerData(sqlConn, tableName, customer); // Test INPUT parameter on an encrypted parameter - using (SqlCommand sqlCommand = new SqlCommand(string.Format(@"SELECT CustomerId, FirstName, LastName FROM [{0}] WHERE FirstName = @firstName", tableName), + using (SqlCommand sqlCommand = new SqlCommand(@"SELECT CustomerId, FirstName, LastName FROM [@tableName] WHERE FirstName = @firstName", sqlConn, null, SqlCommandColumnEncryptionSetting.Enabled)) { + sqlCommand.Parameters.AddWithValue(@"tableName", tableName); SqlParameter customerFirstParam = sqlCommand.Parameters.AddWithValue(@"firstName", @"Microsoft"); customerFirstParam.Direction = System.Data.ParameterDirection.Input; @@ -173,9 +180,10 @@ public void TestEncryptDecryptWithCSP(string connectionString) DatabaseHelper.InsertCustomerData(sqlConn, tableName, customer); // Test INPUT parameter on an encrypted parameter - using (SqlCommand sqlCommand = new SqlCommand(string.Format(@"SELECT CustomerId, FirstName, LastName FROM [{0}] WHERE FirstName = @firstName", tableName), + using (SqlCommand sqlCommand = new SqlCommand(@"SELECT CustomerId, FirstName, LastName FROM [@tableName] WHERE FirstName = @firstName", sqlConn, null, SqlCommandColumnEncryptionSetting.Enabled)) { + sqlCommand.Parameters.AddWithValue(@"tableName", tableName); SqlParameter customerFirstParam = sqlCommand.Parameters.AddWithValue(@"firstName", @"Microsoft"); customerFirstParam.Direction = System.Data.ParameterDirection.Input; diff --git a/src/Microsoft.Data.SqlClient/tests/ManualTests/AlwaysEncrypted/TestFixtures/SQLSetupStrategy.cs b/src/Microsoft.Data.SqlClient/tests/ManualTests/AlwaysEncrypted/TestFixtures/SQLSetupStrategy.cs index 3b2c901e55..619c0b5930 100644 --- a/src/Microsoft.Data.SqlClient/tests/ManualTests/AlwaysEncrypted/TestFixtures/SQLSetupStrategy.cs +++ b/src/Microsoft.Data.SqlClient/tests/ManualTests/AlwaysEncrypted/TestFixtures/SQLSetupStrategy.cs @@ -272,17 +272,22 @@ public PlatformSpecificTestContext() { certStoreFixture = new SQLSetupStrategyCertStoreProvider(); } -#if !NET46 else { akvFixture = new SQLSetupStrategyAzureKeyVault(); } -#endif } public void Dispose() { - Fixture.Dispose(); + try + { + akvFixture?.Dispose(); + } + finally + { + certStoreFixture?.Dispose(); + } } } } diff --git a/src/Microsoft.Data.SqlClient/tests/ManualTests/AlwaysEncrypted/TestFixtures/Setup/CertificateUtility.cs b/src/Microsoft.Data.SqlClient/tests/ManualTests/AlwaysEncrypted/TestFixtures/Setup/CertificateUtility.cs index 7e32a4605d..1c054f3769 100644 --- a/src/Microsoft.Data.SqlClient/tests/ManualTests/AlwaysEncrypted/TestFixtures/Setup/CertificateUtility.cs +++ b/src/Microsoft.Data.SqlClient/tests/ManualTests/AlwaysEncrypted/TestFixtures/Setup/CertificateUtility.cs @@ -11,11 +11,9 @@ using System.Security.Cryptography; using System.Security.Cryptography.X509Certificates; using System.Threading.Tasks; -#if !NET46 using Azure; using Azure.Identity; using Azure.Security.KeyVault.Keys; -#endif namespace Microsoft.Data.SqlClient.ManualTesting.Tests.AlwaysEncrypted { class CertificateUtility @@ -133,10 +131,6 @@ internal static X509Certificate2 CreateCertificate() } } -#if NET46 - return certificate; - } -#else if (DataTestUtility.IsAKVSetupAvailable()) { SetupAKVKeysAsync().Wait(); @@ -179,7 +173,6 @@ private static async Task SetupAKVKeysAsync() keyClient.CreateRsaKey(rsaKeyOptions); } } -#endif /// /// Removes a certificate from the local certificate store (useful for test cleanup). diff --git a/src/Microsoft.Data.SqlClient/tests/ManualTests/AlwaysEncrypted/TestFixtures/Setup/CertificateUtilityWin.cs b/src/Microsoft.Data.SqlClient/tests/ManualTests/AlwaysEncrypted/TestFixtures/Setup/CertificateUtilityWin.cs index 05077e804e..91a0b6e7fb 100644 --- a/src/Microsoft.Data.SqlClient/tests/ManualTests/AlwaysEncrypted/TestFixtures/Setup/CertificateUtilityWin.cs +++ b/src/Microsoft.Data.SqlClient/tests/ManualTests/AlwaysEncrypted/TestFixtures/Setup/CertificateUtilityWin.cs @@ -7,9 +7,15 @@ using System.Security.Cryptography; using System.Security.Cryptography.X509Certificates; using Xunit; +#if NET50_OR_LATER +using System.Runtime.Versioning; +#endif namespace Microsoft.Data.SqlClient.ManualTesting.Tests.AlwaysEncrypted { +#if NET50_OR_LATER + [SupportedOSPlatform("windows")] +#endif [PlatformSpecific(TestPlatforms.Windows)] class CertificateUtilityWin { @@ -165,7 +171,6 @@ internal static X509Certificate2 GetCertificate(string certificateName, StoreLoc certStore.Open(OpenFlags.ReadOnly); X509Certificate2Collection certCollection = certStore.Certificates.Find(X509FindType.FindBySubjectName, certificateName, validOnly: false); Debug.Assert(certCollection != null && certCollection.Count > 0); - return certCollection[0]; } finally diff --git a/src/Microsoft.Data.SqlClient/tests/ManualTests/Microsoft.Data.SqlClient.ManualTesting.Tests.csproj b/src/Microsoft.Data.SqlClient/tests/ManualTests/Microsoft.Data.SqlClient.ManualTesting.Tests.csproj index 33c6d606d2..dbea157770 100644 --- a/src/Microsoft.Data.SqlClient/tests/ManualTests/Microsoft.Data.SqlClient.ManualTesting.Tests.csproj +++ b/src/Microsoft.Data.SqlClient/tests/ManualTests/Microsoft.Data.SqlClient.ManualTesting.Tests.csproj @@ -2,41 +2,44 @@ {45DB5F86-7AE3-45C6-870D-F9357B66BDB5} ManualTests - netcoreapp netfx + netcoreapp + $(OS) + true + true false Microsoft.Data.SqlClient.ManualTesting.Tests.ruleset Debug;Release;net461-Release;net461-Debug;netcoreapp2.1-Debug;netcoreapp2.1-Release;netcoreapp3.1-Debug;netcoreapp3.1-Release AnyCPU;x86;x64 $(DefineConstants);NETCOREAPP $(DefineConstants);NETFRAMEWORK + $(DefineConstants);NET50_OR_LATER $(ObjFolder)$(Configuration).$(Platform).$(AssemblyName) $(BinFolder)$(Configuration).$(Platform).$(AssemblyName) - - - - - - - - - - - - - - + + + + + + - + + + + + + + + @@ -59,7 +62,7 @@ - + Common\System\Collections\DictionaryExtensions.cs diff --git a/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/Common/AsyncDebugScope.cs b/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/Common/AsyncDebugScope.cs index fc4c312123..520081e435 100644 --- a/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/Common/AsyncDebugScope.cs +++ b/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/Common/AsyncDebugScope.cs @@ -88,6 +88,7 @@ public void Dispose() { _reader.CompletePendingReadWithSuccess(true); } + _reader.Dispose(); } if (_command != null) @@ -100,6 +101,7 @@ public void Dispose() { _command.CompletePendingReadWithSuccess(true); } + _command.Dispose(); } } } diff --git a/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/ConnectivityTests/AADConnectionTest.cs b/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/ConnectivityTests/AADConnectionTest.cs index a6bad7954f..8036f5aaf6 100644 --- a/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/ConnectivityTests/AADConnectionTest.cs +++ b/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/ConnectivityTests/AADConnectionTest.cs @@ -184,28 +184,21 @@ public static void GetAccessTokenByPasswordTest() public static void testADPasswordAuthentication() { // Connect to Azure DB with password and retrieve user name. - try + using (SqlConnection conn = new SqlConnection(DataTestUtility.AADPasswordConnectionString)) { - using (SqlConnection conn = new SqlConnection(DataTestUtility.AADPasswordConnectionString)) + conn.Open(); + using (SqlCommand sqlCommand = new SqlCommand + ( + cmdText: $"SELECT SUSER_SNAME();", + connection: conn, + transaction: null + )) { - conn.Open(); - using (SqlCommand sqlCommand = new SqlCommand - ( - cmdText: $"SELECT SUSER_SNAME();", - connection: conn, - transaction: null - )) - { - string customerId = (string)sqlCommand.ExecuteScalar(); - string expected = DataTestUtility.RetrieveValueFromConnStr(DataTestUtility.AADPasswordConnectionString, new string[] { "User ID", "UID" }); - Assert.Equal(expected, customerId); - } + string customerId = (string)sqlCommand.ExecuteScalar(); + string expected = DataTestUtility.RetrieveValueFromConnStr(DataTestUtility.AADPasswordConnectionString, new string[] { "User ID", "UID" }); + Assert.Equal(expected, customerId); } } - catch (SqlException e) - { - throw e; - } } [ConditionalFact(nameof(IsAADConnStringsSetup))] diff --git a/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/ConnectivityTests/ConnectivityTest.cs b/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/ConnectivityTests/ConnectivityTest.cs index 3e338a3b1e..85f4f94917 100644 --- a/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/ConnectivityTests/ConnectivityTest.cs +++ b/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/ConnectivityTests/ConnectivityTest.cs @@ -146,7 +146,7 @@ public static void LocalProcessIdTest() } } } - public class ConnectionWorker + public class ConnectionWorker : IDisposable { private static List workerList = new List(); private ManualResetEventSlim _doneEvent = new ManualResetEventSlim(false); @@ -183,6 +183,11 @@ public static void Stop() } } + public void Dispose() + { + _doneEvent.Dispose(); + } + public void SqlConnectionOpen() { Stopwatch sw = new Stopwatch(); diff --git a/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/DataStreamTest/DataStreamTest.cs b/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/DataStreamTest/DataStreamTest.cs index 2dc5dfcb89..a5b67acdd5 100644 --- a/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/DataStreamTest/DataStreamTest.cs +++ b/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/DataStreamTest/DataStreamTest.cs @@ -2009,11 +2009,11 @@ private static void TimeoutDuringReadAsyncWithClosedReaderTest(string connection } proxy.Stop(); } - catch (SqlException ex) + catch (SqlException) { // In case of error, stop the proxy and dump its logs (hopefully this will help with debugging proxy.Stop(); - throw ex; + throw; } } diff --git a/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/RandomStressTest/RandomStressTest.cs b/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/RandomStressTest/RandomStressTest.cs index 75b2a55119..3bed4b5e12 100644 --- a/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/RandomStressTest/RandomStressTest.cs +++ b/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/RandomStressTest/RandomStressTest.cs @@ -12,7 +12,7 @@ namespace Microsoft.Data.SqlClient.ManualTesting.Tests { - public class RandomStressTest + public class RandomStressTest : IDisposable { private static readonly TimeSpan TimeLimitDefault = new TimeSpan(0, 0, 10); private const int ThreadCountDefault = 4; @@ -359,6 +359,11 @@ private void RunTestIteration(SqlConnection con, SqlRandomizer rand, SqlRandomTa } } } + + public void Dispose() + { + _endEvent?.Dispose(); + } } } diff --git a/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/RandomStressTest/Randomizer.cs b/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/RandomStressTest/Randomizer.cs index b057ae812c..a03f145660 100644 --- a/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/RandomStressTest/Randomizer.cs +++ b/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/RandomStressTest/Randomizer.cs @@ -237,18 +237,6 @@ protected static int DeserializeInt(byte[] buf, ref int offset) return unchecked((int)uval); } - - /// - /// deserialization constructor - /// - public Randomizer(StreamingContext context) - { - string base64State = GetCurrentState().ToString(); - int offset; - Deserialize(Convert.FromBase64String(base64State), out offset); - } - - /// /// use this method to create seeds for nested randomizers out of current one /// diff --git a/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/RandomStressTest/RandomizerPool.cs b/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/RandomStressTest/RandomizerPool.cs index 84593e2597..c90779cd75 100644 --- a/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/RandomStressTest/RandomizerPool.cs +++ b/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/RandomStressTest/RandomizerPool.cs @@ -4,6 +4,7 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.IO; using System.Threading; @@ -282,13 +283,10 @@ public void Dispose() { _current = null; - if (t_currentScope != this) - { - // every creation of scope in test must be balanced with Dispose call, use 'using' to enforce that! - // nested scopes are allowed, child scope must be disposed before the parent one - throw new InvalidOperationException("Unbalanced call to scope.Dispose"); - } - + // every creation of scope in test must be balanced with Dispose call, use 'using' to enforce that! + // nested scopes are allowed, child scope must be disposed before the parent one + // throw new InvalidOperationException("Unbalanced call to scope.Dispose"); + Trace.Assert(t_currentScope == this, "Unbalanced call to scope.Dispose"); t_currentScope = _previousScope; } } diff --git a/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/SqlNotificationTest/SqlNotificationTest.cs b/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/SqlNotificationTest/SqlNotificationTest.cs index c8b42a052f..5cf1e99e93 100644 --- a/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/SqlNotificationTest/SqlNotificationTest.cs +++ b/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/SqlNotificationTest/SqlNotificationTest.cs @@ -146,8 +146,8 @@ public void Test_SingleDependency_AllDefaults_SqlAuth() try { // create a new event every time to avoid mixing notification callbacks - ManualResetEvent notificationReceived = new ManualResetEvent(false); - ManualResetEvent updateCompleted = new ManualResetEvent(false); + ManualResetEventSlim notificationReceived = new ManualResetEventSlim(false); + ManualResetEventSlim updateCompleted = new ManualResetEventSlim(false); using (SqlConnection conn = new SqlConnection(_execConnectionString)) using (SqlCommand cmd = new SqlCommand("SELECT a, b, c FROM " + _tableName, conn)) @@ -157,7 +157,7 @@ public void Test_SingleDependency_AllDefaults_SqlAuth() SqlDependency dep = new SqlDependency(cmd); dep.OnChange += delegate (object o, SqlNotificationEventArgs arg) { - Assert.True(updateCompleted.WaitOne(CALLBACK_TIMEOUT, false), "Received notification, but update did not complete."); + Assert.True(updateCompleted.Wait(CALLBACK_TIMEOUT), "Received notification, but update did not complete."); DataTestUtility.AssertEqualsWithDescription(SqlNotificationType.Change, arg.Type, "Unexpected Type value."); DataTestUtility.AssertEqualsWithDescription(SqlNotificationInfo.Update, arg.Info, "Unexpected Info value."); @@ -174,7 +174,7 @@ public void Test_SingleDependency_AllDefaults_SqlAuth() updateCompleted.Set(); - Assert.True(notificationReceived.WaitOne(CALLBACK_TIMEOUT, false), "Notification not received within the timeout period"); + Assert.True(notificationReceived.Wait(CALLBACK_TIMEOUT), "Notification not received within the timeout period"); } finally { @@ -190,8 +190,8 @@ public void Test_SingleDependency_CustomQueue_SqlAuth() try { // create a new event every time to avoid mixing notification callbacks - ManualResetEvent notificationReceived = new ManualResetEvent(false); - ManualResetEvent updateCompleted = new ManualResetEvent(false); + ManualResetEventSlim notificationReceived = new ManualResetEventSlim(false); + ManualResetEventSlim updateCompleted = new ManualResetEventSlim(false); using (SqlConnection conn = new SqlConnection(_execConnectionString)) using (SqlCommand cmd = new SqlCommand("SELECT a, b, c FROM " + _tableName, conn)) @@ -201,7 +201,7 @@ public void Test_SingleDependency_CustomQueue_SqlAuth() SqlDependency dep = new SqlDependency(cmd, "service=" + _serviceName + ";local database=msdb", 0); dep.OnChange += delegate (object o, SqlNotificationEventArgs args) { - Assert.True(updateCompleted.WaitOne(CALLBACK_TIMEOUT, false), "Received notification, but update did not complete."); + Assert.True(updateCompleted.Wait(CALLBACK_TIMEOUT), "Received notification, but update did not complete."); Console.WriteLine("7 Notification callback. Type={0}, Info={1}, Source={2}", args.Type, args.Info, args.Source); notificationReceived.Set(); @@ -215,7 +215,7 @@ public void Test_SingleDependency_CustomQueue_SqlAuth() updateCompleted.Set(); - Assert.False(notificationReceived.WaitOne(CALLBACK_TIMEOUT, false), "Notification should not be received."); + Assert.False(notificationReceived.Wait(CALLBACK_TIMEOUT), "Notification should not be received."); } finally { @@ -241,7 +241,7 @@ public void Test_SingleDependency_Timeout() const int maxTimeoutEventInterval = testTimeSeconds + SqlDependencyTimerResolution + 1; // create a new event every time to avoid mixing notification callbacks - ManualResetEvent notificationReceived = new ManualResetEvent(false); + ManualResetEventSlim notificationReceived = new ManualResetEventSlim(false); DateTime startUtcTime; using (SqlConnection conn = new SqlConnection(_execConnectionString)) @@ -272,7 +272,7 @@ public void Test_SingleDependency_Timeout() } Assert.True( - notificationReceived.WaitOne(TimeSpan.FromSeconds(maxTimeoutEventInterval), false), + notificationReceived.Wait(TimeSpan.FromSeconds(maxTimeoutEventInterval)), string.Format("Notification not received within the maximum timeout period of {0} seconds", maxTimeoutEventInterval)); // notification received in time, check that it is not too early diff --git a/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/UdtTest/UDTs/Address/Address.csproj b/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/UdtTest/UDTs/Address/Address.csproj index 1e1ad8e304..b40e267154 100644 --- a/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/UdtTest/UDTs/Address/Address.csproj +++ b/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/UdtTest/UDTs/Address/Address.csproj @@ -3,8 +3,8 @@ Address Address {D1392B54-998A-4F27-BC17-4CE149117BCC} - netcoreapp - netfx + netfx + netcoreapp AnyCPU;x86;x64 Debug;Release;net461-Release;net461-Debug;netcoreapp2.1-Debug;netcoreapp2.1-Release;netcoreapp3.1-Debug;netcoreapp3.1-Release $(ObjFolder)$(Configuration).$(Platform)\$(AssemblyName) diff --git a/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/UdtTest/UDTs/Circle/Circle.csproj b/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/UdtTest/UDTs/Circle/Circle.csproj index e962472cf1..2e61c5385d 100644 --- a/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/UdtTest/UDTs/Circle/Circle.csproj +++ b/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/UdtTest/UDTs/Circle/Circle.csproj @@ -3,8 +3,8 @@ Circle Circle {6C88F00F-9597-43AD-9E5F-9B344DA3B16F} - netcoreapp - netfx + netfx + netcoreapp AnyCPU;x86;x64 Debug;Release;net461-Release;net461-Debug;netcoreapp2.1-Debug;netcoreapp2.1-Release;netcoreapp3.1-Debug;netcoreapp3.1-Release $(ObjFolder)$(Configuration).$(Platform)\$(AssemblyName) diff --git a/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/UdtTest/UDTs/Shapes/Shapes.csproj b/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/UdtTest/UDTs/Shapes/Shapes.csproj index fbcf7d8b7c..6d6e2a4439 100644 --- a/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/UdtTest/UDTs/Shapes/Shapes.csproj +++ b/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/UdtTest/UDTs/Shapes/Shapes.csproj @@ -3,8 +3,8 @@ Shapes Shapes {B73A7063-37C3-415D-AD53-BB3DA20ABD6E} - netcoreapp netfx + netcoreapp Debug;Release;net461-Release;net461-Debug;netcoreapp2.1-Debug;netcoreapp2.1-Release;netcoreapp3.1-Debug;netcoreapp3.1-Release AnyCPU;x86;x64 $(ObjFolder)$(Configuration).$(Platform)\$(AssemblyName) diff --git a/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/UdtTest/UDTs/Utf8String/Utf8String.csproj b/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/UdtTest/UDTs/Utf8String/Utf8String.csproj index ff7b3dcc88..66e4c73a9b 100644 --- a/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/UdtTest/UDTs/Utf8String/Utf8String.csproj +++ b/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/UdtTest/UDTs/Utf8String/Utf8String.csproj @@ -3,8 +3,8 @@ Utf8String Utf8String {E0A6BB21-574B-43D9-890D-6E1144F2EE9E} - netcoreapp netfx + netcoreapp Debug;Release;net461-Release;net461-Debug;netcoreapp2.1-Debug;netcoreapp2.1-Release;netcoreapp3.1-Debug;netcoreapp3.1-Release AnyCPU;x86;x64 $(ObjFolder)$(Configuration).$(Platform)\$(AssemblyName) diff --git a/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/UdtTest/UdtTest.cs b/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/UdtTest/UdtTest.cs index fd56a4d80b..666b7bd258 100644 --- a/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/UdtTest/UdtTest.cs +++ b/src/Microsoft.Data.SqlClient/tests/ManualTests/SQL/UdtTest/UdtTest.cs @@ -292,13 +292,17 @@ public void NullTest() } catch (SqlException e) { - if(e.Message.Contains("Rerun the transaction")) + if (e.Message.Contains("Rerun the transaction")) + { rerun = true; - else - throw e; + } + else + { + throw; + } } } - while(rerun); + while (rerun); } } } diff --git a/src/Microsoft.Data.SqlClient/tests/tools/Microsoft.Data.SqlClient.ExtUtilities/Microsoft.Data.SqlClient.ExtUtilities.csproj b/src/Microsoft.Data.SqlClient/tests/tools/Microsoft.Data.SqlClient.ExtUtilities/Microsoft.Data.SqlClient.ExtUtilities.csproj index 614ab2d91e..a545d8e533 100644 --- a/src/Microsoft.Data.SqlClient/tests/tools/Microsoft.Data.SqlClient.ExtUtilities/Microsoft.Data.SqlClient.ExtUtilities.csproj +++ b/src/Microsoft.Data.SqlClient/tests/tools/Microsoft.Data.SqlClient.ExtUtilities/Microsoft.Data.SqlClient.ExtUtilities.csproj @@ -1,7 +1,7 @@  Exe - netcoreapp3.1 + netcoreapp3.1;net5.0 Microsoft.Data.SqlClient.ExtUtilities.Runner