diff --git a/.ci/windows/testnet461.bat b/.ci/windows/testnet461.bat index ffea417d2..fe19a4d93 100644 --- a/.ci/windows/testnet461.bat +++ b/.ci/windows/testnet461.bat @@ -2,9 +2,9 @@ :: This script runs the tests and stored them in an xml file defined in the :: LogFilePath property :: -dotnet publish -c Release test\Elastic.Apm.Tests --framework net461 --property:PublishDir=..\..\outtestnet461 +dotnet publish -c Release test\Elastic.Apm.Tests --framework net462 --property:PublishDir=..\..\outtestnet462 -dotnet test outtestnet461\Elastic.Apm.Tests.dll ^ +dotnet test outtestnet462\Elastic.Apm.Tests.dll ^ --logger:"junit;LogFilePath=test\junit-{framework}-{assembly}.xml;MethodFormat=Class;FailureBodyFormat=Verbose" ^ --blame-hang ^ --blame-hang-timeout 10m diff --git a/.github/.github.csproj b/.github/.github.csproj new file mode 100644 index 000000000..e0a99f709 --- /dev/null +++ b/.github/.github.csproj @@ -0,0 +1,7 @@ + + + net7.0 + False + + + diff --git a/.github/ISSUE_TEMPLATE/Bug_report.md b/.github/ISSUE_TEMPLATE/Bug_report.md index 46c1b0271..1bff68f56 100644 --- a/.github/ISSUE_TEMPLATE/Bug_report.md +++ b/.github/ISSUE_TEMPLATE/Bug_report.md @@ -24,9 +24,9 @@ The version of the `Elastic.Apm` nuget package used **Operating system and version:** -**.NET Framework/Core name and version** (e.g. .NET 4.6.1, NET Core 3.1.100) : +**.NET Framework/Core name and version** (e.g. .NET 4.6.2, NET Core 3.1.100) : -**Application Target Framework(s)** (e.g. net461, netcoreapp3.1): +**Application Target Framework(s)** (e.g. net462, netcoreapp3.1): ### Describe the bug A clear and concise description of what the bug is. diff --git a/.github/workflows/bootstrap/action.yml b/.github/workflows/bootstrap/action.yml new file mode 100644 index 000000000..0ad423fa6 --- /dev/null +++ b/.github/workflows/bootstrap/action.yml @@ -0,0 +1,33 @@ +--- +name: Bootstrap Checkout +description: Ensures an action that needs to build has access to git tags + +runs: + using: "composite" + steps: + # Ensure we fetch all tags + - shell: bash + run: | + git fetch --prune --unshallow --tags + git tag --list + + # Install .NET version as mandated by global.json + #- uses: actions/setup-dotnet@v3 + # with: + # global-json-file: global.json + + - name: Setup dotnet + uses: actions/setup-dotnet@v3 + with: + dotnet-version: | + 3.1.100 + 5.0.100 + 6.0.100 + 7.0.100 + - shell: bash + run: | + dotnet --list-sdks + + + # Setup git config + - uses: elastic/apm-pipeline-library/.github/actions/setup-git@current \ No newline at end of file diff --git a/.github/workflows/test-iis.yml b/.github/workflows/test-iis.yml new file mode 100644 index 000000000..846c7ae9a --- /dev/null +++ b/.github/workflows/test-iis.yml @@ -0,0 +1,101 @@ +name: test-iis + +on: + push: + branches: + - main + - 1.* + paths-ignore: + - '*.md' + - '*.asciidoc' + - 'docs/**' + pull_request: + paths-ignore: + - '*.md' + - '*.asciidoc' + - 'docs/**' + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} + +env: + ELASTIC_STACK_VERSION: '8.4.0' + +jobs: + + test-iis: + runs-on: windows-latest + + steps: + - uses: actions/checkout@v3 + - name: Bootstrap Action Workspace + uses: ./.github/workflows/bootstrap + + - uses: actions/cache@v3 + with: + path: ~/.nuget/packages + key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }} + restore-keys: | + ${{ runner.os }}-nuget- + - name: Add msbuild to PATH + uses: microsoft/setup-msbuild@v1.3.1 + + #- name: Setup VS Dev Environment + # uses: seanmiddleditch/gha-setup-vsdevenv@v4 + + #- name: Restore NuGet Packages + # run: msbuild /t:Restore + + - name: Build the application + shell: cmd + run: | + msbuild ^ + /p:EnforceCodeStyleInBuild=false /p:_SkipUpgradeNetAnalyzersNuGetWarning=true /p:EnableNETAnalyzers=false ^ + -clp:ForceConsoleColor -clp:Summary -verbosity:minimal ^ + /t:Build /p:Configuration=Release /restore + #- name: Discover Windows Features + # shell: cmd + # run: | + # DISM /online /get-features /format:table + + # TODO See if this really needed + - name: Enable Windows Features + shell: cmd + run: | + DISM /online /enable-feature /featurename:IIS-HttpErrors + DISM /online /enable-feature /featurename:IIS-HttpRedirect + + - name: Ensure AppPool Permissions + shell: cmd + run: | + REM enable permissions for the Application Pool Identity group + icacls %cd% /t /q /grant "IIS_IUSRS:(OI)(CI)(IO)(RX)" + REM enable permissions for the anonymous access group + icacls %cd% /t /q /grant "IUSR:(OI)(CI)(IO)(RX)" + + - name: Run tests + shell: cmd + run: | + set ELASTIC_APM_TESTS_FULL_FRAMEWORK_ENABLED=true + set sample_app_log_dir=C:\Elastic_APM_TEMP + if not exist "%sample_app_log_dir%" mkdir "%sample_app_log_dir%" + icacls %sample_app_log_dir% /t /q /grant Everyone:F + set ELASTIC_APM_ASP_NET_FULL_FRAMEWORK_SAMPLE_APP_LOG_FILE=%sample_app_log_dir%\Elastic.Apm.AspNetFullFramework.Tests.SampleApp.log + + dotnet test -c Release test\Elastic.Apm.AspNetFullFramework.Tests --no-build ^ + --verbosity normal ^ + --results-directory build/output ^ + --diag build/output/diag-iis.log ^ + --filter "FullyQualifiedName=Elastic.Apm.AspNetFullFramework.Tests.CustomServiceNodeNameSetViaSettings.Test" ^ + --logger:"junit;LogFilePath=build/output/junit-{framework}-{assembly}.xml;MethodFormat=Class;FailureBodyFormat=Verbose" + + - name: Store test results + if: success() || failure() + uses: actions/upload-artifact@v3 + with: + name: test-results + path: build/output/junit-*.xml \ No newline at end of file diff --git a/Directory.Build.props b/Directory.Build.props index 1c2b53147..09b75b095 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -15,6 +15,6 @@ false - + \ No newline at end of file diff --git a/ElasticApmAgent.sln b/ElasticApmAgent.sln index 02e3c3d70..ef49eb94d 100644 --- a/ElasticApmAgent.sln +++ b/ElasticApmAgent.sln @@ -193,6 +193,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Elastic.Clients.Elasticsear EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "elastic_apm_profiler", "src\elastic_apm_profiler\elastic_apm_profiler.csproj", "{236B392A-53BE-46FD-9831-C66AE0A962F1}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = ".github", ".github\.github.csproj", "{A880940E-31FC-4934-80FC-5A9E3DFED7CA}" +EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sample.Microsoft.Data.SqlClient", "sample\Sample.Microsoft.Data.SqlClient\Sample.Microsoft.Data.SqlClient.csproj", "{BCE93684-0A40-4F5F-8FB5-94DE94B111E1}" EndProject Global @@ -507,6 +509,10 @@ Global {E6217549-8C21-4E95-BDF2-E782922CD104}.Release|Any CPU.Build.0 = Release|Any CPU {236B392A-53BE-46FD-9831-C66AE0A962F1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {236B392A-53BE-46FD-9831-C66AE0A962F1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A880940E-31FC-4934-80FC-5A9E3DFED7CA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {A880940E-31FC-4934-80FC-5A9E3DFED7CA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {A880940E-31FC-4934-80FC-5A9E3DFED7CA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {A880940E-31FC-4934-80FC-5A9E3DFED7CA}.Release|Any CPU.Build.0 = Release|Any CPU {BCE93684-0A40-4F5F-8FB5-94DE94B111E1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {BCE93684-0A40-4F5F-8FB5-94DE94B111E1}.Debug|Any CPU.Build.0 = Debug|Any CPU {BCE93684-0A40-4F5F-8FB5-94DE94B111E1}.Release|Any CPU.ActiveCfg = Release|Any CPU diff --git a/Jenkinsfile b/Jenkinsfile index 7d578a540..7aad3ee43 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -67,101 +67,6 @@ pipeline { } } parallel{ - stage('Windows .NET Framework'){ - agent { label 'windows-2019 && immutable' } - options { skipDefaultCheckout() } - environment { - HOME = "${env.WORKSPACE}" - DOTNET_ROOT = "${env.WORKSPACE}\\dotnet" - PATH = "${env.DOTNET_ROOT};${env.DOTNET_ROOT}\\tools;${env.PATH};${env.HOME}\\bin" - MSBUILDDEBUGPATH = "${env.WORKSPACE}" - } - stages{ - /** - Install the required tools - */ - stage('Install tools') { - steps { - cleanDir("${WORKSPACE}/*") - unstash 'source' - dir("${HOME}"){ - powershell label: 'Install tools', script: "${BASE_DIR}\\.ci\\windows\\tools.ps1" - powershell label: 'Install msbuild tools', script: "${BASE_DIR}\\.ci\\windows\\msbuild-tools.ps1" - } - } - } - /** - Build the project from code.. - */ - stage('Build - MSBuild') { - steps { - withGithubNotify(context: 'Build MSBuild - Windows') { - cleanDir("${WORKSPACE}/${BASE_DIR}") - unstash 'source' - dir("${BASE_DIR}"){ - bat '.ci/windows/msbuild.bat' - } - } - } - post { - unsuccessful { - archiveArtifacts(allowEmptyArchive: true, - artifacts: "${MSBUILDDEBUGPATH}/**/MSBuild_*.failure.txt") - } - } - } - /** - Execute unit tests. - */ - stage('Test') { - steps { - withGithubNotify(context: 'Test MSBuild - Windows', tab: 'tests') { - cleanDir("${WORKSPACE}/${BASE_DIR}") - unstash 'source' - dir("${BASE_DIR}"){ - powershell label: 'Install test tools', script: '.ci\\windows\\test-tools.ps1' - bat label: 'Test & coverage', script: '.ci/windows/testnet461.bat' - } - } - } - post { - always { - reportTests() - } - unsuccessful { - archiveArtifacts(allowEmptyArchive: true, - artifacts: "${MSBUILDDEBUGPATH}/**/MSBuild_*.failure.txt") - } - } - } - /** - Execute IIS tests. - */ - stage('IIS Tests') { - steps { - withGithubNotify(context: 'IIS Tests', tab: 'tests') { - cleanDir("${WORKSPACE}/${BASE_DIR}") - unstash 'source' - dir("${BASE_DIR}"){ - powershell label: 'Install test tools', script: '.ci\\windows\\test-tools.ps1' - bat label: 'Build', script: '.ci/windows/msbuild.bat' - bat label: 'Test IIS', script: '.ci/windows/test-iis.bat' - } - } - } - post { - always { - reportTests() - } - } - } - } - post { - always { - cleanWs(disableDeferredWipeout: true, notFailBuild: true) - } - } - } stage('Windows .NET Core'){ agent { label 'windows-2019 && immutable' } options { skipDefaultCheckout() } diff --git a/sample/ApiSamples/ApiSamples.csproj b/sample/ApiSamples/ApiSamples.csproj index 08a8875de..1c4663848 100644 --- a/sample/ApiSamples/ApiSamples.csproj +++ b/sample/ApiSamples/ApiSamples.csproj @@ -2,7 +2,7 @@ Exe - net461;net7.0 + net462;net7.0 false diff --git a/sample/AspNetFullFrameworkSampleApp/AspNetFullFrameworkSampleApp.csproj b/sample/AspNetFullFrameworkSampleApp/AspNetFullFrameworkSampleApp.csproj index 7948d2051..97449afab 100644 --- a/sample/AspNetFullFrameworkSampleApp/AspNetFullFrameworkSampleApp.csproj +++ b/sample/AspNetFullFrameworkSampleApp/AspNetFullFrameworkSampleApp.csproj @@ -1,21 +1,21 @@  - + - true - false + true + true + false false true - + <_ValidProjectsForRestore Include="$(MSBuildProjectFullPath)" /> - + - + - + diff --git a/src/Elastic.Apm.Specification/Elastic.Apm.Specification.csproj b/src/Elastic.Apm.Specification/Elastic.Apm.Specification.csproj index 28eb9def2..d89565852 100644 --- a/src/Elastic.Apm.Specification/Elastic.Apm.Specification.csproj +++ b/src/Elastic.Apm.Specification/Elastic.Apm.Specification.csproj @@ -1,7 +1,7 @@ - netstandard2.0;net461 + netstandard2.0;net462 false diff --git a/src/Elastic.Apm.SqlClient/Elastic.Apm.SqlClient.csproj b/src/Elastic.Apm.SqlClient/Elastic.Apm.SqlClient.csproj index e1ed632c4..cb71935b9 100644 --- a/src/Elastic.Apm.SqlClient/Elastic.Apm.SqlClient.csproj +++ b/src/Elastic.Apm.SqlClient/Elastic.Apm.SqlClient.csproj @@ -5,7 +5,7 @@ Elastic.Apm.SqlClient Elastic APM for System.Data.SqlClient and Microsoft.Data.SqlClient. This package contains auto instrumentation for SqlClient. See: https://github.com/elastic/apm-agent-dotnet/tree/main/docs apm, monitoring, elastic, elasticapm, analytics, sqlclient - net461;netstandard2.0 + net462;netstandard2.0 true diff --git a/src/Elastic.Apm/Elastic.Apm.csproj b/src/Elastic.Apm/Elastic.Apm.csproj index 575bb6e9c..99f73ff4b 100644 --- a/src/Elastic.Apm/Elastic.Apm.csproj +++ b/src/Elastic.Apm/Elastic.Apm.csproj @@ -1,6 +1,6 @@  - netstandard2.0;net461;net6.0 + netstandard2.0;net462;net6.0 true @@ -86,11 +86,11 @@ - + $(DefineConstants);HAVE_ADO_NET;HAVE_APP_DOMAIN;HAVE_ASYNC;HAVE_BIG_INTEGER;HAVE_BINARY_FORMATTER;HAVE_BINARY_SERIALIZATION;HAVE_BINARY_EXCEPTION_SERIALIZATION;HAVE_CAS;HAVE_CHAR_TO_LOWER_WITH_CULTURE;HAVE_CHAR_TO_STRING_WITH_CULTURE;HAVE_COM_ATTRIBUTES;HAVE_COMPONENT_MODEL;HAVE_CONCURRENT_COLLECTIONS;HAVE_CONCURRENT_DICTIONARY;HAVE_COVARIANT_GENERICS;HAVE_DATE_TIME_OFFSET;HAVE_DATA_CONTRACTS;HAVE_DB_NULL_TYPE_CODE;HAVE_DYNAMIC;HAVE_EMPTY_TYPES;HAVE_ENTITY_FRAMEWORK;HAVE_EXPRESSIONS;HAVE_FAST_REVERSE;HAVE_FSHARP_TYPES;HAVE_FULL_REFLECTION;HAVE_GUID_TRY_PARSE;HAVE_HASH_SET;HAVE_ICLONEABLE;HAVE_ICONVERTIBLE;HAVE_INOTIFY_COLLECTION_CHANGED;HAVE_INOTIFY_PROPERTY_CHANGING;HAVE_ISET;HAVE_LINQ;HAVE_MEMORY_BARRIER;HAVE_METHOD_IMPL_ATTRIBUTE;HAVE_NON_SERIALIZED_ATTRIBUTE;HAVE_READ_ONLY_COLLECTIONS;HAVE_REFLECTION_EMIT;HAVE_SECURITY_SAFE_CRITICAL_ATTRIBUTE;HAVE_SERIALIZATION_BINDER_BIND_TO_NAME;HAVE_STREAM_READER_WRITER_CLOSE;HAVE_STRING_JOIN_WITH_ENUMERABLE;HAVE_TIME_SPAN_PARSE_WITH_CULTURE;HAVE_TIME_SPAN_TO_STRING_WITH_CULTURE;HAVE_TIME_ZONE_INFO;HAVE_TRACE_WRITER;HAVE_TYPE_DESCRIPTOR;HAVE_UNICODE_SURROGATE_DETECTION;HAVE_VARIANT_TYPE_PARAMETERS;HAVE_VERSION_TRY_PARSE;HAVE_XML_DOCUMENT;HAVE_XML_DOCUMENT_TYPE - + $(DefineConstants);HAVE_ADO_NET;HAVE_APP_DOMAIN;HAVE_ASYNC;HAVE_BIG_INTEGER;HAVE_BINARY_FORMATTER;HAVE_BINARY_SERIALIZATION;HAVE_BINARY_EXCEPTION_SERIALIZATION;HAVE_CHAR_TO_LOWER_WITH_CULTURE;HAVE_CHAR_TO_STRING_WITH_CULTURE;HAVE_COM_ATTRIBUTES;HAVE_COMPONENT_MODEL;HAVE_CONCURRENT_COLLECTIONS;HAVE_CONCURRENT_DICTIONARY;HAVE_COVARIANT_GENERICS;HAVE_DATE_TIME_OFFSET;HAVE_DATA_CONTRACTS;HAVE_DB_NULL_TYPE_CODE;HAVE_DYNAMIC;HAVE_EMPTY_TYPES;HAVE_ENTITY_FRAMEWORK;HAVE_EXPRESSIONS;HAVE_FAST_REVERSE;HAVE_FSHARP_TYPES;HAVE_FULL_REFLECTION;HAVE_GUID_TRY_PARSE;HAVE_HASH_SET;HAVE_ICLONEABLE;HAVE_ICONVERTIBLE;HAVE_INOTIFY_COLLECTION_CHANGED;HAVE_INOTIFY_PROPERTY_CHANGING;HAVE_ISET;HAVE_LINQ;HAVE_MEMORY_BARRIER;HAVE_METHOD_IMPL_ATTRIBUTE;HAVE_NON_SERIALIZED_ATTRIBUTE;HAVE_READ_ONLY_COLLECTIONS;HAVE_SECURITY_SAFE_CRITICAL_ATTRIBUTE;HAVE_SERIALIZATION_BINDER_BIND_TO_NAME;HAVE_STREAM_READER_WRITER_CLOSE;HAVE_STRING_JOIN_WITH_ENUMERABLE;HAVE_TIME_SPAN_PARSE_WITH_CULTURE;HAVE_TIME_SPAN_TO_STRING_WITH_CULTURE;HAVE_TIME_ZONE_INFO;HAVE_TRACE_WRITER;HAVE_TYPE_DESCRIPTOR;HAVE_UNICODE_SURROGATE_DETECTION;HAVE_VARIANT_TYPE_PARAMETERS;HAVE_VERSION_TRY_PARSE;HAVE_XML_DOCUMENT;HAVE_XML_DOCUMENT_TYPE diff --git a/src/Elastic.Apm/Libraries/Newtonsoft.Json/Serialization/DynamicValueProvider.cs b/src/Elastic.Apm/Libraries/Newtonsoft.Json/Serialization/DynamicValueProvider.cs index 1f2287686..da193fb3a 100644 --- a/src/Elastic.Apm/Libraries/Newtonsoft.Json/Serialization/DynamicValueProvider.cs +++ b/src/Elastic.Apm/Libraries/Newtonsoft.Json/Serialization/DynamicValueProvider.cs @@ -25,7 +25,7 @@ #endregion -#if NET461 +#if NET462 using System; using System.Collections.Generic; #if !HAVE_LINQ diff --git a/src/Elastic.Apm/Libraries/Newtonsoft.Json/Utilities/DynamicReflectionDelegateFactory.cs b/src/Elastic.Apm/Libraries/Newtonsoft.Json/Utilities/DynamicReflectionDelegateFactory.cs index f8be3d735..b2bfe230d 100644 --- a/src/Elastic.Apm/Libraries/Newtonsoft.Json/Utilities/DynamicReflectionDelegateFactory.cs +++ b/src/Elastic.Apm/Libraries/Newtonsoft.Json/Utilities/DynamicReflectionDelegateFactory.cs @@ -25,7 +25,7 @@ #endregion -#if NET461 +#if NET462 using System; using System.Globalization; using System.Reflection; diff --git a/src/Elastic.Apm/Libraries/Newtonsoft.Json/Utilities/ILGeneratorExtensions.cs b/src/Elastic.Apm/Libraries/Newtonsoft.Json/Utilities/ILGeneratorExtensions.cs index 889ef7e09..ae497b467 100644 --- a/src/Elastic.Apm/Libraries/Newtonsoft.Json/Utilities/ILGeneratorExtensions.cs +++ b/src/Elastic.Apm/Libraries/Newtonsoft.Json/Utilities/ILGeneratorExtensions.cs @@ -25,7 +25,7 @@ #endregion -#if NET461 +#if NET462 using System; using System.Reflection; using System.Reflection.Emit; diff --git a/src/elastic_apm_profiler/src/profiler/managed.rs b/src/elastic_apm_profiler/src/profiler/managed.rs index 4e12f812f..ff4febb81 100644 --- a/src/elastic_apm_profiler/src/profiler/managed.rs +++ b/src/elastic_apm_profiler/src/profiler/managed.rs @@ -65,7 +65,7 @@ pub extern "C" fn GetAssemblyAndSymbolsBytes( symbols_size: &mut i32, ) { let tfm = if IS_DESKTOP_CLR.load(Ordering::SeqCst) { - "net461" + "net462" } else { "netcoreapp2.0" }; diff --git a/test/Directory.Build.props b/test/Directory.Build.props index 91021f9f8..79ba41bf3 100644 --- a/test/Directory.Build.props +++ b/test/Directory.Build.props @@ -19,8 +19,8 @@ - - + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/test/Elastic.Apm.AspNetFullFramework.Tests/Elastic.Apm.AspNetFullFramework.Tests.csproj b/test/Elastic.Apm.AspNetFullFramework.Tests/Elastic.Apm.AspNetFullFramework.Tests.csproj index 6f0fdd9c8..400f9307f 100644 --- a/test/Elastic.Apm.AspNetFullFramework.Tests/Elastic.Apm.AspNetFullFramework.Tests.csproj +++ b/test/Elastic.Apm.AspNetFullFramework.Tests/Elastic.Apm.AspNetFullFramework.Tests.csproj @@ -1,6 +1,7 @@  true + true false false true @@ -10,8 +11,7 @@ Elastic.Apm.AspNetFullFramework.Tests Elastic.Apm.AspNetFullFramework.Tests - - + @@ -20,15 +20,17 @@ all runtime; build; native; contentfiles; analyzers + + + + - - - + - TargetFramework=net461 + TargetFramework=net462 @@ -37,9 +39,15 @@ + + + + + + \ No newline at end of file diff --git a/test/Elastic.Apm.AspNetFullFramework.Tests/NoWebComponentTests.cs b/test/Elastic.Apm.AspNetFullFramework.Tests/NoWebComponentTests.cs new file mode 100644 index 000000000..d5aa73f1c --- /dev/null +++ b/test/Elastic.Apm.AspNetFullFramework.Tests/NoWebComponentTests.cs @@ -0,0 +1,20 @@ +using FluentAssertions; +using Xunit; + +namespace Elastic.Apm.AspNetFullFramework.Tests; + +public class NoWebComponentTests +{ + [Fact] + + public void RunningFrameworkTestsButNoWebComponentsDetected() + { + + false.Should().BeTrue($@"Attempting to run IIS tests but no visual build tools are detected +VsToolsPath: {System.Environment.GetEnvironmentVariable("VsToolsPath")} +MSBuildExtensionsPath: {System.Environment.GetEnvironmentVariable("MSBuildExtensionsPath")} +"); + + } + +} diff --git a/test/Elastic.Apm.Profiler.Managed.Tests/AdoNet/NpgSqlCommandTests.cs b/test/Elastic.Apm.Profiler.Managed.Tests/AdoNet/NpgSqlCommandTests.cs index bc4a7ea0e..a1c582229 100644 --- a/test/Elastic.Apm.Profiler.Managed.Tests/AdoNet/NpgSqlCommandTests.cs +++ b/test/Elastic.Apm.Profiler.Managed.Tests/AdoNet/NpgSqlCommandTests.cs @@ -41,7 +41,7 @@ public static IEnumerable TestParameters yield return new object[] { "net7.0", npgSqlVersion }; if (TestEnvironment.IsWindows) - yield return new object[] { "net461", npgSqlVersion }; + yield return new object[] { "net462", npgSqlVersion }; npgSqlVersion = "6.0.2"; diff --git a/test/Elastic.Apm.Profiler.Managed.Tests/AdoNet/OracleManagedDataAccessCommandTests.cs b/test/Elastic.Apm.Profiler.Managed.Tests/AdoNet/OracleManagedDataAccessCommandTests.cs index bd6d3c0bd..12373d772 100644 --- a/test/Elastic.Apm.Profiler.Managed.Tests/AdoNet/OracleManagedDataAccessCommandTests.cs +++ b/test/Elastic.Apm.Profiler.Managed.Tests/AdoNet/OracleManagedDataAccessCommandTests.cs @@ -31,7 +31,7 @@ public OracleManagedDataAccessCommandTests(OracleSqlFixture fixture, ITestOutput } [DockerTheory] - [InlineData("net461")] + [InlineData("net462")] public async Task CaptureAutoInstrumentedSpans(string targetFramework) { if (!TestEnvironment.IsWindows) diff --git a/test/Elastic.Apm.Profiler.Managed.Tests/ExcludeTests.cs b/test/Elastic.Apm.Profiler.Managed.Tests/ExcludeTests.cs index 6b652762d..c655b58c0 100644 --- a/test/Elastic.Apm.Profiler.Managed.Tests/ExcludeTests.cs +++ b/test/Elastic.Apm.Profiler.Managed.Tests/ExcludeTests.cs @@ -71,7 +71,7 @@ public static IEnumerable TargetFrameworks() var dotnet = "dotnet"; if (TestEnvironment.IsWindows) { - yield return new object[] { "net461", "SqliteSample.exe" }; + yield return new object[] { "net462", "SqliteSample.exe" }; dotnet = "dotnet.exe"; } diff --git a/test/Elastic.Apm.Profiler.Managed.Tests/ProfiledApplication.cs b/test/Elastic.Apm.Profiler.Managed.Tests/ProfiledApplication.cs index 53114a314..92fe1d7f8 100644 --- a/test/Elastic.Apm.Profiler.Managed.Tests/ProfiledApplication.cs +++ b/test/Elastic.Apm.Profiler.Managed.Tests/ProfiledApplication.cs @@ -137,8 +137,8 @@ public void Start( environmentVariables["ELASTIC_APM_PROFILER_LOG_TARGETS"] = "file;stdout"; //environmentVariables["ELASTIC_APM_PROFILER_LOG_IL"] = "true"; - // use the .exe for net461 - var arguments = targetFramework == "net461" + // use the .exe for net462 + var arguments = targetFramework == "net462" ? new StartArguments(Path.Combine(workingDirectory, $"{_projectName}.exe")) : useLocalhostHttp5000 ? new StartArguments("dotnet", $"{_projectName}.dll", "--urls", "http://localhost:5000") diff --git a/test/Elastic.Apm.SqlClient.Tests/Elastic.Apm.SqlClient.Tests.csproj b/test/Elastic.Apm.SqlClient.Tests/Elastic.Apm.SqlClient.Tests.csproj index 34746f002..a665e12f1 100644 --- a/test/Elastic.Apm.SqlClient.Tests/Elastic.Apm.SqlClient.Tests.csproj +++ b/test/Elastic.Apm.SqlClient.Tests/Elastic.Apm.SqlClient.Tests.csproj @@ -1,6 +1,6 @@  - net461;net7.0 + net462;net7.0 Elastic.Apm.SqlClient.Tests Elastic.Apm.SqlClient.Tests @@ -18,7 +18,7 @@ - + diff --git a/test/Elastic.Apm.Tests.Utilities/Elastic.Apm.Tests.Utilities.csproj b/test/Elastic.Apm.Tests.Utilities/Elastic.Apm.Tests.Utilities.csproj index 773b3e871..7aa329d5a 100644 --- a/test/Elastic.Apm.Tests.Utilities/Elastic.Apm.Tests.Utilities.csproj +++ b/test/Elastic.Apm.Tests.Utilities/Elastic.Apm.Tests.Utilities.csproj @@ -1,7 +1,7 @@ - netstandard2.0;net461 + netstandard2.0;net462 false diff --git a/test/Elastic.Apm.Tests.Utilities/MockConfiguration.cs b/test/Elastic.Apm.Tests.Utilities/MockConfiguration.cs index 8b86b4c06..07f18c5ea 100644 --- a/test/Elastic.Apm.Tests.Utilities/MockConfiguration.cs +++ b/test/Elastic.Apm.Tests.Utilities/MockConfiguration.cs @@ -119,7 +119,7 @@ public MockConfiguration(IApmLogger logger = null, ConfigurationOption.UseElasticTraceparentHeader => useElasticTraceparentHeader, ConfigurationOption.VerifyServerCert => verifyServerCert, -#if NET461_OR_GREATER +#if NET462_OR_GREATER ConfigurationOption.FullFrameworkConfigurationReaderType => null, #endif _ => throw new Exception($"{nameof(MockConfiguration)} does not have implementation for configuration : {key}") diff --git a/test/Elastic.Apm.Tests/Elastic.Apm.Tests.csproj b/test/Elastic.Apm.Tests/Elastic.Apm.Tests.csproj index 291ffd43f..44698a5de 100644 --- a/test/Elastic.Apm.Tests/Elastic.Apm.Tests.csproj +++ b/test/Elastic.Apm.Tests/Elastic.Apm.Tests.csproj @@ -1,7 +1,7 @@ - net461;net7.0 + net462;net7.0 @@ -45,7 +45,7 @@ - + diff --git a/test/Elastic.Apm.Tests/HttpDiagnosticListenerTests.cs b/test/Elastic.Apm.Tests/HttpDiagnosticListenerTests.cs index ab3c8164b..9b39b3a77 100644 --- a/test/Elastic.Apm.Tests/HttpDiagnosticListenerTests.cs +++ b/test/Elastic.Apm.Tests/HttpDiagnosticListenerTests.cs @@ -810,7 +810,7 @@ public async Task CallStackContainsCallerMethod() } } - // Don't run this test on NET461 as it can intermittently fail- + // Don't run this test on NET462 as it can intermittently fail- // NET Framework's instrumentation to capture HTTP client calls in HttpHandlerDiagnosticListener is achieved through reflection to replace // the ServicePointManager.s_ServicePointTable static non-public field, in order to provide own implementations of the ServicePointHashtable, // ConnectionGroupHashtable, ConnectionArrayList and HttpWebRequestArrayList, such that diagnostic source events can be raised when new