diff --git a/CHANGELOG.md b/CHANGELOG.md
index 8ed8319fb..32ae6b1a1 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -2,6 +2,7 @@
## Version 2.7.0-beta1
- [Added support to collect Perf Counters for .NET Core Apps if running inside Azure WebApps] (https://github.com/Microsoft/ApplicationInsights-dotnet-server/issues/889)
+- [Fix: Correlation is not working for POST requests](https://github.com/Microsoft/ApplicationInsights-dotnet-server/pull/898) when .NET 4.7.1 runtime is installed.
## Version 2.6.0-beta4
- [Remove CorrelationIdLookupHelper. Use TelemetryConfiguration.ApplicationIdProvider instead.](https://github.com/Microsoft/ApplicationInsights-dotnet-server/pull/880) With this change you can update URL to query application ID from which enables environments with reverse proxy configuration to access Application Insights ednpoints.
diff --git a/Src/Common/Common.projitems b/Src/Common/Common.projitems
index a5a0b3c2d..9cde38559 100644
--- a/Src/Common/Common.projitems
+++ b/Src/Common/Common.projitems
@@ -14,6 +14,7 @@
+
diff --git a/Src/DependencyCollector/Shared/PropertyFetcher.cs b/Src/Common/PropertyFetcher.cs
similarity index 97%
rename from Src/DependencyCollector/Shared/PropertyFetcher.cs
rename to Src/Common/PropertyFetcher.cs
index 3b2ab370e..a88abbcd9 100644
--- a/Src/DependencyCollector/Shared/PropertyFetcher.cs
+++ b/Src/Common/PropertyFetcher.cs
@@ -1,4 +1,4 @@
-namespace Microsoft.ApplicationInsights.DependencyCollector.Implementation
+namespace Microsoft.ApplicationInsights.Common
{
using System;
using System.Reflection;
diff --git a/Src/DependencyCollector/Shared/DependencyCollector.Shared.projitems b/Src/DependencyCollector/Shared/DependencyCollector.Shared.projitems
index c19998ef6..02aad4310 100644
--- a/Src/DependencyCollector/Shared/DependencyCollector.Shared.projitems
+++ b/Src/DependencyCollector/Shared/DependencyCollector.Shared.projitems
@@ -42,7 +42,6 @@
-
diff --git a/Src/DependencyCollector/Shared/Implementation/EventHandlers/DiagnosticsEventHandlerBase.cs b/Src/DependencyCollector/Shared/Implementation/EventHandlers/DiagnosticsEventHandlerBase.cs
index 8ffd08e2e..18f8884ec 100644
--- a/Src/DependencyCollector/Shared/Implementation/EventHandlers/DiagnosticsEventHandlerBase.cs
+++ b/Src/DependencyCollector/Shared/Implementation/EventHandlers/DiagnosticsEventHandlerBase.cs
@@ -5,6 +5,7 @@
using System.Collections.Generic;
using System.Diagnostics;
using System.Threading.Tasks;
+ using Microsoft.ApplicationInsights.Common;
using Microsoft.ApplicationInsights.Extensibility;
using Microsoft.ApplicationInsights.Extensibility.Implementation;
diff --git a/Src/DependencyCollector/Shared/Implementation/HttpDesktopDiagnosticSourceListener.cs b/Src/DependencyCollector/Shared/Implementation/HttpDesktopDiagnosticSourceListener.cs
index e0638af1d..455781ae7 100644
--- a/Src/DependencyCollector/Shared/Implementation/HttpDesktopDiagnosticSourceListener.cs
+++ b/Src/DependencyCollector/Shared/Implementation/HttpDesktopDiagnosticSourceListener.cs
@@ -4,6 +4,7 @@ namespace Microsoft.ApplicationInsights.DependencyCollector.Implementation
using System;
using System.Collections.Generic;
using System.Net;
+ using Microsoft.ApplicationInsights.Common;
using Microsoft.ApplicationInsights.Extensibility.Implementation.Tracing;
///
diff --git a/Src/DependencyCollector/Shared/Implementation/SqlClientDiagnostics/SqlClientDiagnosticFetcherTypes.cs b/Src/DependencyCollector/Shared/Implementation/SqlClientDiagnostics/SqlClientDiagnosticFetcherTypes.cs
index ab94c73cb..a4f557545 100644
--- a/Src/DependencyCollector/Shared/Implementation/SqlClientDiagnostics/SqlClientDiagnosticFetcherTypes.cs
+++ b/Src/DependencyCollector/Shared/Implementation/SqlClientDiagnostics/SqlClientDiagnosticFetcherTypes.cs
@@ -1,5 +1,7 @@
namespace Microsoft.ApplicationInsights.DependencyCollector.Implementation.SqlClientDiagnostics
{
+ using Microsoft.ApplicationInsights.Common;
+
internal static class SqlClientDiagnosticFetcherTypes
{
//// These types map to the anonymous types defined here: System.Data.SqlClient.SqlClientDiagnosticListenerExtensions.
diff --git a/Src/Web/Web.Net45.Tests/AspNetDiagnosticTelemetryModuleTest.cs b/Src/Web/Web.Net45.Tests/AspNetDiagnosticTelemetryModuleTest.cs
index c493d3ae1..06d6eaed1 100644
--- a/Src/Web/Web.Net45.Tests/AspNetDiagnosticTelemetryModuleTest.cs
+++ b/Src/Web/Web.Net45.Tests/AspNetDiagnosticTelemetryModuleTest.cs
@@ -113,12 +113,21 @@ public void GrandChildTelemetryIsReportedProperlyBetweenBeginEndRequestWhenActiv
var client = new TelemetryClient(this.configuration);
client.TrackTrace(trace);
- this.aspNetDiagnosticsSource.StopActivity();
+ this.aspNetDiagnosticsSource.ReportRestoredActivity(restoredActivity);
Assert.AreEqual(2, this.sendItems.Count);
+ var requestRestoredTelemetry = (RequestTelemetry)this.sendItems.SingleOrDefault(i => i is RequestTelemetry);
+ Assert.IsNotNull(requestRestoredTelemetry);
- var requestTelemetry = this.sendItems[0] as RequestTelemetry ?? this.sendItems[1] as RequestTelemetry;
+ this.aspNetDiagnosticsSource.StopActivity();
+ Assert.AreEqual(3, this.sendItems.Count);
+
+ var requestTelemetry = (RequestTelemetry)this.sendItems[2];
Assert.IsNotNull(requestTelemetry);
+ Assert.AreEqual(requestTelemetry.Id, requestRestoredTelemetry.Context.Operation.ParentId);
+ Assert.AreEqual(restoredActivity.Id, requestRestoredTelemetry.Id);
+ Assert.AreEqual(requestTelemetry.Context.Operation.Id, requestRestoredTelemetry.Context.Operation.Id);
+
Assert.AreEqual(restoredActivity.ParentId, requestTelemetry.Id);
Assert.AreEqual(restoredActivity.Id, trace.Context.Operation.ParentId);
Assert.AreEqual(requestTelemetry.Context.Operation.Id, trace.Context.Operation.Id);
@@ -345,6 +354,7 @@ private class FakeAspNetDiagnosticSource : IDisposable
public const string IncomingRequestEventName = "Microsoft.AspNet.HttpReqIn";
private const string AspNetListenerName = "Microsoft.AspNet.TelemetryCorrelation";
private const string IncomingRequestStopLostActivity = "Microsoft.AspNet.HttpReqIn.ActivityLost.Stop";
+ private const string IncomingRequestStopRestoredActivity = "Microsoft.AspNet.HttpReqIn.ActivityRestored.Stop";
private readonly DiagnosticListener listener;
@@ -433,6 +443,13 @@ public void StopLostActivity(Activity activity)
this.listener.Write(IncomingRequestStopLostActivity, new { activity });
}
+ public void ReportRestoredActivity(Activity activity)
+ {
+ Debug.Assert(activity != null, "Activity is null");
+
+ this.listener.Write(IncomingRequestStopRestoredActivity, new { Activity = activity });
+ }
+
public void Dispose()
{
this.Dispose(true);
diff --git a/Src/Web/Web.Net45.Tests/RequestTrackingTelemetryModuleTest.Net45.cs b/Src/Web/Web.Net45.Tests/RequestTrackingTelemetryModuleTest.Net45.cs
index 5a13b2d44..74a38265b 100644
--- a/Src/Web/Web.Net45.Tests/RequestTrackingTelemetryModuleTest.Net45.cs
+++ b/Src/Web/Web.Net45.Tests/RequestTrackingTelemetryModuleTest.Net45.cs
@@ -3,6 +3,7 @@
using System;
using System.Collections.Generic;
using System.Diagnostics;
+ using System.Threading.Tasks;
using System.Web;
using Microsoft.ApplicationInsights.DataContracts;
@@ -193,7 +194,7 @@ public void OnBeginTelemetryCreatedWithinRequestScopeIsRequestChild()
}
[TestMethod]
- public void OnPreHandlerTelemetryCreatedWithinRequestScopeIsRequestChild()
+ public async Task OnPreHandlerTelemetryCreatedWithinRequestScopeIsRequestChild()
{
var context = HttpModuleHelper.GetFakeHttpContext(new Dictionary
{
@@ -215,9 +216,16 @@ public void OnPreHandlerTelemetryCreatedWithinRequestScopeIsRequestChild()
// CallContext was lost after OnBegin, so Asp.NET Http Module will restore it in OnPreRequestHandlerExecute
new Activity("restored").SetParentId(activity.Id).AddBaggage("k", "v").Start();
- // if OnPreRequestHandlerExecute set a CallContext, child telemetry will be properly filled
var trace = new TraceTelemetry();
- telemetryClient.TrackTrace(trace);
+
+ // run track trace in the async task, so that HttpContext.Current is not available and we could be sure
+ // telemetry is not initialized from it.
+ await Task.Run(() =>
+ {
+ // if OnPreRequestHandlerExecute set a CallContext, child telemetry will be properly filled
+ telemetryClient.TrackTrace(trace);
+ });
+
var requestTelemetry = context.GetRequestTelemetry();
Assert.Equal(requestTelemetry.Context.Operation.Id, trace.Context.Operation.Id);
diff --git a/Src/Web/Web.Net45/AspNetDiagnosticTelemetryModule.cs b/Src/Web/Web.Net45/AspNetDiagnosticTelemetryModule.cs
index 0c7ef8658..90cd11e27 100644
--- a/Src/Web/Web.Net45/AspNetDiagnosticTelemetryModule.cs
+++ b/Src/Web/Web.Net45/AspNetDiagnosticTelemetryModule.cs
@@ -21,6 +21,7 @@ public class AspNetDiagnosticTelemetryModule : IObserver, ID
private const string IncomingRequestStartEventName = "Microsoft.AspNet.HttpReqIn.Start";
private const string IncomingRequestStopEventName = "Microsoft.AspNet.HttpReqIn.Stop";
private const string IncomingRequestStopLostActivity = "Microsoft.AspNet.HttpReqIn.ActivityLost.Stop";
+ private const string IncomingRequestStopRestoredActivity = "Microsoft.AspNet.HttpReqIn.ActivityRestored.Stop";
private IDisposable allListenerSubscription;
private RequestTrackingTelemetryModule requestModule;
@@ -117,6 +118,7 @@ private class AspNetEventObserver : IObserver>
private const string FirstRequestFlag = "Microsoft.ApplicationInsights.FirstRequestFlag";
private readonly RequestTrackingTelemetryModule requestModule;
private readonly ExceptionTrackingTelemetryModule exceptionModule;
+ private readonly PropertyFetcher activityFetcher = new PropertyFetcher(nameof(Activity));
public AspNetEventObserver(RequestTrackingTelemetryModule requestModule, ExceptionTrackingTelemetryModule exceptionModule)
{
@@ -182,6 +184,17 @@ public void OnNext(KeyValuePair value)
this.requestModule?.OnEndRequest(context);
}
}
+ else if (value.Key == IncomingRequestStopRestoredActivity)
+ {
+ var activity = (Activity)this.activityFetcher.Fetch(value.Value);
+ if (activity == null)
+ {
+ WebEventSource.Log.ActivityIsNull(IncomingRequestStopRestoredActivity);
+ return;
+ }
+
+ this.requestModule.TrackIntermediateRequest(context, activity);
+ }
}
#region IObserver
diff --git a/Src/Web/Web.Net45/Web.Net45.csproj b/Src/Web/Web.Net45/Web.Net45.csproj
index 3c6216039..98fcdaf98 100644
--- a/Src/Web/Web.Net45/Web.Net45.csproj
+++ b/Src/Web/Web.Net45/Web.Net45.csproj
@@ -26,8 +26,8 @@
..\..\..\..\packages\Microsoft.ApplicationInsights.2.6.0-beta4\lib\net45\Microsoft.ApplicationInsights.dll
-
- ..\..\..\..\packages\Microsoft.AspNet.TelemetryCorrelation.1.0.1\lib\net45\Microsoft.AspNet.TelemetryCorrelation.dll
+
+ ..\..\..\..\packages\Microsoft.AspNet.TelemetryCorrelation.1.0.3\lib\net45\Microsoft.AspNet.TelemetryCorrelation.dll
diff --git a/Src/Web/Web.Net45/packages.config b/Src/Web/Web.Net45/packages.config
index 8e4015866..404edea86 100644
--- a/Src/Web/Web.Net45/packages.config
+++ b/Src/Web/Web.Net45/packages.config
@@ -3,7 +3,7 @@
-
+
\ No newline at end of file
diff --git a/Src/Web/Web.Nuget/Package.nuspec b/Src/Web/Web.Nuget/Package.nuspec
index f9dd70341..ac820a290 100644
--- a/Src/Web/Web.Nuget/Package.nuspec
+++ b/Src/Web/Web.Nuget/Package.nuspec
@@ -19,7 +19,7 @@
-
+
diff --git a/Src/Web/Web.Shared.Net.Tests/RequestTrackingTelemetryModuleTest.cs b/Src/Web/Web.Shared.Net.Tests/RequestTrackingTelemetryModuleTest.cs
index c03d660c9..9dd1063c8 100644
--- a/Src/Web/Web.Shared.Net.Tests/RequestTrackingTelemetryModuleTest.cs
+++ b/Src/Web/Web.Shared.Net.Tests/RequestTrackingTelemetryModuleTest.cs
@@ -1,6 +1,7 @@
namespace Microsoft.ApplicationInsights.Web
{
using System;
+ using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
@@ -8,6 +9,7 @@
using Microsoft.ApplicationInsights.Channel;
using Microsoft.ApplicationInsights.Common;
+ using Microsoft.ApplicationInsights.DataContracts;
using Microsoft.ApplicationInsights.Extensibility;
using Microsoft.ApplicationInsights.Extensibility.Implementation;
using Microsoft.ApplicationInsights.TestFramework;
@@ -28,10 +30,15 @@ public partial class RequestTrackingTelemetryModuleTest
private const string TestInstrumentationKey2 = nameof(TestInstrumentationKey2);
private const string TestApplicationId1 = nameof(TestApplicationId1);
private const string TestApplicationId2 = nameof(TestApplicationId2);
-
+ private readonly ConcurrentQueue sentTelemetry = new ConcurrentQueue();
+
[TestCleanup]
public void Cleanup()
{
+ while (this.sentTelemetry.TryDequeue(out _))
+ {
+ }
+
#if NET45
while (Activity.Current != null)
{
@@ -404,9 +411,57 @@ public void OnEndDoesNotOverrideSourceField()
Assert.Equal(TestApplicationId2, context.GetRequestTelemetry().Source);
}
+ [TestMethod]
+ public void TrackIntermediateRequestSetsProperties()
+ {
+ string requestId = "|standard-id.";
+ var context = HttpModuleHelper.GetFakeHttpContext(new Dictionary
+ {
+ ["Request-Id"] = requestId
+ });
+
+ var module = this.RequestTrackingTelemetryModuleFactory(this.CreateDefaultConfig(context));
+ module.OnBeginRequest(context);
+
+ var originalRequest = context.GetRequestTelemetry();
+ originalRequest.Start(Stopwatch.GetTimestamp() - (1 * Stopwatch.Frequency));
+
+ var restoredActivity = new Activity("dummy").SetParentId(originalRequest.Id).Start();
+
+ module.TrackIntermediateRequest(context, restoredActivity);
+
+ Assert.Equal(1, this.sentTelemetry.Count);
+ Assert.True(this.sentTelemetry.TryDequeue(out RequestTelemetry intermediateRequest));
+
+ Assert.Equal(originalRequest.Id, intermediateRequest.Context.Operation.ParentId);
+ Assert.Equal(originalRequest.Context.Operation.Id, intermediateRequest.Context.Operation.Id);
+ Assert.Equal(restoredActivity.StartTimeUtc, intermediateRequest.Timestamp);
+ Assert.Equal(restoredActivity.Duration, intermediateRequest.Duration);
+ Assert.True(intermediateRequest.Properties.ContainsKey("AI internal"));
+ }
+
private TelemetryConfiguration CreateDefaultConfig(HttpContext fakeContext, string rootIdHeaderName = null, string parentIdHeaderName = null, string instrumentationKey = null)
{
- var config = TelemetryConfiguration.CreateDefault();
+ var telemetryChannel = new StubTelemetryChannel()
+ {
+ EndpointAddress = "https://endpointaddress",
+ OnSend = item =>
+ {
+ if (item is RequestTelemetry request)
+ {
+ this.sentTelemetry.Enqueue(request);
+ }
+ }
+ };
+
+ var configuration = new TelemetryConfiguration
+ {
+ TelemetryChannel = telemetryChannel,
+ InstrumentationKey = TestInstrumentationKey1,
+ ApplicationIdProvider = new MockApplicationIdProvider(TestInstrumentationKey1, TestApplicationId1)
+ };
+ configuration.TelemetryInitializers.Add(new Extensibility.OperationCorrelationTelemetryInitializer());
+
var telemetryInitializer = new TestableOperationCorrelationTelemetryInitializer(fakeContext);
if (rootIdHeaderName != null)
@@ -419,9 +474,9 @@ private TelemetryConfiguration CreateDefaultConfig(HttpContext fakeContext, stri
telemetryInitializer.ParentOperationIdHeaderName = parentIdHeaderName;
}
- config.TelemetryInitializers.Add(telemetryInitializer);
- config.InstrumentationKey = instrumentationKey ?? Guid.NewGuid().ToString();
- return config;
+ configuration.TelemetryInitializers.Add(telemetryInitializer);
+
+ return configuration;
}
private string GetActivityRootId(string telemetryId)
diff --git a/Src/Web/Web.Shared.Net/Implementation/WebEventSource.cs b/Src/Web/Web.Shared.Net/Implementation/WebEventSource.cs
index 69a0c2315..0270a8c56 100644
--- a/Src/Web/Web.Shared.Net/Implementation/WebEventSource.cs
+++ b/Src/Web/Web.Shared.Net/Implementation/WebEventSource.cs
@@ -467,6 +467,15 @@ public void InjectionCompleted(string appDomainName = "Incorrect")
this.WriteEvent(47, this.ApplicationName);
}
+ [Event(48,
+ Keywords = Keywords.Diagnostics,
+ Message = "Activity is null for event = '{0}'",
+ Level = EventLevel.Error)]
+ public void ActivityIsNull(string diagnosticsSourceEventName, string appDomainName = "Incorrect")
+ {
+ this.WriteEvent(48, diagnosticsSourceEventName, this.ApplicationName);
+ }
+
[NonEvent]
private string GetApplicationName()
{
diff --git a/Src/Web/Web.Shared.Net/RequestTrackingTelemetryModule.cs b/Src/Web/Web.Shared.Net/RequestTrackingTelemetryModule.cs
index 473f71092..a3082f6f0 100644
--- a/Src/Web/Web.Shared.Net/RequestTrackingTelemetryModule.cs
+++ b/Src/Web/Web.Shared.Net/RequestTrackingTelemetryModule.cs
@@ -3,11 +3,13 @@
using System;
using System.Collections.Concurrent;
using System.Collections.Generic;
+ using System.Diagnostics;
using System.Globalization;
using System.Web;
using Extensibility.Implementation.Tracing;
using Microsoft.ApplicationInsights.Common;
+ using Microsoft.ApplicationInsights.DataContracts;
using Microsoft.ApplicationInsights.Extensibility;
using Microsoft.ApplicationInsights.Extensibility.Implementation;
using Microsoft.ApplicationInsights.Web.Implementation;
@@ -279,6 +281,67 @@ public void Initialize(TelemetryConfiguration configuration)
}
}
+ ///
+ /// Tracks intermediate request if Activity was lost on the way to ASP.NET.
+ /// This request ensures we can correlate high-level request and dependency call.
+ /// This method should be removed with DiagnosticSource released along with .NET Core 2.2.
+ ///
+ /// Current HttpContext.
+ /// Restored activity.
+ internal void TrackIntermediateRequest(HttpContext context, Activity activity)
+ {
+ // See https://github.com/Microsoft/ApplicationInsights-dotnet-server/issues/797
+ if (this.telemetryClient == null)
+ {
+ if (!this.initializationErrorReported)
+ {
+ this.initializationErrorReported = true;
+ WebEventSource.Log.InitializeHasNotBeenCalledOnModuleYetError();
+ }
+ else
+ {
+ WebEventSource.Log.InitializeHasNotBeenCalledOnModuleYetVerbose();
+ }
+
+ return;
+ }
+
+ if (!this.NeedProcessRequest(context))
+ {
+ return;
+ }
+
+ var initialRequest = context.GetRequestTelemetry();
+ if (initialRequest == null)
+ {
+ // Begin_Request was not called and no telemetry has been
+ // reported in scope of this request, there is no point in reporting intermediate request.
+ return;
+ }
+
+ var handlerNamespace = context.CurrentHandler?.GetType().Namespace;
+ if (handlerNamespace != null && handlerNamespace.StartsWith("System.ServiceModel", StringComparison.Ordinal))
+ {
+ // no point in reporting WCF intermediate requests, there is no correlation for WCF anyway
+ return;
+ }
+
+ var intermediateRequest = new RequestTelemetry
+ {
+ Name = string.Format(CultureInfo.InvariantCulture, "Execute request handler ({0})", context.CreateRequestNamePrivate()),
+ Id = activity.Id,
+ Timestamp = activity.StartTimeUtc,
+ Duration = activity.Duration
+ };
+
+ intermediateRequest.Context.Operation.Id = activity.RootId;
+ intermediateRequest.Context.Operation.ParentId = activity.ParentId;
+ intermediateRequest.ResponseCode = null;
+ intermediateRequest.Properties.Add("AI internal", "Execute request handler step");
+
+ this.telemetryClient.TrackRequest(intermediateRequest);
+ }
+
///
/// Verifies context to detect whether or not request needs to be processed.
///
diff --git a/Test/E2ETests/E2ETests/DependencyCollectionTests.csproj b/Test/E2ETests/E2ETests/DependencyCollectionTests.csproj
index f50845d15..bf550af15 100644
--- a/Test/E2ETests/E2ETests/DependencyCollectionTests.csproj
+++ b/Test/E2ETests/E2ETests/DependencyCollectionTests.csproj
@@ -1,4 +1,4 @@
-
+
@@ -83,6 +83,7 @@
+
@@ -102,7 +103,7 @@
Always
-
+
Always
@@ -116,7 +117,6 @@
-
@@ -148,4 +148,4 @@
-
+
\ No newline at end of file
diff --git a/Test/E2ETests/E2ETests/Test452Base.cs b/Test/E2ETests/E2ETests/Test452Base.cs
index 5b78be25b..1e004c81e 100644
--- a/Test/E2ETests/E2ETests/Test452Base.cs
+++ b/Test/E2ETests/E2ETests/Test452Base.cs
@@ -12,6 +12,8 @@
using System.Collections.Generic;
using System.Globalization;
using System.Net;
+using System.Text;
+using System.Linq;
namespace E2ETests
{
@@ -262,6 +264,80 @@ public void TestSyncHttpDependency(string expectedPrefix)
true);
}
+ ///
+ /// Tests correlation between POST request and depdendency call that is done from the controller.
+ ///
+ ///
+ public async Task TestHttpDependencyCorrelationInPostRequest()
+ {
+ var operationId = Guid.NewGuid().ToString();
+ bool supportsOnRequestExecute = false;
+ string restoredActivityId = null;
+ using (var httpClient = new HttpClient())
+ {
+ // The POST controller method wi;ll manually track dependency through the StartOperation
+ var request = new HttpRequestMessage(HttpMethod.Post, string.Format($"http://{Apps[TestConstants.WebApiName].ipAddress}/api/values"));
+ request.Headers.Add("Request-Id", $"|{operationId}.");
+
+ request.Content = new StringContent($"\"{new string('1', 1024*1024)}\"", Encoding.UTF8, "application/json");
+
+ var response = await httpClient.SendAsync(request);
+
+ Trace.WriteLine("Response Headers: ");
+ foreach (var header in response.Headers)
+ {
+ Trace.WriteLine($"\t{header.Key} = {header.Value.First()}");
+ }
+
+ supportsOnRequestExecute = bool.TrueString == response.Headers.GetValues("OnExecuteRequestStep").First();
+ if (response.Headers.TryGetValues("RestoredActivityId", out var ids))
+ {
+ restoredActivityId = ids.First();
+ }
+
+ Assert.AreNotEqual(0, Int32.Parse(response.Headers.GetValues("BodyLength").First()));
+ }
+
+ var dependencies = WaitForReceiveDependencyItemsFromDataIngestion(Apps[TestConstants.WebApiName].ipAddress, Apps[TestConstants.WebApiName].ikey);
+ Trace.WriteLine("Dependencies count for WebApp:" + dependencies.Count);
+ PrintDependencies(dependencies);
+ Assert.AreEqual(1, dependencies.Count);
+
+ var requests = WaitForReceiveRequestItemsFromDataIngestion(Apps[TestConstants.WebApiName].ipAddress, Apps[TestConstants.WebApiName].ikey);
+ Trace.WriteLine("Requests count for WebApp:" + requests.Count);
+ PrintRequests(requests);
+
+ var dependency = dependencies[0];
+
+ // if the App runs on ASP.NET 4.7.1+ version that supports OnExecuteRequestStep
+ // depednency should be correlated to the request, false otherwise
+ if (supportsOnRequestExecute)
+ {
+ Assert.AreEqual(operationId, dependency.tags["ai.operation.id"]);
+ }
+ else
+ {
+ Assert.AreNotEqual(operationId, dependency.tags["ai.operation.id"]);
+ }
+
+ // if Activity was restored by TelemetryCorrelation module
+ // we should have 2 requests, otherwise just one request
+ // in any case, if supportsOnRequestExecute is true, we must have correct parentId
+ if (restoredActivityId != null)
+ {
+ Assert.AreEqual(2, requests.Count);
+ Assert.AreEqual(restoredActivityId, dependency.tags["ai.operation.parentId"]);
+ }
+ else
+ {
+ Assert.AreEqual(1, requests.Count);
+ if (supportsOnRequestExecute)
+ {
+ Assert.AreEqual(requests[0].data.baseData.id, dependency.tags["ai.operation.parentId"]);
+ }
+ }
+ }
+
public void TestAsyncWithHttpClientHttpDependency(string expectedPrefix)
{
var expectedDependencyTelemetry = new DependencyTelemetry();
diff --git a/Test/E2ETests/E2ETests/docker-compose452AppOn47.yml b/Test/E2ETests/E2ETests/docker-compose452AppOn471.yml
similarity index 91%
rename from Test/E2ETests/E2ETests/docker-compose452AppOn47.yml
rename to Test/E2ETests/E2ETests/docker-compose452AppOn471.yml
index 04116381b..08153789c 100644
--- a/Test/E2ETests/E2ETests/docker-compose452AppOn47.yml
+++ b/Test/E2ETests/E2ETests/docker-compose452AppOn471.yml
@@ -4,14 +4,14 @@ services:
e2etestwebapi:
build:
context: ./../TestApps/Net452/E2ETestWebApi/Publish
- dockerfile: DockerFile47
+ dockerfile: DockerFile471
depends_on:
- ingestionservice
e2etestwebapp:
build:
context: ./../TestApps/Net452/E2ETestApp/Publish
- dockerfile: DockerFile47
+ dockerfile: DockerFile471
depends_on:
- e2etestwebapi
- sql-server
diff --git a/Test/E2ETests/E2ETests/net462/Test452OnNet462.cs b/Test/E2ETests/E2ETests/net462/Test452OnNet462.cs
index a2e383423..5cf3e10ba 100644
--- a/Test/E2ETests/E2ETests/net462/Test452OnNet462.cs
+++ b/Test/E2ETests/E2ETests/net462/Test452OnNet462.cs
@@ -1,16 +1,6 @@
-using System;
-using Microsoft.VisualStudio.TestTools.UnitTesting;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
using TestUtils.TestConstants;
-using System.IO;
-using System.Diagnostics;
-using System.Threading;
-using System.Net.Http;
using System.Threading.Tasks;
-using E2ETests.Helpers;
-using AI;
-using Microsoft.ApplicationInsights.DataContracts;
-using System.Collections;
-using System.Collections.Generic;
namespace E2ETests.Net462
{
@@ -90,6 +80,13 @@ public void Test452OnNet462_PostCallHttpDependency()
base.TestPostCallHttpDependency(VersionPrefix);
}
+ [TestMethod]
+ [TestCategory("Net452OnNet462")]
+ public async Task Test452OnNet462_HttpDependencyCorrelationInPostRequest()
+ {
+ await base.TestHttpDependencyCorrelationInPostRequest();
+ }
+
[TestMethod]
[TestCategory("Net452OnNet462")]
public void Test452OnNet462_FailedHttpDependency()
diff --git a/Test/E2ETests/E2ETests/net47/Test452OnNet47.cs b/Test/E2ETests/E2ETests/net47/Test452OnNet47.cs
deleted file mode 100644
index a20dee5e7..000000000
--- a/Test/E2ETests/E2ETests/net47/Test452OnNet47.cs
+++ /dev/null
@@ -1,77 +0,0 @@
-using System;
-using Microsoft.VisualStudio.TestTools.UnitTesting;
-using System.IO;
-using System.Diagnostics;
-using System.Threading;
-using System.Net.Http;
-using System.Threading.Tasks;
-using E2ETests.Helpers;
-using AI;
-using Microsoft.ApplicationInsights.DataContracts;
-using System.Collections;
-using System.Collections.Generic;
-
-namespace E2ETests.Net47
-{
- [TestClass]
- public class Test452OnNet47 : Test452Base
- {
- public TestContext TestContext { get; set; }
-
- [ClassInitialize]
- public static void MyClassInitialize(TestContext testContext)
- {
- DockerComposeFileName = "docker-compose452AppOn47.yml";
-
- MyClassInitializeBase();
- }
-
- [TestInitialize]
- public new void MyTestInitialize()
- {
- base.MyTestInitialize();
- }
-
- [TestCleanup]
- public new void MyTestCleanup()
- {
- base.MyTestCleanup();
- }
-
- [TestMethod]
- public void Test452OnNet47_TestXComponentWebAppToWebApi()
- {
- base.TestXComponentWebAppToWebApi();
- }
-
- [TestMethod]
- public void Test452OnNet47_TestBasicRequestWebApp()
- {
- base.TestBasicRequestWebApp();
- }
-
- [TestMethod]
- public void Test452OnNet47_TestBasicHttpDependencyWebApp()
- {
- base.TestBasicHttpDependencyWebApp();
- }
-
- [TestMethod]
- public void Test452OnNet47_TestAzureTableDependencyWebApp()
- {
- base.TestAzureTableDependencyWebApp();
- }
-
- [TestMethod]
- public void Test452OnNet47_TestBasicSqlDependencyWebApp()
- {
- base.TestBasicSqlDependencyWebApp();
- }
-
- [ClassCleanup]
- public static void MyClassCleanup()
- {
- MyClassCleanupBase();
- }
- }
-}
diff --git a/Test/E2ETests/E2ETests/net471/Test452OnNet471.cs b/Test/E2ETests/E2ETests/net471/Test452OnNet471.cs
new file mode 100644
index 000000000..34934ce19
--- /dev/null
+++ b/Test/E2ETests/E2ETests/net471/Test452OnNet471.cs
@@ -0,0 +1,98 @@
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+using System.Threading.Tasks;
+using TestUtils.TestConstants;
+
+namespace E2ETests.net471
+{
+ [TestClass]
+ public class Test452OnNet471 : Test452Base
+ {
+ private static string VersionPrefix;
+ private static string VersionPrefixSql;
+
+ public TestContext TestContext { get; set; }
+
+ [ClassInitialize]
+ public static void MyClassInitialize(TestContext testContext)
+ {
+ DockerComposeFileName = "docker-compose452AppOn471.yml";
+ AppNameBeingTested = TestConstants.WebAppName;
+
+ VersionPrefix = "rdddsd";
+ VersionPrefixSql = "rddf";
+
+ if (!Apps.ContainsKey(AppNameBeingTested))
+ {
+ Apps.Add(AppNameBeingTested, new DeployedApp
+ {
+ ikey = TestConstants.WebAppInstrumentationKey,
+ containerName = TestConstants.WebAppContainerName,
+ imageName = TestConstants.WebAppImageName,
+ healthCheckPath = TestConstants.WebAppHealthCheckPath,
+ flushPath = TestConstants.WebAppFlushPath
+ });
+ }
+ MyClassInitializeBase();
+ }
+
+ [TestInitialize]
+ public new void MyTestInitialize()
+ {
+ base.MyTestInitialize();
+ }
+
+ [TestCleanup]
+ public new void MyTestCleanup()
+ {
+ base.MyTestCleanup();
+ }
+
+ [TestMethod]
+ [TestCategory("Net452OnNet471")]
+ public async Task Test452OnNet471_HttpDependencyCorrelationInPostRequest()
+ {
+ await base.TestHttpDependencyCorrelationInPostRequest();
+ }
+
+ [TestMethod]
+ [TestCategory("Net452OnNet471")]
+ public void Test452OnNet471_TestXComponentWebAppToWebApi()
+ {
+ base.TestXComponentWebAppToWebApi();
+ }
+
+ [TestMethod]
+ [TestCategory("Net452OnNet471")]
+ public void Test452OnNet471_TestBasicRequestWebApp()
+ {
+ base.TestBasicRequestWebApp();
+ }
+
+ [TestMethod]
+ [TestCategory("Net452OnNet471")]
+ public void Test452OnNet47_TestSyncHttpDependencyWebApp()
+ {
+ base.TestSyncHttpDependency(VersionPrefix);
+ }
+
+ [TestMethod]
+ [TestCategory("Net452OnNet471")]
+ public void Test452OnNet471_AzureTableDependencyWebApp()
+ {
+ base.TestAzureTableDependencyWebApp(VersionPrefix);
+ }
+
+ [TestMethod]
+ [TestCategory("Net452OnNet471")]
+ public void Test452OnNet471_SqlDependencyExecuteReaderSuccess()
+ {
+ base.TestSqlDependencyExecuteReaderSuccessAsync(VersionPrefixSql);
+ }
+
+ [ClassCleanup]
+ public static void MyClassCleanup()
+ {
+ MyClassCleanupBase();
+ }
+ }
+}
diff --git a/Test/E2ETests/TestApps/Net452/E2ETestApp/DockerFile47 b/Test/E2ETests/TestApps/Net452/E2ETestApp/DockerFile471
similarity index 88%
rename from Test/E2ETests/TestApps/Net452/E2ETestApp/DockerFile47
rename to Test/E2ETests/TestApps/Net452/E2ETestApp/DockerFile471
index bb1877faa..01a956baa 100644
--- a/Test/E2ETests/TestApps/Net452/E2ETestApp/DockerFile47
+++ b/Test/E2ETests/TestApps/Net452/E2ETestApp/DockerFile471
@@ -1,7 +1,7 @@
# The `FROM` instruction specifies the base image. You are
# extending the `microsoft/aspnet` image.
-FROM microsoft/aspnet:4.7
+FROM microsoft/aspnet:4.7.1
# The final instruction copies the site you published earlier into the container.
COPY . /inetpub/wwwroot
\ No newline at end of file
diff --git a/Test/E2ETests/TestApps/Net452/E2ETestApp/E2ETestApp.csproj b/Test/E2ETests/TestApps/Net452/E2ETestApp/E2ETestApp.csproj
index 242d542cb..f8b4e5257 100644
--- a/Test/E2ETests/TestApps/Net452/E2ETestApp/E2ETestApp.csproj
+++ b/Test/E2ETests/TestApps/Net452/E2ETestApp/E2ETestApp.csproj
@@ -1,4 +1,4 @@
-
+
@@ -58,8 +58,8 @@
..\..\..\..\..\..\packages\Microsoft.ApplicationInsights.2.6.0-beta4\lib\net45\Microsoft.ApplicationInsights.dll
-
- ..\..\..\..\..\..\packages\Microsoft.AspNet.TelemetryCorrelation.1.0.1\lib\net45\Microsoft.AspNet.TelemetryCorrelation.dll
+
+ ..\..\..\..\..\..\packages\Microsoft.AspNet.TelemetryCorrelation.1.0.3\lib\net45\Microsoft.AspNet.TelemetryCorrelation.dll
..\..\..\..\..\..\packages\Microsoft.Azure.KeyVault.Core.1.0.0\lib\net40\Microsoft.Azure.KeyVault.Core.dll
@@ -172,7 +172,7 @@
Always
-
+
Always
@@ -344,4 +344,4 @@
-->
-
+
\ No newline at end of file
diff --git a/Test/E2ETests/TestApps/Net452/E2ETestApp/packages.config b/Test/E2ETests/TestApps/Net452/E2ETestApp/packages.config
index af43f548e..ab75054b3 100644
--- a/Test/E2ETests/TestApps/Net452/E2ETestApp/packages.config
+++ b/Test/E2ETests/TestApps/Net452/E2ETestApp/packages.config
@@ -11,7 +11,7 @@
-
+
diff --git a/Test/E2ETests/TestApps/Net452/E2ETestWebApi/Controllers/ValuesController.cs b/Test/E2ETests/TestApps/Net452/E2ETestWebApi/Controllers/ValuesController.cs
index bd672fc15..73eae983b 100644
--- a/Test/E2ETests/TestApps/Net452/E2ETestWebApi/Controllers/ValuesController.cs
+++ b/Test/E2ETests/TestApps/Net452/E2ETestWebApi/Controllers/ValuesController.cs
@@ -1,14 +1,30 @@
-using System;
+using Microsoft.ApplicationInsights;
+using Microsoft.ApplicationInsights.DataContracts;
+using System;
using System.Collections.Generic;
+using System.Diagnostics;
using System.Linq;
-using System.Net;
using System.Net.Http;
+using System.Reflection;
+using System.Threading.Tasks;
+using System.Web;
using System.Web.Http;
+using Microsoft.Win32;
namespace E2ETestWebApi.Controllers
{
public class ValuesController : ApiController
{
+ private static readonly TelemetryClient telemetryClient = new TelemetryClient();
+
+ private static readonly AssemblyFileVersionAttribute objectAssemblyFileVer =
+ typeof(HttpApplication)
+ .GetTypeInfo()
+ .Assembly
+ .GetCustomAttributes(typeof(AssemblyFileVersionAttribute))
+ .Cast()
+ .FirstOrDefault();
+
// GET api/values
public IEnumerable Get()
{
@@ -26,9 +42,32 @@ public string Get(int id)
}
// POST api/values
- public void Post([FromBody]string value)
+ public Task Post([FromBody]string value)
{
+ var response = new HttpResponseMessage
+ {
+ StatusCode = System.Net.HttpStatusCode.NoContent
+ };
+
+ response.Headers.Add("OnExecuteRequestStep", (typeof(HttpApplication).GetMethod("OnExecuteRequestStep") != null).ToString());
+ response.Headers.Add(".NetRelease", Registry.GetValue(@"HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full", "Release", null)?.ToString());
+ response.Headers.Add("AspNetAssemblyVersion", objectAssemblyFileVer.Version);
+ var restoredActivity = (Activity) HttpContext.Current.Items["__AspnetActivityRestored__"];
+ if (restoredActivity != null)
+ {
+ response.Headers.Add("RestoredActivityId", restoredActivity.Id);
+ }
+
+ response.Headers.Add("BodyLength", value?.Length.ToString());
+ return Task.Run(async () =>
+ {
+ using (telemetryClient.StartOperation("test"))
+ {
+ await Task.Delay(10);
+ return response;
+ }
+ });
}
// PUT api/values/5
diff --git a/Test/E2ETests/TestApps/Net452/E2ETestWebApi/DockerFile47 b/Test/E2ETests/TestApps/Net452/E2ETestWebApi/DockerFile471
similarity index 88%
rename from Test/E2ETests/TestApps/Net452/E2ETestWebApi/DockerFile47
rename to Test/E2ETests/TestApps/Net452/E2ETestWebApi/DockerFile471
index bb1877faa..01a956baa 100644
--- a/Test/E2ETests/TestApps/Net452/E2ETestWebApi/DockerFile47
+++ b/Test/E2ETests/TestApps/Net452/E2ETestWebApi/DockerFile471
@@ -1,7 +1,7 @@
# The `FROM` instruction specifies the base image. You are
# extending the `microsoft/aspnet` image.
-FROM microsoft/aspnet:4.7
+FROM microsoft/aspnet:4.7.1
# The final instruction copies the site you published earlier into the container.
COPY . /inetpub/wwwroot
\ No newline at end of file
diff --git a/Test/E2ETests/TestApps/Net452/E2ETestWebApi/E2ETestWebApi.csproj b/Test/E2ETests/TestApps/Net452/E2ETestWebApi/E2ETestWebApi.csproj
index c80d6c712..b31abc042 100644
--- a/Test/E2ETests/TestApps/Net452/E2ETestWebApi/E2ETestWebApi.csproj
+++ b/Test/E2ETests/TestApps/Net452/E2ETestWebApi/E2ETestWebApi.csproj
@@ -1,4 +1,4 @@
-
+
@@ -54,8 +54,8 @@
..\..\..\..\..\..\packages\Microsoft.ApplicationInsights.2.6.0-beta4\lib\net45\Microsoft.ApplicationInsights.dll
-
- ..\..\..\..\..\..\packages\Microsoft.AspNet.TelemetryCorrelation.1.0.1\lib\net45\Microsoft.AspNet.TelemetryCorrelation.dll
+
+ ..\..\..\..\..\..\packages\Microsoft.AspNet.TelemetryCorrelation.1.0.3\lib\net45\Microsoft.AspNet.TelemetryCorrelation.dll
..\..\..\..\..\..\packages\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.1.0.3\lib\net45\Microsoft.CodeDom.Providers.DotNetCompilerPlatform.dll
@@ -215,7 +215,7 @@
Always
-
+
Always
@@ -310,4 +310,4 @@
-->
-
+
\ No newline at end of file
diff --git a/Test/E2ETests/TestApps/Net452/E2ETestWebApi/packages.config b/Test/E2ETests/TestApps/Net452/E2ETestWebApi/packages.config
index c59b78fc4..dabdf4a85 100644
--- a/Test/E2ETests/TestApps/Net452/E2ETestWebApi/packages.config
+++ b/Test/E2ETests/TestApps/Net452/E2ETestWebApi/packages.config
@@ -1,4 +1,4 @@
-
+
@@ -7,7 +7,7 @@
-
+
@@ -24,4 +24,4 @@
-
+
\ No newline at end of file
diff --git a/Test/E2ETests/TestApps/NetCore20/E2ETestAppCore20/Startup.cs b/Test/E2ETests/TestApps/NetCore20/E2ETestAppCore20/Startup.cs
index a8938d23b..9a6249ef0 100644
--- a/Test/E2ETests/TestApps/NetCore20/E2ETestAppCore20/Startup.cs
+++ b/Test/E2ETests/TestApps/NetCore20/E2ETestAppCore20/Startup.cs
@@ -1,8 +1,4 @@
-using System;
-using System.Collections.Generic;
-using System.Linq;
-using System.Threading.Tasks;
-using Microsoft.AspNetCore.Builder;
+using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
@@ -10,7 +6,6 @@
using Microsoft.Extensions.Options;
using Microsoft.ApplicationInsights.Extensibility;
using Microsoft.ApplicationInsights.DependencyCollector;
-using System.IO;
namespace E2ETestAppCore20
{
diff --git a/Test/Web/FunctionalTests/FunctionalTests/TestsExcCollectingFw45AspxIntegratedPipeline.cs b/Test/Web/FunctionalTests/FunctionalTests/TestsExcCollectingFw45AspxIntegratedPipeline.cs
index 883bdb928..bb344b5cf 100644
--- a/Test/Web/FunctionalTests/FunctionalTests/TestsExcCollectingFw45AspxIntegratedPipeline.cs
+++ b/Test/Web/FunctionalTests/FunctionalTests/TestsExcCollectingFw45AspxIntegratedPipeline.cs
@@ -116,7 +116,7 @@ public void TestSyncExceptionWebFormExceptionCollecting()
"Exception of type 'System.Web.HttpUnhandledException' was thrown.",
"System.Web.UI.Page.HandleError",
"System.Web, Version=",
- 10);
+ 21);
Trace.WriteLine("Validate details 1");
this.ValidateExceptionDetails(
diff --git a/Test/Web/FunctionalTests/FunctionalTests/TestsExcCollectingFw45Mvc.cs b/Test/Web/FunctionalTests/FunctionalTests/TestsExcCollectingFw45Mvc.cs
index e01c5c47e..d25f080a7 100644
--- a/Test/Web/FunctionalTests/FunctionalTests/TestsExcCollectingFw45Mvc.cs
+++ b/Test/Web/FunctionalTests/FunctionalTests/TestsExcCollectingFw45Mvc.cs
@@ -79,7 +79,7 @@ public void Test4MediumRequestAndExceptionAreTrackedForResourceNotFoundException
"The controller for path '/wrongController' was not found or does not implement IController.",
"System.Web.Mvc.DefaultControllerFactory.GetControllerInstance",
"System.Web.Mvc, Version=",
- 9);
+ 15);
}
}
}
diff --git a/Test/Web/FunctionalTests/FunctionalTests/Wcf45TransferHandlerTests.cs b/Test/Web/FunctionalTests/FunctionalTests/Wcf45TransferHandlerTests.cs
index 19543c477..687e2ccd3 100644
--- a/Test/Web/FunctionalTests/FunctionalTests/Wcf45TransferHandlerTests.cs
+++ b/Test/Web/FunctionalTests/FunctionalTests/Wcf45TransferHandlerTests.cs
@@ -6,7 +6,7 @@
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System.Diagnostics;
using System.IO;
-
+
///
/// Test to evaluate if WCF 4.0 works when transferRequestHandler is associated with the first request and a null handler is associated with
/// the inner second request.
diff --git a/Test/Web/FunctionalTests/FunctionalTests/WebAppFW45Tests.cs b/Test/Web/FunctionalTests/FunctionalTests/WebAppFW45Tests.cs
index e03a0fae7..2c041d4f1 100644
--- a/Test/Web/FunctionalTests/FunctionalTests/WebAppFW45Tests.cs
+++ b/Test/Web/FunctionalTests/FunctionalTests/WebAppFW45Tests.cs
@@ -274,7 +274,7 @@ public void TestWcf200PostRequest()
Assert.IsTrue(postTask.Result.IsSuccessStatusCode);
var request = Listener.ReceiveItemsOfType>(1, TimeoutInMs)[0];
-
+
var testFinish = DateTimeOffset.UtcNow;
Trace.WriteLine("Finish: " + testFinish);
@@ -427,22 +427,22 @@ public void TestAsmx_CheckExceptionAndRequestCollectedForResourceNotFound()
// Obtains items with web prefix only so as to eliminate firstchance exceptions.
var items = Listener.ReceiveItemsOfTypesWithWebPrefix, TelemetryItem>(2, TimeoutInMs);
- int requestItemIndex = (items[0] is TelemetryItem) ? 0 : 1;
- int exceptionItemIndex = (requestItemIndex == 0) ? 1 : 0;
+ var requestItem = (TelemetryItem)items.Single(r => r is TelemetryItem);
+ var exceptionItem = (TelemetryItem)items.Single(r => r is TelemetryItem);
- Assert.AreEqual(this.Config.IKey, items[requestItemIndex].iKey, "IKey is not the same as in config file");
- Assert.AreEqual(this.Config.IKey, items[exceptionItemIndex].iKey, "IKey is not the same as in config file");
+ Assert.AreEqual(this.Config.IKey, requestItem.iKey, "IKey is not the same as in config file");
+ Assert.AreEqual(this.Config.IKey, exceptionItem.iKey, "IKey is not the same as in config file");
// Check that request id is set in exception operation parentId for UnhandledException
Assert.AreEqual(
- ((TelemetryItem)items[requestItemIndex]).data.baseData.id,
- items[exceptionItemIndex].tags[new ContextTagKeys().OperationParentId],
+ requestItem.data.baseData.id,
+ exceptionItem.tags[new ContextTagKeys().OperationParentId],
"Exception ParentId is not same as Request id");
// Check that request and exception from UnhandledException have the same operation id
Assert.AreEqual(
- items[requestItemIndex].tags[new ContextTagKeys().OperationId],
- items[exceptionItemIndex].tags[new ContextTagKeys().OperationId],
+ requestItem.tags[new ContextTagKeys().OperationId],
+ exceptionItem.tags[new ContextTagKeys().OperationId],
"Exception Operation Id for exception is not same as Request Operation Id");
}
diff --git a/Test/Web/FunctionalTests/TestApps/AspNetDiagnostics/AspNetDiagnostics.csproj b/Test/Web/FunctionalTests/TestApps/AspNetDiagnostics/AspNetDiagnostics.csproj
index fa1741f77..f94380ee6 100644
--- a/Test/Web/FunctionalTests/TestApps/AspNetDiagnostics/AspNetDiagnostics.csproj
+++ b/Test/Web/FunctionalTests/TestApps/AspNetDiagnostics/AspNetDiagnostics.csproj
@@ -46,8 +46,8 @@
..\..\..\..\..\..\packages\Microsoft.ApplicationInsights.2.6.0-beta4\lib\net45\Microsoft.ApplicationInsights.dll
True
-
- ..\..\..\..\..\..\packages\Microsoft.AspNet.TelemetryCorrelation.1.0.1\lib\net45\Microsoft.AspNet.TelemetryCorrelation.dll
+
+ ..\..\..\..\..\..\packages\Microsoft.AspNet.TelemetryCorrelation.1.0.3\lib\net45\Microsoft.AspNet.TelemetryCorrelation.dll
diff --git a/Test/Web/FunctionalTests/TestApps/AspNetDiagnostics/packages.config b/Test/Web/FunctionalTests/TestApps/AspNetDiagnostics/packages.config
index 605cff908..306991e1c 100644
--- a/Test/Web/FunctionalTests/TestApps/AspNetDiagnostics/packages.config
+++ b/Test/Web/FunctionalTests/TestApps/AspNetDiagnostics/packages.config
@@ -16,7 +16,7 @@
-
+
diff --git a/Test/Web/FunctionalTests/TestApps/Aspx45/Aspx45.csproj b/Test/Web/FunctionalTests/TestApps/Aspx45/Aspx45.csproj
index 85beef4de..5ffa73b7f 100644
--- a/Test/Web/FunctionalTests/TestApps/Aspx45/Aspx45.csproj
+++ b/Test/Web/FunctionalTests/TestApps/Aspx45/Aspx45.csproj
@@ -56,8 +56,8 @@
..\..\..\..\..\..\packages\Microsoft.ApplicationInsights.2.6.0-beta4\lib\net45\Microsoft.ApplicationInsights.dll
True
-
- ..\..\..\..\..\..\packages\Microsoft.AspNet.TelemetryCorrelation.1.0.1\lib\net45\Microsoft.AspNet.TelemetryCorrelation.dll
+
+ ..\..\..\..\..\..\packages\Microsoft.AspNet.TelemetryCorrelation.1.0.3\lib\net45\Microsoft.AspNet.TelemetryCorrelation.dll
diff --git a/Test/Web/FunctionalTests/TestApps/Aspx45/packages.config b/Test/Web/FunctionalTests/TestApps/Aspx45/packages.config
index 6c6a5b04b..fe5322bb7 100644
--- a/Test/Web/FunctionalTests/TestApps/Aspx45/packages.config
+++ b/Test/Web/FunctionalTests/TestApps/Aspx45/packages.config
@@ -18,7 +18,7 @@
-
+
diff --git a/Test/Web/FunctionalTests/TestApps/Mvc4_MediumTrust/Mvc4_MediumTrust.csproj b/Test/Web/FunctionalTests/TestApps/Mvc4_MediumTrust/Mvc4_MediumTrust.csproj
index aa463e657..a36e7bfa2 100644
--- a/Test/Web/FunctionalTests/TestApps/Mvc4_MediumTrust/Mvc4_MediumTrust.csproj
+++ b/Test/Web/FunctionalTests/TestApps/Mvc4_MediumTrust/Mvc4_MediumTrust.csproj
@@ -66,8 +66,8 @@
..\..\..\..\..\..\packages\Microsoft.ApplicationInsights.2.6.0-beta4\lib\net45\Microsoft.ApplicationInsights.dll
True
-
- ..\..\..\..\..\..\packages\Microsoft.AspNet.TelemetryCorrelation.1.0.1\lib\net45\Microsoft.AspNet.TelemetryCorrelation.dll
+
+ ..\..\..\..\..\..\packages\Microsoft.AspNet.TelemetryCorrelation.1.0.3\lib\net45\Microsoft.AspNet.TelemetryCorrelation.dll
diff --git a/Test/Web/FunctionalTests/TestApps/Mvc4_MediumTrust/Web.config b/Test/Web/FunctionalTests/TestApps/Mvc4_MediumTrust/Web.config
index 91427b04c..b836a9223 100644
--- a/Test/Web/FunctionalTests/TestApps/Mvc4_MediumTrust/Web.config
+++ b/Test/Web/FunctionalTests/TestApps/Mvc4_MediumTrust/Web.config
@@ -106,10 +106,6 @@
-
-
-
-
diff --git a/Test/Web/FunctionalTests/TestApps/Mvc4_MediumTrust/packages.config b/Test/Web/FunctionalTests/TestApps/Mvc4_MediumTrust/packages.config
index 74679329f..ca0645292 100644
--- a/Test/Web/FunctionalTests/TestApps/Mvc4_MediumTrust/packages.config
+++ b/Test/Web/FunctionalTests/TestApps/Mvc4_MediumTrust/packages.config
@@ -16,7 +16,7 @@
-
+
diff --git a/Test/Web/FunctionalTests/TestApps/Wa45Aspx/Wa45Aspx.csproj b/Test/Web/FunctionalTests/TestApps/Wa45Aspx/Wa45Aspx.csproj
index f5da4f67f..dc372984d 100644
--- a/Test/Web/FunctionalTests/TestApps/Wa45Aspx/Wa45Aspx.csproj
+++ b/Test/Web/FunctionalTests/TestApps/Wa45Aspx/Wa45Aspx.csproj
@@ -55,8 +55,8 @@
..\..\..\..\..\..\packages\Microsoft.ApplicationInsights.2.6.0-beta4\lib\net45\Microsoft.ApplicationInsights.dll
True
-
- ..\..\..\..\..\..\packages\Microsoft.AspNet.TelemetryCorrelation.1.0.1\lib\net45\Microsoft.AspNet.TelemetryCorrelation.dll
+
+ ..\..\..\..\..\..\packages\Microsoft.AspNet.TelemetryCorrelation.1.0.3\lib\net45\Microsoft.AspNet.TelemetryCorrelation.dll
diff --git a/Test/Web/FunctionalTests/TestApps/Wa45Aspx/packages.config b/Test/Web/FunctionalTests/TestApps/Wa45Aspx/packages.config
index 7272750e8..421c5b23e 100644
--- a/Test/Web/FunctionalTests/TestApps/Wa45Aspx/packages.config
+++ b/Test/Web/FunctionalTests/TestApps/Wa45Aspx/packages.config
@@ -2,7 +2,7 @@
-
+
diff --git a/Test/Web/FunctionalTests/TestApps/Wcf45Tests/Wcf45Tests.csproj b/Test/Web/FunctionalTests/TestApps/Wcf45Tests/Wcf45Tests.csproj
index 28e72986b..0720e3dcc 100644
--- a/Test/Web/FunctionalTests/TestApps/Wcf45Tests/Wcf45Tests.csproj
+++ b/Test/Web/FunctionalTests/TestApps/Wcf45Tests/Wcf45Tests.csproj
@@ -56,8 +56,8 @@
..\..\..\..\..\..\packages\Microsoft.ApplicationInsights.2.6.0-beta4\lib\net45\Microsoft.ApplicationInsights.dll
True
-
- ..\..\..\..\..\..\packages\Microsoft.AspNet.TelemetryCorrelation.1.0.1\lib\net45\Microsoft.AspNet.TelemetryCorrelation.dll
+
+ ..\..\..\..\..\..\packages\Microsoft.AspNet.TelemetryCorrelation.1.0.3\lib\net45\Microsoft.AspNet.TelemetryCorrelation.dll
diff --git a/Test/Web/FunctionalTests/TestApps/Wcf45Tests/packages.config b/Test/Web/FunctionalTests/TestApps/Wcf45Tests/packages.config
index 1dadf2493..5d237602c 100644
--- a/Test/Web/FunctionalTests/TestApps/Wcf45Tests/packages.config
+++ b/Test/Web/FunctionalTests/TestApps/Wcf45Tests/packages.config
@@ -2,7 +2,7 @@
-
+
diff --git a/Test/Web/FunctionalTests/TestApps/WebAppFW45/WebAppFW45.csproj b/Test/Web/FunctionalTests/TestApps/WebAppFW45/WebAppFW45.csproj
index 02487a2c6..09d14ba00 100644
--- a/Test/Web/FunctionalTests/TestApps/WebAppFW45/WebAppFW45.csproj
+++ b/Test/Web/FunctionalTests/TestApps/WebAppFW45/WebAppFW45.csproj
@@ -59,8 +59,8 @@
..\..\..\..\..\..\packages\Microsoft.ApplicationInsights.2.6.0-beta4\lib\net45\Microsoft.ApplicationInsights.dll
True
-
- ..\..\..\..\..\..\packages\Microsoft.AspNet.TelemetryCorrelation.1.0.1\lib\net45\Microsoft.AspNet.TelemetryCorrelation.dll
+
+ ..\..\..\..\..\..\packages\Microsoft.AspNet.TelemetryCorrelation.1.0.3\lib\net45\Microsoft.AspNet.TelemetryCorrelation.dll
diff --git a/Test/Web/FunctionalTests/TestApps/WebAppFW45/packages.config b/Test/Web/FunctionalTests/TestApps/WebAppFW45/packages.config
index b97713b58..4258476a3 100644
--- a/Test/Web/FunctionalTests/TestApps/WebAppFW45/packages.config
+++ b/Test/Web/FunctionalTests/TestApps/WebAppFW45/packages.config
@@ -2,7 +2,7 @@
-
+
diff --git a/Test/Web/FunctionalTests/TestApps/WebAppFW45Sampled/WebAppFW45Sampled.csproj b/Test/Web/FunctionalTests/TestApps/WebAppFW45Sampled/WebAppFW45Sampled.csproj
index 2d5935866..2626c210c 100644
--- a/Test/Web/FunctionalTests/TestApps/WebAppFW45Sampled/WebAppFW45Sampled.csproj
+++ b/Test/Web/FunctionalTests/TestApps/WebAppFW45Sampled/WebAppFW45Sampled.csproj
@@ -59,8 +59,8 @@
..\..\..\..\..\..\packages\Microsoft.ApplicationInsights.2.6.0-beta4\lib\net45\Microsoft.ApplicationInsights.dll
True
-
- ..\..\..\..\..\..\packages\Microsoft.AspNet.TelemetryCorrelation.1.0.1\lib\net45\Microsoft.AspNet.TelemetryCorrelation.dll
+
+ ..\..\..\..\..\..\packages\Microsoft.AspNet.TelemetryCorrelation.1.0.3\lib\net45\Microsoft.AspNet.TelemetryCorrelation.dll
diff --git a/Test/Web/FunctionalTests/TestApps/WebAppFW45Sampled/packages.config b/Test/Web/FunctionalTests/TestApps/WebAppFW45Sampled/packages.config
index b97713b58..4258476a3 100644
--- a/Test/Web/FunctionalTests/TestApps/WebAppFW45Sampled/packages.config
+++ b/Test/Web/FunctionalTests/TestApps/WebAppFW45Sampled/packages.config
@@ -2,7 +2,7 @@
-
+
diff --git a/runAllFunctionalTests.cmd b/runAllFunctionalTests.cmd
index e11df79b5..3bbfde84f 100644
--- a/runAllFunctionalTests.cmd
+++ b/runAllFunctionalTests.cmd
@@ -16,4 +16,6 @@ CALL "%VSTestPath%" /UseVsixExtensions:true "%BuildRoot%Test\E2ETests\E2ETests\D
CALL "%VSTestPath%" /UseVsixExtensions:true "%BuildRoot%Test\E2ETests\E2ETests\DependencyCollectionTests.dll" /TestCaseFilter:"TestCategory=Net452OnNet462SM" /logger:trx
+CALL "%VSTestPath%" /UseVsixExtensions:true "%BuildRoot%Test\E2ETests\E2ETests\DependencyCollectionTests.dll" /TestCaseFilter:"TestCategory=Net452OnNet471" /logger:trx
+
PAUSE
diff --git a/runFunctionalTestsDependencyCollector.cmd b/runFunctionalTestsDependencyCollector.cmd
index 813d237bb..ed4971953 100644
--- a/runFunctionalTestsDependencyCollector.cmd
+++ b/runFunctionalTestsDependencyCollector.cmd
@@ -12,4 +12,6 @@ CALL "%VSTestPath%" "%BuildRoot%Test\E2ETests\E2ETests\DependencyCollectionTests
CALL "%VSTestPath%" "%BuildRoot%Test\E2ETests\E2ETests\DependencyCollectionTests.dll" /TestCaseFilter:"TestCategory=Net452OnNet462SM" /logger:trx
+CALL "%VSTestPath%" "%BuildRoot%Test\E2ETests\E2ETests\DependencyCollectionTests.dll" /TestCaseFilter:"TestCategory=Net452OnNet471" /logger:trx
+
PAUSE