Skip to content
This repository has been archived by the owner on Jun 10, 2020. It is now read-only.

Commit

Permalink
Merge pull request #881 from microsoft/develop
Browse files Browse the repository at this point in the history
develop to master 2.10.0 stable
  • Loading branch information
Liudmila Molkova committed May 23, 2019
2 parents cc33596 + 7850004 commit 61cb449
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 42 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## Version 2.7.0
- Updated Web/Base SDK version dependency to 2.10.0
- [Remove unused reference to System.Net.Http](https://github.com/microsoft/ApplicationInsights-aspnetcore/pull/879)

## Version 2.7.0-beta4
- [RequestTrackingTelemetryModule is modified to stop tracking exceptions by default, as exceptions are captured by ApplicationInsightsLoggerProvider.](https://github.com/Microsoft/ApplicationInsights-aspnetcore/issues/861)
- Updated Web/Base SDK version dependency to 2.10.0-beta4
Expand Down
8 changes: 4 additions & 4 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ root\
test\
ApplicationInsights.AspNetCore.Tests - Unit tests
FunctionalTestUtils - Test utilities for functional tests
MVCFramework.FunctionalTests - functional tests for MVC application targetting NetCore1.1,NetCore2.0 and NET45
WebApi.FunctionalTests - functional tests for Web API application targetting NetCore1.1,NetCore2.0 and NET45
EmptyApp.FunctionalTests - functional tests for an Empty application targetting NetCore1.1,NetCore2.0 and NET45
MVCFramework.FunctionalTests - functional tests for MVC application targeting NetCore1.1,NetCore2.0 and NET45
WebApi.FunctionalTests - functional tests for Web API application targeting NetCore1.1,NetCore2.0 and NET45
EmptyApp.FunctionalTests - functional tests for an Empty application targeting NetCore1.1,NetCore2.0 and NET45
PerfTest - performance test
```

Expand All @@ -57,7 +57,7 @@ Execute the ```RunTests.cmd``` script in the repository root.

You can also open the solution in Visual Studio and run tests directly from Visual Studio Test Explorer. However, as the tests has multiple targets, Test Explorer only shows the first target
from <TargetFrameworks> in .csproj. To debug/run tests from a particular TargetFramework with Visual Studio, only option is to re-arrange the <TargetFrameworks>
such that the intented target comes first. This is a Visual Studio limitation and is likely removed in the future.
such that the intended target comes first. This is a Visual Studio limitation and is likely removed in the future.


Running and writing tests
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using System.Diagnostics;
using System.Globalization;
using System.Linq;
using System.Net.Http.Headers;
using System.Text;
using Extensibility.Implementation.Tracing;
using Microsoft.ApplicationInsights.AspNetCore.DiagnosticListeners.Implementation;
Expand Down Expand Up @@ -550,10 +549,11 @@ private void ReadCorrelationContext(IHeaderDictionary requestHeaders, Activity a
{
foreach (var item in baggage)
{
if (NameValueHeaderValue.TryParse(item, out var baggageItem))
var parts = item.Split('=');
if (parts.Length == 2)
{
var itemName = StringUtilities.EnforceMaxLength(baggageItem.Name, InjectionGuardConstants.ContextHeaderKeyMaxLength);
var itemValue = StringUtilities.EnforceMaxLength(baggageItem.Value, InjectionGuardConstants.ContextHeaderValueMaxLength);
var itemName = StringUtilities.EnforceMaxLength(parts[0], InjectionGuardConstants.ContextHeaderKeyMaxLength);
var itemValue = StringUtilities.EnforceMaxLength(parts[1], InjectionGuardConstants.ContextHeaderValueMaxLength);
activity.AddBaggage(itemName, itemValue);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,6 @@ namespace Microsoft.ApplicationInsights.AspNetCore.DiagnosticListeners

internal static class HttpHeadersUtilities
{
internal static IEnumerable<string> GetHeaderValues(HttpHeaders headers, string headerName)
{
IEnumerable<string> result;
if (headers == null || !headers.TryGetValues(headerName, out result))
{
result = Enumerable.Empty<string>();
}
return result;
}

internal static IEnumerable<string> GetHeaderValues(IHeaderDictionary headers, string headerName)
{
IEnumerable<string> result = Enumerable.Empty<string>();
Expand All @@ -33,33 +23,17 @@ internal static IEnumerable<string> GetHeaderValues(IHeaderDictionary headers, s
return result;
}

internal static string GetHeaderKeyValue(HttpHeaders headers, string headerName, string keyName)
{
IEnumerable<string> headerValues = GetHeaderValues(headers, headerName);
return HeadersUtilities.GetHeaderKeyValue(headerValues, keyName);
}

internal static string GetHeaderKeyValue(IHeaderDictionary headers, string headerName, string keyName)
{
IEnumerable<string> headerValues = GetHeaderValues(headers, headerName);
return HeadersUtilities.GetHeaderKeyValue(headerValues, keyName);
}

internal static string GetRequestContextKeyValue(HttpHeaders headers, string keyName)
{
return GetHeaderKeyValue(headers, RequestResponseHeaders.RequestContextHeader, keyName);
}

internal static string GetRequestContextKeyValue(IHeaderDictionary headers, string keyName)
{
return GetHeaderKeyValue(headers, RequestResponseHeaders.RequestContextHeader, keyName);
}

internal static bool ContainsRequestContextKeyValue(HttpHeaders headers, string keyName)
{
return !string.IsNullOrEmpty(GetHeaderKeyValue(headers, RequestResponseHeaders.RequestContextHeader, keyName));
}

internal static bool ContainsRequestContextKeyValue(IHeaderDictionary headers, string keyName)
{
return !string.IsNullOrEmpty(GetHeaderKeyValue(headers, RequestResponseHeaders.RequestContextHeader, keyName));
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<AssemblyName>Microsoft.ApplicationInsights.AspNetCore</AssemblyName>
<VersionPrefix>2.7.0-beta4</VersionPrefix>
<VersionPrefix>2.7.0</VersionPrefix>
<Authors>Microsoft</Authors>
<Copyright>© Microsoft Corporation. All rights reserved.</Copyright>
<AssemblyTitle>Application Insights for ASP.NET Core Web Applications</AssemblyTitle>
Expand Down Expand Up @@ -81,11 +81,11 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.ApplicationInsights" Version="2.10.0-beta4" />
<PackageReference Include="Microsoft.ApplicationInsights.DependencyCollector" Version="2.10.0-beta4" />
<PackageReference Include="Microsoft.ApplicationInsights.PerfCounterCollector" Version="2.10.0-beta4" />
<PackageReference Include="Microsoft.ApplicationInsights.WindowsServer" Version="2.10.0-beta4" />
<PackageReference Include="Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel" Version="2.10.0-beta4" />
<PackageReference Include="Microsoft.ApplicationInsights" Version="2.10.0" />
<PackageReference Include="Microsoft.ApplicationInsights.DependencyCollector" Version="2.10.0" />
<PackageReference Include="Microsoft.ApplicationInsights.PerfCounterCollector" Version="2.10.0" />
<PackageReference Include="Microsoft.ApplicationInsights.WindowsServer" Version="2.10.0" />
<PackageReference Include="Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel" Version="2.10.0" />
<PackageReference Include="Microsoft.AspNetCore.Hosting" Version="1.0.2" />
<PackageReference Include="System.Text.Encodings.Web" Version="4.3.1" />
</ItemGroup>
Expand All @@ -97,12 +97,11 @@

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="2.1.0" />
<PackageReference Include="Microsoft.Extensions.Logging.ApplicationInsights" Version="2.10.0-beta4" />
<PackageReference Include="Microsoft.Extensions.Logging.ApplicationInsights" Version="2.10.0" />
<PackageReference Include="System.Text.Encodings.Web" Version="4.3.1" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net451' OR '$(TargetFramework)' == 'net46' ">
<PackageReference Include="System.Net.Http" Version="4.3.2" />
<Reference Include="System" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>
Expand Down

0 comments on commit 61cb449

Please sign in to comment.