This commit is contained in:
Expecho 2020-07-16 16:32:13 +02:00
Родитель ecd1afd71f 0a9d12ea84
Коммит bccfabd3a1
234 изменённых файлов: 1080 добавлений и 492 удалений

Просмотреть файл

@ -0,0 +1,4 @@
Microsoft.ApplicationInsights.WindowsServer.AppServicesHeartbeatTelemetryModule.HeartbeatPropertyManager.get -> Microsoft.ApplicationInsights.Extensibility.Implementation.Tracing.IHeartbeatPropertyManager
Microsoft.ApplicationInsights.WindowsServer.AppServicesHeartbeatTelemetryModule.HeartbeatPropertyManager.set -> void
Microsoft.ApplicationInsights.WindowsServer.AzureInstanceMetadataTelemetryModule.HeartbeatPropertyManager.get -> Microsoft.ApplicationInsights.Extensibility.Implementation.Tracing.IHeartbeatPropertyManager
Microsoft.ApplicationInsights.WindowsServer.AzureInstanceMetadataTelemetryModule.HeartbeatPropertyManager.set -> void

Просмотреть файл

@ -0,0 +1,4 @@
Microsoft.ApplicationInsights.WindowsServer.AppServicesHeartbeatTelemetryModule.HeartbeatPropertyManager.get -> Microsoft.ApplicationInsights.Extensibility.Implementation.Tracing.IHeartbeatPropertyManager
Microsoft.ApplicationInsights.WindowsServer.AppServicesHeartbeatTelemetryModule.HeartbeatPropertyManager.set -> void
Microsoft.ApplicationInsights.WindowsServer.AzureInstanceMetadataTelemetryModule.HeartbeatPropertyManager.get -> Microsoft.ApplicationInsights.Extensibility.Implementation.Tracing.IHeartbeatPropertyManager
Microsoft.ApplicationInsights.WindowsServer.AzureInstanceMetadataTelemetryModule.HeartbeatPropertyManager.set -> void

Просмотреть файл

@ -0,0 +1,4 @@
Microsoft.ApplicationInsights.AspNetCore.Extensions.ApplicationInsightsServiceOptions.EnableDiagnosticsTelemetryModule.get -> bool
Microsoft.ApplicationInsights.AspNetCore.Extensions.ApplicationInsightsServiceOptions.EnableDiagnosticsTelemetryModule.set -> void
Microsoft.ApplicationInsights.AspNetCore.Extensions.ApplicationInsightsServiceOptions.EnableActiveTelemetryConfigurationSetup.get -> bool
Microsoft.ApplicationInsights.AspNetCore.Extensions.ApplicationInsightsServiceOptions.EnableActiveTelemetryConfigurationSetup.set -> void

Просмотреть файл

@ -0,0 +1,4 @@
Microsoft.ApplicationInsights.AspNetCore.Extensions.ApplicationInsightsServiceOptions.EnableDiagnosticsTelemetryModule.get -> bool
Microsoft.ApplicationInsights.AspNetCore.Extensions.ApplicationInsightsServiceOptions.EnableDiagnosticsTelemetryModule.set -> void
Microsoft.ApplicationInsights.AspNetCore.Extensions.ApplicationInsightsServiceOptions.EnableActiveTelemetryConfigurationSetup.get -> bool
Microsoft.ApplicationInsights.AspNetCore.Extensions.ApplicationInsightsServiceOptions.EnableActiveTelemetryConfigurationSetup.set -> void

Просмотреть файл

@ -0,0 +1,4 @@
Microsoft.ApplicationInsights.AspNetCore.Extensions.ApplicationInsightsServiceOptions.EnableDiagnosticsTelemetryModule.get -> bool
Microsoft.ApplicationInsights.AspNetCore.Extensions.ApplicationInsightsServiceOptions.EnableDiagnosticsTelemetryModule.set -> void
Microsoft.ApplicationInsights.AspNetCore.Extensions.ApplicationInsightsServiceOptions.EnableActiveTelemetryConfigurationSetup.get -> bool
Microsoft.ApplicationInsights.AspNetCore.Extensions.ApplicationInsightsServiceOptions.EnableActiveTelemetryConfigurationSetup.set -> void

Просмотреть файл

@ -0,0 +1,4 @@
Microsoft.ApplicationInsights.AspNetCore.Extensions.ApplicationInsightsServiceOptions.EnableDiagnosticsTelemetryModule.get -> bool
Microsoft.ApplicationInsights.AspNetCore.Extensions.ApplicationInsightsServiceOptions.EnableDiagnosticsTelemetryModule.set -> void
Microsoft.ApplicationInsights.AspNetCore.Extensions.ApplicationInsightsServiceOptions.EnableActiveTelemetryConfigurationSetup.get -> bool
Microsoft.ApplicationInsights.AspNetCore.Extensions.ApplicationInsightsServiceOptions.EnableActiveTelemetryConfigurationSetup.set -> void

Просмотреть файл

@ -0,0 +1,2 @@
Microsoft.ApplicationInsights.WorkerService.ApplicationInsightsServiceOptions.EnableDiagnosticsTelemetryModule.get -> bool
Microsoft.ApplicationInsights.WorkerService.ApplicationInsightsServiceOptions.EnableDiagnosticsTelemetryModule.set -> void

Просмотреть файл

Просмотреть файл

@ -6,7 +6,7 @@
<Company>Microsoft</Company> <Company>Microsoft</Company>
<Copyright>Copyright © Microsoft. All Rights Reserved.</Copyright> <Copyright>Copyright © Microsoft. All Rights Reserved.</Copyright>
<TargetFrameworks>net45;netstandard2.0</TargetFrameworks> <TargetFrameworks>net452;netstandard2.0</TargetFrameworks>
<TargetFrameworks Condition="$(OS) != 'Windows_NT'">netstandard2.0</TargetFrameworks> <TargetFrameworks Condition="$(OS) != 'Windows_NT'">netstandard2.0</TargetFrameworks>
<ProjectGuid>{4B0BC3B7-C7FC-4333-9E28-5790D9153F07}</ProjectGuid> <ProjectGuid>{4B0BC3B7-C7FC-4333-9E28-5790D9153F07}</ProjectGuid>

Просмотреть файл

@ -20,14 +20,14 @@
} }
[TestMethod] [TestMethod]
[ExpectedException(typeof(ArgumentNullException))] [ExpectedException(typeof(ArgumentException), "There was an error parsing the Connection String: Input cannot be null.")]
public void TestParseConnectionString_Null() public void TestParseConnectionString_Null()
{ {
EndpointProvider.ParseConnectionString(null); EndpointProvider.ParseConnectionString(null);
} }
[TestMethod] [TestMethod]
[ExpectedException(typeof(ArgumentException))] [ExpectedException(typeof(ArgumentException), "There was an error parsing the Connection String: Input cannot be empty.")]
public void TestParseConnectionString_Empty() public void TestParseConnectionString_Empty()
{ {
EndpointProvider.ParseConnectionString(""); EndpointProvider.ParseConnectionString("");
@ -36,7 +36,7 @@
[TestMethod] [TestMethod]
public void TestParseConnectionString() public void TestParseConnectionString()
{ {
var test = EndpointProvider.ParseConnectionString("key1=value1;key2=value2;key3=value3"); var test = (Dictionary<string, string>)EndpointProvider.ParseConnectionString("key1=value1;key2=value2;key3=value3");
var expected = new Dictionary<string, string> var expected = new Dictionary<string, string>
{ {
@ -51,7 +51,7 @@
[TestMethod] [TestMethod]
public void TestParseConnectionString_WithTrailingSemicolon() public void TestParseConnectionString_WithTrailingSemicolon()
{ {
var test = EndpointProvider.ParseConnectionString("key1=value1;key2=value2;key3=value3;"); var test = (Dictionary<string, string>)EndpointProvider.ParseConnectionString("key1=value1;key2=value2;key3=value3;");
var expected = new Dictionary<string, string> var expected = new Dictionary<string, string>
{ {
@ -66,7 +66,7 @@
[TestMethod] [TestMethod]
public void TestParseConnectionString_WithExtraSpaces() public void TestParseConnectionString_WithExtraSpaces()
{ {
var test = EndpointProvider.ParseConnectionString(" key1 = value1 ; key2 = value2 ; key3 =value3 "); var test = (Dictionary<string, string>)EndpointProvider.ParseConnectionString(" key1 = value1 ; key2 = value2 ; key3 =value3 ");
var expected = new Dictionary<string, string> var expected = new Dictionary<string, string>
{ {
@ -85,7 +85,7 @@
[TestMethod] [TestMethod]
public void VerifyConnectionStringDictionary_IsCaseInsensitive() public void VerifyConnectionStringDictionary_IsCaseInsensitive()
{ {
var test = EndpointProvider.ParseConnectionString("UPPERCASE=value1;lowercase=value2;MixedCase=value3"); var test = (Dictionary<string, string>)EndpointProvider.ParseConnectionString("UPPERCASE=value1;lowercase=value2;MixedCase=value3");
var expected = new Dictionary<string, string> var expected = new Dictionary<string, string>
{ {
@ -105,28 +105,28 @@
} }
[TestMethod] [TestMethod]
[ExpectedExceptionWithMessage(typeof(ArgumentException), "Connection String Invalid: Contains duplicate key: 'key1'.")] [ExpectedExceptionWithMessage(typeof(ArgumentException), "There was an error parsing the Connection String: Input cannot contain duplicate keys. Duplicate key: 'key1'.")]
public void TestParseConnectionString_DuplaceKeys() public void TestParseConnectionString_DuplaceKeys()
{ {
EndpointProvider.ParseConnectionString("key1=value1;key1=value2"); EndpointProvider.ParseConnectionString("key1=value1;key1=value2");
} }
[TestMethod] [TestMethod]
[ExpectedExceptionWithMessage(typeof(ArgumentException), "Connection String Invalid: Contains duplicate key: 'key1'.")] [ExpectedExceptionWithMessage(typeof(ArgumentException), "There was an error parsing the Connection String: Input cannot contain duplicate keys. Duplicate key: 'key1'.")]
public void TestParseConnectionString_DuplaceKeysWithSpaces() public void TestParseConnectionString_DuplaceKeysWithSpaces()
{ {
EndpointProvider.ParseConnectionString("key1=value1;key1 =value2"); EndpointProvider.ParseConnectionString("key1=value1;key1 =value2");
} }
[TestMethod] [TestMethod]
[ExpectedExceptionWithMessage(typeof(ArgumentException), "Connection String Invalid: Unexpected delimiter can not be parsed. Expected: 'key1=value1;key2=value2;key3=value3'")] [ExpectedExceptionWithMessage(typeof(ArgumentException), "There was an error parsing the Connection String: Input contains invalid delimiters and cannot be parsed. Expected example: 'key1=value1;key2=value2;key3=value3'.")]
public void TestParseConnectionString_InvalidDelimiters() public void TestParseConnectionString_InvalidDelimiters()
{ {
EndpointProvider.ParseConnectionString("key1;key2=value2"); EndpointProvider.ParseConnectionString("key1;key2=value2");
} }
[TestMethod] [TestMethod]
[ExpectedExceptionWithMessage(typeof(ArgumentException), "Connection String Invalid: Unexpected delimiter can not be parsed. Expected: 'key1=value1;key2=value2;key3=value3'")] [ExpectedExceptionWithMessage(typeof(ArgumentException), "There was an error parsing the Connection String: Input contains invalid delimiters and cannot be parsed. Expected example: 'key1=value1;key2=value2;key3=value3'.")]
public void TestParseConnectionString_InvalidCharInValue() public void TestParseConnectionString_InvalidCharInValue()
{ {
EndpointProvider.ParseConnectionString("key1=value1=value2"); EndpointProvider.ParseConnectionString("key1=value1=value2");

Просмотреть файл

@ -527,7 +527,7 @@
Assert.IsNotNull(actualEvent); Assert.IsNotNull(actualEvent);
Assert.AreEqual(client.InstrumentationKey, actualEvent.Payload[0]); Assert.AreEqual(client.InstrumentationKey, actualEvent.Payload[0]);
#if !NET45 #if !NET452
// adding logging to confirm what executable is being tested. // adding logging to confirm what executable is being tested.
var sdkAssembly = AppDomain.CurrentDomain.GetAssemblies().Single(x => x.GetName().Name == "Microsoft.ApplicationInsights"); var sdkAssembly = AppDomain.CurrentDomain.GetAssemblies().Single(x => x.GetName().Name == "Microsoft.ApplicationInsights");
var sdkVersion = sdkAssembly.GetName().Version.ToString(); var sdkVersion = sdkAssembly.GetName().Version.ToString();
@ -686,7 +686,7 @@
private static void VerifyOperationEvent(OperationTelemetry expectedOperation, string expectedName, EventOpcode expectedOpCode, EventWrittenEventArgs actualEvent) private static void VerifyOperationEvent(OperationTelemetry expectedOperation, string expectedName, EventOpcode expectedOpCode, EventWrittenEventArgs actualEvent)
{ {
Assert.AreEqual(expectedOpCode, actualEvent.Opcode); Assert.AreEqual(expectedOpCode, actualEvent.Opcode);
#if !NET45 #if !NET452
Assert.AreEqual(expectedName, actualEvent.EventName); Assert.AreEqual(expectedName, actualEvent.EventName);
#endif #endif
VerifyOperationPayload(expectedOperation, actualEvent.Payload); VerifyOperationPayload(expectedOperation, actualEvent.Payload);

Просмотреть файл

@ -94,7 +94,7 @@
[TestClass] [TestClass]
public class Start public class Start
{ {
#if NET45 #if NET452
[TestMethod] [TestMethod]
public void DoesNotLogErrorsIfCallbackReturnsNull() public void DoesNotLogErrorsIfCallbackReturnsNull()
{ {

Просмотреть файл

@ -2,7 +2,7 @@
<Import Project="$(PropsRoot)\Test.props" /> <Import Project="$(PropsRoot)\Test.props" />
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>net45;net46;netcoreapp2.1;netcoreapp3.1</TargetFrameworks> <TargetFrameworks>net452;net46;netcoreapp2.1;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks Condition="$(OS) != 'Windows_NT'">netcoreapp2.1;netcoreapp3.1</TargetFrameworks> <TargetFrameworks Condition="$(OS) != 'Windows_NT'">netcoreapp2.1;netcoreapp3.1</TargetFrameworks>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
</PropertyGroup> </PropertyGroup>
@ -27,11 +27,11 @@
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="4.6.0" /> <PackageReference Include="System.Diagnostics.DiagnosticSource" Version="4.6.0" />
</ItemGroup> </ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net45'"> <ItemGroup Condition="'$(TargetFramework)' == 'net452' ">
<PackageReference Include="System.Runtime.InteropServices.RuntimeInformation" Version="4.3.0" /> <PackageReference Include="System.Runtime.InteropServices.RuntimeInformation" Version="4.3.0" />
</ItemGroup> </ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net45' Or '$(TargetFramework)' == 'net46'"> <ItemGroup Condition="'$(TargetFramework)' == 'net452' Or '$(TargetFramework)' == 'net46'">
<PackageReference Include="Microsoft.Diagnostics.Tracing.TraceEvent" Version="2.0.30" /> <PackageReference Include="Microsoft.Diagnostics.Tracing.TraceEvent" Version="2.0.30" />
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp" />

Просмотреть файл

@ -3,7 +3,7 @@
<PropertyGroup> <PropertyGroup>
<ProjectGuid>{21CB9A8A-F25B-4DEB-92CB-ACB6920EB8BC}</ProjectGuid> <ProjectGuid>{21CB9A8A-F25B-4DEB-92CB-ACB6920EB8BC}</ProjectGuid>
<TargetFrameworks>net45</TargetFrameworks> <TargetFrameworks>net452</TargetFrameworks>
<AssemblyName>TelemetryChannel.Nuget.Tests</AssemblyName> <AssemblyName>TelemetryChannel.Nuget.Tests</AssemblyName>
</PropertyGroup> </PropertyGroup>

Просмотреть файл

@ -298,7 +298,7 @@
localAppData.Delete(true); localAppData.Delete(true);
} }
#if !NET45 #if !NET452
[TestMethod] [TestMethod]
public void GetApplicationFolderReturnsSubfolderFromTmpDirFolderInNonWindows() public void GetApplicationFolderReturnsSubfolderFromTmpDirFolderInNonWindows()

Просмотреть файл

@ -2,7 +2,7 @@
<Import Project="$(PropsRoot)\Test.props" /> <Import Project="$(PropsRoot)\Test.props" />
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>net45;netcoreapp2.1;netcoreapp3.1</TargetFrameworks> <TargetFrameworks>net452;netcoreapp2.1;netcoreapp3.1</TargetFrameworks>
<TargetFrameworks Condition="$(OS) != 'Windows_NT'">netcoreapp2.1;netcoreapp3.1</TargetFrameworks> <TargetFrameworks Condition="$(OS) != 'Windows_NT'">netcoreapp2.1;netcoreapp3.1</TargetFrameworks>
<AssemblyName>Microsoft.ApplicationInsights.TelemetryChannel.Tests</AssemblyName> <AssemblyName>Microsoft.ApplicationInsights.TelemetryChannel.Tests</AssemblyName>
@ -34,7 +34,7 @@
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="2.2.0" /> <PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="2.2.0" />
</ItemGroup> </ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net45'"> <ItemGroup Condition="'$(TargetFramework)' == 'net452'">
<PackageReference Include="System.Runtime.InteropServices.RuntimeInformation" Version="4.3.0" /> <PackageReference Include="System.Runtime.InteropServices.RuntimeInformation" Version="4.3.0" />
<Reference Include="System.Web" /> <Reference Include="System.Web" />
<Reference Include="System.Net.Http" /> <Reference Include="System.Net.Http" />

Просмотреть файл

@ -14,13 +14,13 @@
private readonly Type exceptionType; private readonly Type exceptionType;
private readonly string expectedMessage; private readonly string expectedMessage;
public ExpectedExceptionWithMessageAttribute(Type exceptionType) : this(exceptionType, null) public ExpectedExceptionWithMessageAttribute(Type expectedType) : this(expectedType, null)
{ {
} }
public ExpectedExceptionWithMessageAttribute(Type exceptionType, string expectedMessage) public ExpectedExceptionWithMessageAttribute(Type expectedType, string expectedMessage)
{ {
this.exceptionType = exceptionType; this.exceptionType = expectedType;
this.expectedMessage = expectedMessage; this.expectedMessage = expectedMessage;
} }
@ -28,12 +28,12 @@
{ {
if (ex.GetType() != this.exceptionType) if (ex.GetType() != this.exceptionType)
{ {
Assert.Fail($"Test method threw exception {this.exceptionType.FullName}, but exception {ex.GetType().FullName} was expected. Exception message: {ex.Message}"); Assert.Fail($"Test method threw exception '{ex.GetType().FullName}', but exception '{this.exceptionType.FullName}' was expected. Actual exception message: '{ex.Message}'");
} }
if (this.expectedMessage != null && this.expectedMessage != ex.Message) if (this.expectedMessage != null && this.expectedMessage != ex.Message)
{ {
Assert.Fail($"Test method threw the expected exception type, but with an unexpected message: {ex.Message}"); Assert.Fail($"Test method threw the expected exception type, but with an unexpected message: '{ex.Message}'");
} }
Console.Write("ExpectedExceptionWithMessageAttribute:" + ex.Message); Console.Write("ExpectedExceptionWithMessageAttribute:" + ex.Message);

Просмотреть файл

@ -0,0 +1,17 @@
namespace Microsoft.ApplicationInsights.TestFramework
{
using System.Collections.Generic;
/// <summary>
/// This class can be used to mock environment variables
/// </summary>
internal class StubEnvironmentVariablePlatform : StubPlatform
{
private readonly Dictionary<string, string> environmentVariables = new Dictionary<string, string>();
public void SetEnvironmentVariable(string name, string value) => this.environmentVariables.Add(name, value);
public override bool TryGetEnvironmentVariable(string name, out string value) => this.environmentVariables.TryGetValue(name, out value);
}
}

Просмотреть файл

@ -2,7 +2,7 @@
{ {
using System; using System;
#if NET45 #if NET452
[Serializable] [Serializable]
#endif #endif
internal class StubException : Exception internal class StubException : Exception

Просмотреть файл

@ -22,7 +22,7 @@
return this.OnGetDebugOutput(); return this.OnGetDebugOutput();
} }
public bool TryGetEnvironmentVariable(string name, out string value) public virtual bool TryGetEnvironmentVariable(string name, out string value)
{ {
value = string.Empty; value = string.Empty;

Просмотреть файл

@ -13,7 +13,7 @@
/// </summary> /// </summary>
internal sealed class TaskExceptionObserver : IDisposable internal sealed class TaskExceptionObserver : IDisposable
{ {
#if NET45 #if NET452
private static readonly MethodInfo GetScheduledTasksMethod = typeof(TaskScheduler).GetMethod("GetScheduledTasks", BindingFlags.Instance | BindingFlags.NonPublic); private static readonly MethodInfo GetScheduledTasksMethod = typeof(TaskScheduler).GetMethod("GetScheduledTasks", BindingFlags.Instance | BindingFlags.NonPublic);
#endif #endif
private List<AggregateException> unobservedExceptions = new List<AggregateException>(); private List<AggregateException> unobservedExceptions = new List<AggregateException>();
@ -37,7 +37,7 @@
private static void WaitForCurrentTasksToFinish() private static void WaitForCurrentTasksToFinish()
{ {
#if NET45 #if NET452
IEnumerable<Task> scheduledTasks; IEnumerable<Task> scheduledTasks;
do do
{ {

Просмотреть файл

@ -6,13 +6,13 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics.Tracing; using System.Diagnostics.Tracing;
using System.Threading; using System.Threading;
#if NET45 #if NET452
using System.Runtime.Remoting.Messaging; using System.Runtime.Remoting.Messaging;
#endif #endif
internal class TestEventListener : EventListener internal class TestEventListener : EventListener
{ {
#if NET45 #if NET452
public static class CurrentContextEvents public static class CurrentContextEvents
{ {

Просмотреть файл

@ -16,6 +16,7 @@
<Compile Include="$(MSBuildThisFileDirectory)EventSourceTest.cs" /> <Compile Include="$(MSBuildThisFileDirectory)EventSourceTest.cs" />
<Compile Include="$(MSBuildThisFileDirectory)ExpectedExceptionWithMessageAttribute.cs" /> <Compile Include="$(MSBuildThisFileDirectory)ExpectedExceptionWithMessageAttribute.cs" />
<Compile Include="$(MSBuildThisFileDirectory)MockProcessorModule.cs" /> <Compile Include="$(MSBuildThisFileDirectory)MockProcessorModule.cs" />
<Compile Include="$(MSBuildThisFileDirectory)StubEnvironmentVariablePlatform.cs" />
<Compile Include="$(MSBuildThisFileDirectory)StubException.cs" /> <Compile Include="$(MSBuildThisFileDirectory)StubException.cs" />
<Compile Include="$(MSBuildThisFileDirectory)StubSynchronizationContext.cs" /> <Compile Include="$(MSBuildThisFileDirectory)StubSynchronizationContext.cs" />
<Compile Include="$(MSBuildThisFileDirectory)StubSerializableTelemetry.cs" /> <Compile Include="$(MSBuildThisFileDirectory)StubSerializableTelemetry.cs" />

Просмотреть файл

@ -9,6 +9,7 @@
<Import_RootNamespace>Microsoft.ApplicationInsights.Common</Import_RootNamespace> <Import_RootNamespace>Microsoft.ApplicationInsights.Common</Import_RootNamespace>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Compile Include="$(MSBuildThisFileDirectory)Extensions\DateTimeExtensions.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Extensions\ExceptionExtensions.cs" /> <Compile Include="$(MSBuildThisFileDirectory)Extensions\ExceptionExtensions.cs" />
<Compile Include="$(MSBuildThisFileDirectory)InterlockedThrottle.cs" /> <Compile Include="$(MSBuildThisFileDirectory)InterlockedThrottle.cs" />
</ItemGroup> </ItemGroup>

Просмотреть файл

@ -0,0 +1,20 @@
namespace Microsoft.ApplicationInsights.Common.Extensions
{
using System;
using System.Globalization;
/// <summary>
/// Provides extension methods for <see cref="DateTime"/>.
/// </summary>
internal static class DateTimeExtensions
{
/// <summary>
/// This is a proxy method to <see cref="DateTime.ToString(string, IFormatProvider)"/>.
/// Converts the value of the current System.DateTime object to its equivalent string representation using the specified format and CultureInfo.InvariantCulture.
/// </summary>
/// <param name="input">The date and time value to convert to string.</param>
/// <param name="format">A standard or custom date and time format string.</param>
/// <returns>A string representation of value of the current System.DateTime object as specified by format and provider.</returns>
public static string ToInvariantString(this DateTime input, string format) => input.ToString(format, CultureInfo.InvariantCulture);
}
}

Просмотреть файл

@ -1,6 +1,6 @@
namespace Microsoft.ApplicationInsights.Extensibility.Implementation namespace Microsoft.ApplicationInsights.Extensibility.Implementation
{ {
#if NET45 #if NET452
using System; using System;
using System.Globalization; using System.Globalization;
using System.Runtime.Remoting; using System.Runtime.Remoting;

Просмотреть файл

@ -0,0 +1,70 @@
namespace Microsoft.ApplicationInsights.Extensibility.Implementation.ConfigString
{
using System;
using System.Collections.Generic;
using Microsoft.ApplicationInsights.Extensibility.Implementation.Tracing;
using static System.FormattableString;
/// <summary>
/// Helper class to parse a configuration string.
/// A configuration string is defined as a string composed of key/value pairs.
/// (ex: "key1=value1;key2=value2;key3=value3").
/// </summary>
internal static class ConfigStringParser
{
private static readonly char[] SplitSemicolon = new char[] { ';' };
/// <summary>
/// Parse a given string and return a dictionary of the key/value pairs.
/// This method will do some validation and throw exceptions if the input string does not conform to the definition of a configuration string.
/// </summary>
/// <param name="configString">Input string to be parsed. This string cannot be null or empty. This string will be checked for validity.</param>
/// <returns>Returns a dictionary of Key/Value pairs. Keys are not case sensitive.</returns>
/// <remarks>This is used by both Connection Strings and Self-Diagnostics configuration.</remarks>
public static IDictionary<string, string> Parse(string configString)
{
if (configString == null)
{
string message = "Input cannot be null.";
CoreEventSource.Log.ConfigurationStringParseWarning(message);
throw new ArgumentNullException(message);
}
else if (string.IsNullOrWhiteSpace(configString))
{
string message = Invariant($"Input cannot be empty.");
CoreEventSource.Log.ConfigurationStringParseWarning(message);
throw new ArgumentException(message);
}
var keyValuePairs = configString.Split(SplitSemicolon, StringSplitOptions.RemoveEmptyEntries);
var dictionary = new Dictionary<string, string>(keyValuePairs.Length, StringComparer.OrdinalIgnoreCase);
foreach (var pair in keyValuePairs)
{
var keyAndValue = pair.Split('=');
if (keyAndValue.Length != 2)
{
string message = Invariant($"Input contains invalid delimiters and cannot be parsed. Expected example: 'key1=value1;key2=value2;key3=value3'.");
CoreEventSource.Log.ConfigurationStringParseWarning(message);
throw new ArgumentException(message);
}
var key = keyAndValue[0].Trim();
var value = keyAndValue[1].Trim();
if (dictionary.ContainsKey(key))
{
string message = Invariant($"Input cannot contain duplicate keys. Duplicate key: '{key}'.");
CoreEventSource.Log.ConfigurationStringParseWarning(message);
throw new ArgumentException(message);
}
dictionary.Add(key, value);
}
return dictionary;
}
}
}

Просмотреть файл

@ -2,8 +2,9 @@
{ {
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Globalization;
using System.Linq; using System.Linq;
using Microsoft.ApplicationInsights.Extensibility.Implementation.ConfigString;
using Microsoft.ApplicationInsights.Extensibility.Implementation.Tracing; using Microsoft.ApplicationInsights.Extensibility.Implementation.Tracing;
/// <summary> /// <summary>
@ -22,12 +23,10 @@
/// </remarks> /// </remarks>
internal const int ConnectionStringMaxLength = 4096; internal const int ConnectionStringMaxLength = 4096;
private static readonly char[] SplitSemicolon = new char[] { ';' };
private static readonly char[] TrimPeriod = new char[] { '.' }; private static readonly char[] TrimPeriod = new char[] { '.' };
private string connectionString; private string connectionString;
private Dictionary<string, string> connectionStringParsed = new Dictionary<string, string>(0); private IDictionary<string, string> connectionStringParsed = new Dictionary<string, string>(0);
/// <summary> /// <summary>
/// Gets or sets the connection string. /// Gets or sets the connection string.
@ -129,46 +128,18 @@
/// </summary> /// </summary>
/// <remarks>Example: "key1=value1;key2=value2;key3=value3".</remarks> /// <remarks>Example: "key1=value1;key2=value2;key3=value3".</remarks>
/// <returns>A dictionary parsed from the input connection string.</returns> /// <returns>A dictionary parsed from the input connection string.</returns>
internal static Dictionary<string, string> ParseConnectionString(string connectionString) internal static IDictionary<string, string> ParseConnectionString(string connectionString)
{ {
if (connectionString == null) try
{ {
CoreEventSource.Log.ConnectionStringNull(); return ConfigStringParser.Parse(connectionString);
throw new ArgumentNullException(nameof(connectionString));
} }
catch (Exception ex)
var keyValuePairs = connectionString.Split(SplitSemicolon, StringSplitOptions.RemoveEmptyEntries);
if (keyValuePairs.Length == 0)
{ {
CoreEventSource.Log.ConnectionStringEmpty(); string message = "There was an error parsing the Connection String: " + ex.Message;
throw new ArgumentException("Connection string cannot be empty."); CoreEventSource.Log.ConnectionStringParseError(message);
throw new ArgumentException(message, ex);
} }
var dictionary = new Dictionary<string, string>(keyValuePairs.Length, StringComparer.OrdinalIgnoreCase);
foreach (var pair in keyValuePairs)
{
var keyAndValue = pair.Split('=');
if (keyAndValue.Length != 2)
{
CoreEventSource.Log.ConnectionStringInvalidDelimiters();
throw new ArgumentException("Connection String Invalid: Unexpected delimiter can not be parsed. Expected: 'key1=value1;key2=value2;key3=value3'");
}
var key = keyAndValue[0].Trim();
var value = keyAndValue[1].Trim();
if (dictionary.ContainsKey(key))
{
CoreEventSource.Log.ConnectionStringDuplicateKey();
throw new ArgumentException(FormattableString.Invariant($"Connection String Invalid: Contains duplicate key: '{key}'."));
}
dictionary.Add(key, value);
}
return dictionary;
} }
/// <summary> /// <summary>

Просмотреть файл

@ -1,7 +1,7 @@
namespace Microsoft.ApplicationInsights.Extensibility.Implementation.External namespace Microsoft.ApplicationInsights.Extensibility.Implementation.External
{ {
#if NET45 #if NET452
// .Net 4.5 has a custom implementation of RichPayloadEventSource // .NET 4.5.2 have a custom implementation of RichPayloadEventSource
#else #else
/// <summary> /// <summary>
/// Partial class to add the EventData attribute and any additional customizations to the generated type. /// Partial class to add the EventData attribute and any additional customizations to the generated type.

Просмотреть файл

@ -7,8 +7,8 @@
/// <summary> /// <summary>
/// Partial class to add the EventData attribute and any additional customizations to the generated type. /// Partial class to add the EventData attribute and any additional customizations to the generated type.
/// </summary> /// </summary>
#if !NET45 #if !NET452
// .Net 4.5 has a custom implementation of RichPayloadEventSource // .NET 4.5.2 have a custom implementation of RichPayloadEventSource
[System.Diagnostics.Tracing.EventData(Name = "PartB_AvailabilityData")] [System.Diagnostics.Tracing.EventData(Name = "PartB_AvailabilityData")]
#endif #endif
internal partial class AvailabilityData internal partial class AvailabilityData

Просмотреть файл

@ -5,8 +5,8 @@
/// <summary> /// <summary>
/// Partial class to add the EventData attribute and any additional customizations to the generated type. /// Partial class to add the EventData attribute and any additional customizations to the generated type.
/// </summary> /// </summary>
#if !NET45 #if !NET452
// .Net 4.5 has a custom implementation of RichPayloadEventSource // .NET 4.5.2 have a custom implementation of RichPayloadEventSource
[System.Diagnostics.Tracing.EventData(Name = "PartB_DataPoint")] [System.Diagnostics.Tracing.EventData(Name = "PartB_DataPoint")]
#endif #endif
internal partial class DataPoint internal partial class DataPoint

Просмотреть файл

@ -7,8 +7,8 @@
/// <summary> /// <summary>
/// Partial class to add the EventData attribute and any additional customizations to the generated type. /// Partial class to add the EventData attribute and any additional customizations to the generated type.
/// </summary> /// </summary>
#if !NET45 #if !NET452
// .Net 4.5 has a custom implementation of RichPayloadEventSource // .NET 4.5.2 have a custom implementation of RichPayloadEventSource
[System.Diagnostics.Tracing.EventData(Name = "PartB_EventData")] [System.Diagnostics.Tracing.EventData(Name = "PartB_EventData")]
#endif #endif
internal partial class EventData internal partial class EventData

Просмотреть файл

@ -8,8 +8,8 @@
/// <summary> /// <summary>
/// Partial class to add the EventData attribute and any additional customizations to the generated type. /// Partial class to add the EventData attribute and any additional customizations to the generated type.
/// </summary> /// </summary>
#if !NET45 #if !NET452
// .Net 4.5 has a custom implementation of RichPayloadEventSource // .NET 4.5.2 have a custom implementation of RichPayloadEventSource
[System.Diagnostics.Tracing.EventData(Name = "PartB_ExceptionData")] [System.Diagnostics.Tracing.EventData(Name = "PartB_ExceptionData")]
#endif #endif
internal partial class ExceptionData internal partial class ExceptionData

Просмотреть файл

@ -1,7 +1,7 @@
namespace Microsoft.ApplicationInsights.Extensibility.Implementation.External namespace Microsoft.ApplicationInsights.Extensibility.Implementation.External
{ {
#if NET45 #if NET452
// .Net 4.5 has a custom implementation of RichPayloadEventSource // .NET 4.5.2 have a custom implementation of RichPayloadEventSource
#else #else
/// <summary> /// <summary>
/// Partial class to add the EventData attribute and any additional customizations to the generated type. /// Partial class to add the EventData attribute and any additional customizations to the generated type.

Просмотреть файл

@ -8,8 +8,8 @@
/// <summary> /// <summary>
/// Partial class to add the EventData attribute and any additional customizations to the generated type. /// Partial class to add the EventData attribute and any additional customizations to the generated type.
/// </summary> /// </summary>
#if !NET45 #if !NET452
// .Net 4.5 has a custom implementation of RichPayloadEventSource // .NET 4.5.2 have a custom implementation of RichPayloadEventSource
[System.Diagnostics.Tracing.EventData(Name = "PartB_MessageData")] [System.Diagnostics.Tracing.EventData(Name = "PartB_MessageData")]
#endif #endif
internal partial class MessageData internal partial class MessageData

Просмотреть файл

@ -7,8 +7,8 @@
/// <summary> /// <summary>
/// Partial class to add the EventData attribute and any additional customizations to the generated type. /// Partial class to add the EventData attribute and any additional customizations to the generated type.
/// </summary> /// </summary>
#if !NET45 #if !NET452
// .Net 4.5 has a custom implementation of RichPayloadEventSource // .NET 4.5.2 have a custom implementation of RichPayloadEventSource
[System.Diagnostics.Tracing.EventData(Name = "PartB_MetricData")] [System.Diagnostics.Tracing.EventData(Name = "PartB_MetricData")]
#endif #endif
internal partial class MetricData internal partial class MetricData

Просмотреть файл

@ -5,8 +5,8 @@
/// <summary> /// <summary>
/// Partial class to add the EventData attribute and any additional customizations to the generated type. /// Partial class to add the EventData attribute and any additional customizations to the generated type.
/// </summary> /// </summary>
#if !NET45 #if !NET452
// .Net 4.5 has a custom implementation of RichPayloadEventSource // .NET 4.5.2 have a custom implementation of RichPayloadEventSource
[System.Diagnostics.Tracing.EventData(Name = "PartB_PageViewData")] [System.Diagnostics.Tracing.EventData(Name = "PartB_PageViewData")]
#endif #endif
internal partial class PageViewData internal partial class PageViewData

Просмотреть файл

@ -3,8 +3,8 @@
/// <summary> /// <summary>
/// Partial class to add the EventData attribute and any additional customizations to the generated type. /// Partial class to add the EventData attribute and any additional customizations to the generated type.
/// </summary> /// </summary>
#if NET45 #if NET452
// .Net 4.5 has a custom implementation of RichPayloadEventSource // .NET 4.5.2 have a custom implementation of RichPayloadEventSource
#else #else
[System.Diagnostics.Tracing.EventData(Name = "PartB_PageViewPerfData")] [System.Diagnostics.Tracing.EventData(Name = "PartB_PageViewPerfData")]
#endif #endif

Просмотреть файл

@ -1,7 +1,7 @@
namespace Microsoft.ApplicationInsights.Extensibility.Implementation.External namespace Microsoft.ApplicationInsights.Extensibility.Implementation.External
{ {
#if NET45 #if NET452
// .Net 4.5 has a custom implementation of RichPayloadEventSource // .NET 4.5.2 have a custom implementation of RichPayloadEventSource
#else #else
/// <summary> /// <summary>
/// Partial class to add the EventData attribute and any additional customizations to the generated type. /// Partial class to add the EventData attribute and any additional customizations to the generated type.

Просмотреть файл

@ -7,8 +7,8 @@
/// <summary> /// <summary>
/// Partial class to add the EventData attribute and any additional customizations to the generated type. /// Partial class to add the EventData attribute and any additional customizations to the generated type.
/// </summary> /// </summary>
#if !NET45 #if !NET452
// .Net 4.5 has a custom implementation of RichPayloadEventSource // .NET 4.5.2 have a custom implementation of RichPayloadEventSource
[System.Diagnostics.Tracing.EventData(Name = "PartB_RemoteDependencyData")] [System.Diagnostics.Tracing.EventData(Name = "PartB_RemoteDependencyData")]
#endif #endif
internal partial class RemoteDependencyData internal partial class RemoteDependencyData

Просмотреть файл

@ -7,8 +7,8 @@
/// <summary> /// <summary>
/// Partial class to add the EventData attribute and any additional customizations to the generated type. /// Partial class to add the EventData attribute and any additional customizations to the generated type.
/// </summary> /// </summary>
#if !NET45 #if !NET452
// .Net 4.5 has a custom implementation of RichPayloadEventSource // .NET 4.5.2 have a custom implementation of RichPayloadEventSource
[System.Diagnostics.Tracing.EventData(Name = "PartB_RequestData")] [System.Diagnostics.Tracing.EventData(Name = "PartB_RequestData")]
#endif #endif
internal partial class RequestData internal partial class RequestData

Просмотреть файл

@ -1,7 +1,7 @@
namespace Microsoft.ApplicationInsights.Extensibility.Implementation.External namespace Microsoft.ApplicationInsights.Extensibility.Implementation.External
{ {
#if NET45 #if NET452
// .Net 4.5 has a custom implementation of RichPayloadEventSource // .NET 4.5.2 have a custom implementation of RichPayloadEventSource
#else #else
/// <summary> /// <summary>
/// Partial class to add the EventData attribute and any additional customizations to the generated type. /// Partial class to add the EventData attribute and any additional customizations to the generated type.

Просмотреть файл

@ -1,7 +1,7 @@
namespace Microsoft.ApplicationInsights.Extensibility.Implementation.External namespace Microsoft.ApplicationInsights.Extensibility.Implementation.External
{ {
#if NET45 #if NET452
// .Net 4.5 has a custom implementation of RichPayloadEventSource // .NET 4.5.2 have a custom implementation of RichPayloadEventSource
#else #else
/// <summary> /// <summary>
/// Partial class to add the EventData attribute and any additional customizations to the generated type. /// Partial class to add the EventData attribute and any additional customizations to the generated type.

Просмотреть файл

@ -1,4 +1,4 @@
#if NET45 #if NET452
// FormattableString & Co are available in NetFx 4.6+, but not in NetFx 4.5 or NetStandard 1.1 // FormattableString & Co are available in NetFx 4.6+, but not in NetFx 4.5 or NetStandard 1.1

Просмотреть файл

@ -1,4 +1,4 @@
#if NET45 #if NET452
namespace Microsoft.ApplicationInsights.Extensibility.Implementation namespace Microsoft.ApplicationInsights.Extensibility.Implementation
{ {
using System; using System;

Просмотреть файл

@ -1,4 +1,4 @@
#if !NET45 // .Net 4.5 has a private implementation of this #if !NET452// .NET 4.5.2 have a private implementation of this
namespace Microsoft.ApplicationInsights.Extensibility.Implementation namespace Microsoft.ApplicationInsights.Extensibility.Implementation
{ {
using System; using System;

Просмотреть файл

@ -399,7 +399,7 @@
{ {
instance = TimeSpan.Parse(valueString, CultureInfo.InvariantCulture); instance = TimeSpan.Parse(valueString, CultureInfo.InvariantCulture);
} }
#if NET45 || NET46 #if NET452 || NET46
else if (expectedType.IsEnum) else if (expectedType.IsEnum)
#else #else
else if (expectedType.GetTypeInfo().IsEnum) else if (expectedType.GetTypeInfo().IsEnum)

Просмотреть файл

@ -84,7 +84,7 @@
/// <returns>a string representing the version of the current .NET framework.</returns> /// <returns>a string representing the version of the current .NET framework.</returns>
private static string GetRuntimeFrameworkVer() private static string GetRuntimeFrameworkVer()
{ {
#if NET45 || NET46 #if NET452 || NET46
Assembly assembly = typeof(Object).GetTypeInfo().Assembly; Assembly assembly = typeof(Object).GetTypeInfo().Assembly;
AssemblyFileVersionAttribute objectAssemblyFileVer = AssemblyFileVersionAttribute objectAssemblyFileVer =
assembly.GetCustomAttributes(typeof(AssemblyFileVersionAttribute)) assembly.GetCustomAttributes(typeof(AssemblyFileVersionAttribute))
@ -105,8 +105,8 @@
/// <returns>standard string representing the target framework.</returns> /// <returns>standard string representing the target framework.</returns>
private static string GetBaseSdkTargetFramework() private static string GetBaseSdkTargetFramework()
{ {
#if NET45 #if NET452
return "net45"; return "net452";
#elif NET46 #elif NET46
return "net46"; return "net46";
#elif NETSTANDARD2_0 #elif NETSTANDARD2_0
@ -119,7 +119,7 @@
/// <summary> /// <summary>
/// Runtime information for the underlying OS, should include Linux information here as well. /// Runtime information for the underlying OS, should include Linux information here as well.
/// Note that in NET45/46 the PlatformId is returned which have slightly different (more specific, /// Note that in NET452/46 the PlatformId is returned which have slightly different (more specific,
/// such as Win32NT/Win32S/MacOSX/Unix) values than in NETSTANDARD assemblies where you will get /// such as Win32NT/Win32S/MacOSX/Unix) values than in NETSTANDARD assemblies where you will get
/// the OS platform Windows/Linux/OSX. /// the OS platform Windows/Linux/OSX.
/// </summary> /// </summary>
@ -127,7 +127,7 @@
private static string GetRuntimeOsType() private static string GetRuntimeOsType()
{ {
string osValue = "unknown"; string osValue = "unknown";
#if NET45 || NET46 #if NET452 || NET46
osValue = Environment.OSVersion.Platform.ToString(); osValue = Environment.OSVersion.Platform.ToString();

Просмотреть файл

@ -634,6 +634,12 @@
[Event(67, Message = "Backend has responded with {0} status code in {1}ms.", Level = EventLevel.Informational)] [Event(67, Message = "Backend has responded with {0} status code in {1}ms.", Level = EventLevel.Informational)]
public void IngestionResponseTime(int responseCode, float responseDurationInMs, string appDomainName = "Incorrect") => this.WriteEvent(67, responseCode, responseDurationInMs, this.nameProvider.Name); public void IngestionResponseTime(int responseCode, float responseDurationInMs, string appDomainName = "Incorrect") => this.WriteEvent(67, responseCode, responseDurationInMs, this.nameProvider.Name);
[Event(68, Message = "{0}", Level = EventLevel.Warning, Keywords = Keywords.UserActionable)]
public void ConfigurationStringParseWarning(string message, string appDomainName = "Incorrect") => this.WriteEvent(68, message, this.nameProvider.Name);
[Event(69, Message = "{0}", Level = EventLevel.Error, Keywords = Keywords.UserActionable)]
public void ConnectionStringParseError(string message, string appDomainName = "Incorrect") => this.WriteEvent(69, message, this.nameProvider.Name);
[NonEvent] [NonEvent]
[SuppressMessage("Microsoft.Performance", "CA1822: MarkMembersAsStatic", Justification = "This method does access instance data in NetStandard 2.0 scenarios.")] [SuppressMessage("Microsoft.Performance", "CA1822: MarkMembersAsStatic", Justification = "This method does access instance data in NetStandard 2.0 scenarios.")]
public void IngestionResponseTimeEventCounter(float responseDurationInMs) public void IngestionResponseTimeEventCounter(float responseDurationInMs)

Просмотреть файл

@ -13,16 +13,14 @@
public sealed class DiagnosticsTelemetryModule : ITelemetryModule, IHeartbeatPropertyManager, IDisposable public sealed class DiagnosticsTelemetryModule : ITelemetryModule, IHeartbeatPropertyManager, IDisposable
{ {
internal readonly IList<IDiagnosticsSender> Senders = new List<IDiagnosticsSender>(); internal readonly IList<IDiagnosticsSender> Senders = new List<IDiagnosticsSender>();
internal readonly DiagnosticsListener EventListener; internal readonly DiagnosticsListener EventListener;
internal readonly IHeartbeatProvider HeartbeatProvider = null; internal readonly IHeartbeatProvider HeartbeatProvider = null;
private readonly object lockObject = new object(); private readonly object lockObject = new object();
private readonly IDiagnoisticsEventThrottlingScheduler throttlingScheduler = new DiagnoisticsEventThrottlingScheduler(); private readonly IDiagnoisticsEventThrottlingScheduler throttlingScheduler = new DiagnoisticsEventThrottlingScheduler();
private volatile bool disposed = false; private volatile bool disposed = false;
private string instrumentationKey; private string instrumentationKey;
private bool isInitialized = false;
/// <summary> /// <summary>
/// Initializes a new instance of the <see cref="DiagnosticsTelemetryModule"/> class. /// Initializes a new instance of the <see cref="DiagnosticsTelemetryModule"/> class.
/// </summary> /// </summary>
@ -158,6 +156,9 @@
} }
} }
/// <summary>Gets a value indicating whether this module has been initialized.</summary>
internal bool IsInitialized { get; private set; } = false;
/// <summary> /// <summary>
/// Initializes this telemetry module. /// Initializes this telemetry module.
/// </summary> /// </summary>
@ -171,11 +172,11 @@
// Temporary fix to make sure that we initialize module once. // Temporary fix to make sure that we initialize module once.
// It should be removed when configuration reading logic is moved to Web SDK. // It should be removed when configuration reading logic is moved to Web SDK.
if (!this.isInitialized) if (!this.IsInitialized)
{ {
lock (this.lockObject) lock (this.lockObject)
{ {
if (!this.isInitialized) if (!this.IsInitialized)
{ {
var queueSender = this.Senders.OfType<PortalDiagnosticsQueueSender>().First(); var queueSender = this.Senders.OfType<PortalDiagnosticsQueueSender>().First();
queueSender.IsDisabled = true; queueSender.IsDisabled = true;
@ -201,7 +202,7 @@
// set up heartbeat // set up heartbeat
this.HeartbeatProvider.Initialize(configuration); this.HeartbeatProvider.Initialize(configuration);
this.isInitialized = true; this.IsInitialized = true;
} }
} }
} }

Просмотреть файл

@ -72,7 +72,7 @@ namespace Microsoft.ApplicationInsights.Extensibility.Implementation
public static WeakConcurrentRandom Instance public static WeakConcurrentRandom Instance
{ {
#if NET45 || NET46 #if NET452 || NET46
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif #endif
get get

Просмотреть файл

@ -1,6 +1,6 @@
namespace Microsoft.ApplicationInsights.Extensibility namespace Microsoft.ApplicationInsights.Extensibility
{ {
#if NET45 #if NET452
using System; using System;
using System.Runtime.Remoting.Messaging; using System.Runtime.Remoting.Messaging;

Просмотреть файл

@ -4,7 +4,7 @@
<PropertyGroup> <PropertyGroup>
<RootNamespace>Microsoft.ApplicationInsights</RootNamespace> <RootNamespace>Microsoft.ApplicationInsights</RootNamespace>
<AssemblyName>Microsoft.ApplicationInsights</AssemblyName> <AssemblyName>Microsoft.ApplicationInsights</AssemblyName>
<TargetFrameworks>net45;net46;netstandard2.0</TargetFrameworks> <TargetFrameworks>net452;net46;netstandard2.0</TargetFrameworks>
<TargetFrameworks Condition="$(OS) != 'Windows_NT'">netstandard2.0</TargetFrameworks> <TargetFrameworks Condition="$(OS) != 'Windows_NT'">netstandard2.0</TargetFrameworks>
</PropertyGroup> </PropertyGroup>
@ -28,7 +28,7 @@
<PackageReference Include="System.Memory" Version="4.5.4" /> <PackageReference Include="System.Memory" Version="4.5.4" />
</ItemGroup> </ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net45' Or '$(TargetFramework)' == 'net46'"> <ItemGroup Condition="'$(TargetFramework)' != 'netstandard2.0'">
<Reference Include="System.Net.Http" /> <Reference Include="System.Net.Http" />
</ItemGroup> </ItemGroup>

Просмотреть файл

@ -2,7 +2,7 @@
{ {
using System; using System;
using System.Diagnostics; using System.Diagnostics;
#if NET45 || NET46 #if NET452 || NET46
using System.Diagnostics.CodeAnalysis; using System.Diagnostics.CodeAnalysis;
using System.Threading; using System.Threading;
#endif #endif
@ -14,7 +14,7 @@
/// </summary> /// </summary>
internal static readonly double StopwatchTicksToTimeSpanTicks = (double)TimeSpan.TicksPerSecond / Stopwatch.Frequency; internal static readonly double StopwatchTicksToTimeSpanTicks = (double)TimeSpan.TicksPerSecond / Stopwatch.Frequency;
#if NET45 || NET46 #if NET452 || NET46
private static readonly Timer SyncTimeUpdater; private static readonly Timer SyncTimeUpdater;
private static TimeSync timeSync = new TimeSync(); private static TimeSync timeSync = new TimeSync();
@ -30,7 +30,7 @@
/// </summary> /// </summary>
public static DateTimeOffset GetUtcNow() public static DateTimeOffset GetUtcNow()
{ {
#if NET45 || NET46 #if NET452 || NET46
// DateTime.UtcNow accuracy on .NET Framework is ~16ms, this method // DateTime.UtcNow accuracy on .NET Framework is ~16ms, this method
// uses combination of Stopwatch and DateTime to calculate accurate UtcNow. // uses combination of Stopwatch and DateTime to calculate accurate UtcNow.
@ -46,7 +46,7 @@
#endif #endif
} }
#if NET45 || NET46 #if NET452 || NET46
private static void Sync() private static void Sync()
{ {
// wait for DateTime.UtcNow update to the next granular value // wait for DateTime.UtcNow update to the next granular value

Просмотреть файл

@ -5,8 +5,9 @@ using System.Runtime.InteropServices;
[assembly: ComVisible(false)] [assembly: ComVisible(false)]
[assembly: InternalsVisibleTo("Microsoft.ApplicationInsights.Tests, PublicKey=" + AssemblyInfo.PublicKey)] [assembly: InternalsVisibleTo("Microsoft.ApplicationInsights.Tests, PublicKey=" + AssemblyInfo.PublicKey)]
[assembly: InternalsVisibleTo("Microsoft.ApplicationInsights.TelemetryChannel.Tests, PublicKey=" + AssemblyInfo.PublicKey)] [assembly: InternalsVisibleTo("Microsoft.ApplicationInsights.TelemetryChannel.Tests, PublicKey=" + AssemblyInfo.PublicKey)]
[assembly: InternalsVisibleTo("Microsoft.ApplicationInsights.AspNetCore.Tests, PublicKey=" + AssemblyInfo.PublicKey)]
[assembly: InternalsVisibleTo("Microsoft.ApplicationInsights.WorkerService.Tests, PublicKey=" + AssemblyInfo.PublicKey)]
// Assembly dynamically generated by Moq in unit tests // Assembly dynamically generated by Moq in unit tests
[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2, PublicKey=" + AssemblyInfo.MoqPublicKey)] [assembly: InternalsVisibleTo("DynamicProxyGenAssembly2, PublicKey=" + AssemblyInfo.MoqPublicKey)]

Просмотреть файл

@ -111,7 +111,7 @@
internal static bool IsWindowsOperatingSystem() internal static bool IsWindowsOperatingSystem()
{ {
#if NET45 #if NET452
return true; return true;
#else #else
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))

Просмотреть файл

@ -66,7 +66,7 @@
public static WeakConcurrentRandom Instance public static WeakConcurrentRandom Instance
{ {
#if NET45 || NET46 #if NET452 || NET46
[MethodImpl(MethodImplOptions.AggressiveInlining)] [MethodImpl(MethodImplOptions.AggressiveInlining)]
#endif #endif
get get

Просмотреть файл

@ -2,7 +2,7 @@
{ {
using System; using System;
using System.Diagnostics; using System.Diagnostics;
#if NET45 || NET46 #if NET452 || NET46
using System.Diagnostics.CodeAnalysis; using System.Diagnostics.CodeAnalysis;
using System.Threading; using System.Threading;
#endif #endif
@ -14,7 +14,7 @@
/// </summary> /// </summary>
internal static readonly double StopwatchTicksToTimeSpanTicks = (double)TimeSpan.TicksPerSecond / Stopwatch.Frequency; internal static readonly double StopwatchTicksToTimeSpanTicks = (double)TimeSpan.TicksPerSecond / Stopwatch.Frequency;
#if NET45 || NET46 #if NET452 || NET46
private static readonly Timer SyncTimeUpdater; private static readonly Timer SyncTimeUpdater;
private static TimeSync timeSync = new TimeSync(); private static TimeSync timeSync = new TimeSync();
@ -30,7 +30,7 @@
/// </summary> /// </summary>
public static DateTimeOffset GetUtcNow() public static DateTimeOffset GetUtcNow()
{ {
#if NET45 || NET46 #if NET452 || NET46
// DateTime.UtcNow accuracy on .NET Framework is ~16ms, this method // DateTime.UtcNow accuracy on .NET Framework is ~16ms, this method
// uses combination of Stopwatch and DateTime to calculate accurate UtcNow. // uses combination of Stopwatch and DateTime to calculate accurate UtcNow.
@ -46,7 +46,7 @@
#endif #endif
} }
#if NET45 || NET46 #if NET452 || NET46
private static void Sync() private static void Sync()
{ {
// wait for DateTime.UtcNow update to the next granular value // wait for DateTime.UtcNow update to the next granular value

Просмотреть файл

@ -4,7 +4,7 @@
<PropertyGroup> <PropertyGroup>
<RootNamespace>Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel</RootNamespace> <RootNamespace>Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel</RootNamespace>
<AssemblyName>Microsoft.AI.ServerTelemetryChannel</AssemblyName> <AssemblyName>Microsoft.AI.ServerTelemetryChannel</AssemblyName>
<TargetFrameworks>net45;netstandard2.0</TargetFrameworks> <TargetFrameworks>net452;netstandard2.0</TargetFrameworks>
<TargetFrameworks Condition="$(OS) != 'Windows_NT'">netstandard2.0</TargetFrameworks> <TargetFrameworks Condition="$(OS) != 'Windows_NT'">netstandard2.0</TargetFrameworks>
</PropertyGroup> </PropertyGroup>
@ -15,11 +15,6 @@
<Description>This nuget provides a telemetry channel to Application Insights Windows Server SDK that will preserve telemetry in offline scenarios. This is a dependent package, for the best experience please install the platform specific package. Privacy statement: https://go.microsoft.com/fwlink/?LinkId=512156</Description> <Description>This nuget provides a telemetry channel to Application Insights Windows Server SDK that will preserve telemetry in offline scenarios. This is a dependent package, for the best experience please install the platform specific package. Privacy statement: https://go.microsoft.com/fwlink/?LinkId=512156</Description>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DefineConstants Condition="'$(TargetFramework)' == 'netstandard2.0'">TRACE;DEBUG;NETCORE;NETSTANDARD2_0</DefineConstants>
<DefineConstants Condition="'$(TargetFramework)' == 'net45'">TRACE;DEBUG;NET45</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0'"> <PropertyGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<DefineConstants>$(DefineConstants);NETSTANDARD</DefineConstants> <DefineConstants>$(DefineConstants);NETSTANDARD</DefineConstants>
<IsNetStandardBuild>True</IsNetStandardBuild> <IsNetStandardBuild>True</IsNetStandardBuild>
@ -29,7 +24,7 @@
<ProjectReference Include="..\Microsoft.ApplicationInsights\Microsoft.ApplicationInsights.csproj" /> <ProjectReference Include="..\Microsoft.ApplicationInsights\Microsoft.ApplicationInsights.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net45'"> <ItemGroup Condition="'$(TargetFramework)' == 'net452'">
<PackageReference Include="Microsoft.Diagnostics.Tracing.EventRegister" Version="1.1.28"> <PackageReference Include="Microsoft.Diagnostics.Tracing.EventRegister" Version="1.1.28">
<PrivateAssets>All</PrivateAssets> <PrivateAssets>All</PrivateAssets>
</PackageReference> </PackageReference>

Просмотреть файл

@ -1,7 +1,10 @@
# Changelog # Changelog
## VNext ## VNext
- [End support for .NET Framework 4.5 / 4.5.1, Add support for .NET Framework 4.5.2](https://github.com/microsoft/ApplicationInsights-dotnet/issues/1161)
- [Create single request telemetry when URL-rewrite rewrites a request](https://github.com/microsoft/ApplicationInsights-dotnet/issues/1744)
- [Remove legacy TelemetryConfiguration.Active from AspNetCore SDK](https://github.com/microsoft/ApplicationInsights-dotnet/issues/1953)
- [Refactor AspNetCore and WorkerService use of Heartbeat (DiagnosticTelemetryModule)](https://github.com/microsoft/ApplicationInsights-dotnet/issues/1954)
## Version 2.15.0-beta2 ## Version 2.15.0-beta2
- [Read all properties of ApplicationInsightsServiceOptions from IConfiguration](https://github.com/microsoft/ApplicationInsights-dotnet/issues/1882) - [Read all properties of ApplicationInsightsServiceOptions from IConfiguration](https://github.com/microsoft/ApplicationInsights-dotnet/issues/1882)

Просмотреть файл

@ -17,8 +17,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HostingStartup", "WEB\Src\H
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Perf", "WEB\Src\PerformanceCollector\PerformanceCollector\Perf.csproj", "{9DC5C5E5-FC37-4E54-81FD-AA42BB934E9B}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Perf", "WEB\Src\PerformanceCollector\PerformanceCollector\Perf.csproj", "{9DC5C5E5-FC37-4E54-81FD-AA42BB934E9B}"
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Web", "WEB\Src\Web\Web\Web.csproj", "{8293BC71-7DDC-4DD1-8807-280EEF7E752D}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WindowsServer", "WEB\Src\WindowsServer\WindowsServer\WindowsServer.csproj", "{7B5D95EE-50EE-4222-A03C-FAE5905B3DFD}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WindowsServer", "WEB\Src\WindowsServer\WindowsServer\WindowsServer.csproj", "{7B5D95EE-50EE-4222-A03C-FAE5905B3DFD}"
EndProject EndProject
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Common.Web", "WEB\Src\Common\Common.Web.shproj", "{CCAB7A34-8DC5-4A6F-B637-46CEBA93C687}" Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Common.Web", "WEB\Src\Common\Common.Web.shproj", "{CCAB7A34-8DC5-4A6F-B637-46CEBA93C687}"
@ -97,8 +95,6 @@ Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Perf.Shared.NetStandard", "
EndProject EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "L) GenericTests", "L) GenericTests", "{D2A0AA36-57F7-436C-A7AF-7322927F1734}" Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "L) GenericTests", "L) GenericTests", "{D2A0AA36-57F7-436C-A7AF-7322927F1734}"
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Xdt.Tests", "LOGGING\test\Xdt.Tests\Xdt.Tests.csproj", "{262792BF-31A8-4FCD-BBC7-341EB29FAE96}"
EndProject
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "TestFramework.Shared.Logging", "LOGGING\test\CommonTestShared\TestFramework.Shared.Logging.shproj", "{3B9AB7FA-562D-4E4E-86E3-3348426BC0D9}" Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "TestFramework.Shared.Logging", "LOGGING\test\CommonTestShared\TestFramework.Shared.Logging.shproj", "{3B9AB7FA-562D-4E4E-86E3-3348426BC0D9}"
EndProject EndProject
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "TestFramework.Shared.Logging2", "LOGGING\test\Shared\TestFramework.Shared.Logging2.shproj", "{FA775630-7917-4A99-A78C-FBA46EDF685C}" Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "TestFramework.Shared.Logging2", "LOGGING\test\Shared\TestFramework.Shared.Logging2.shproj", "{FA775630-7917-4A99-A78C-FBA46EDF685C}"
@ -147,6 +143,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Perf.Tests", "WEB\Src\Perfo
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EventCounterCollector.Tests", "WEB\Src\EventCounterCollector\EventCounterCollector.Tests\EventCounterCollector.Tests.csproj", "{A1891190-0E43-4E2E-BEFE-1AF0068A0D1E}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EventCounterCollector.Tests", "WEB\Src\EventCounterCollector\EventCounterCollector.Tests\EventCounterCollector.Tests.csproj", "{A1891190-0E43-4E2E-BEFE-1AF0068A0D1E}"
EndProject EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Web", "WEB\Src\Web\Web\Web.csproj", "{6062A897-6E55-44C9-BA7A-E1C42946EE51}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Xdt.Tests", "LOGGING\test\Xdt.Tests\Xdt.Tests.csproj", "{8AAC8DC7-A2FC-4767-BDA8-380F86B64772}"
EndProject
Global Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution GlobalSection(SharedMSBuildProjectFiles) = preSolution
WEB\Src\PerformanceCollector\Perf.Shared.NetFull\Perf.Shared.NetFull.projitems*{0196259c-3582-4f4e-a01f-a8f9ae83b0f3}*SharedItemsImports = 13 WEB\Src\PerformanceCollector\Perf.Shared.NetFull\Perf.Shared.NetFull.projitems*{0196259c-3582-4f4e-a01f-a8f9ae83b0f3}*SharedItemsImports = 13
@ -167,12 +167,12 @@ Global
LOGGING\src\EventSource.Shared\EventSource.Shared\EventSource.Shared.projitems*{52b3c054-c686-4bb8-a4b7-9e8d6c49491f}*SharedItemsImports = 5 LOGGING\src\EventSource.Shared\EventSource.Shared\EventSource.Shared.projitems*{52b3c054-c686-4bb8-a4b7-9e8d6c49491f}*SharedItemsImports = 5
LOGGING\src\CommonShared\CommonShared.projitems*{587b624b-8c64-498e-93d7-a2d2abc17eab}*SharedItemsImports = 13 LOGGING\src\CommonShared\CommonShared.projitems*{587b624b-8c64-498e-93d7-a2d2abc17eab}*SharedItemsImports = 13
WEB\Src\TestFramework\Shared\TestFramework.Shared.projitems*{5f40f661-de59-4489-abac-be6f2d730d9a}*SharedItemsImports = 5 WEB\Src\TestFramework\Shared\TestFramework.Shared.projitems*{5f40f661-de59-4489-abac-be6f2d730d9a}*SharedItemsImports = 5
WEB\Src\Common\Common.projitems*{6062a897-6e55-44c9-ba7a-e1c42946ee51}*SharedItemsImports = 5
LOGGING\src\CommonShared\CommonShared.projitems*{63b8fda7-2ff5-4a20-8de7-ebb036012a54}*SharedItemsImports = 5 LOGGING\src\CommonShared\CommonShared.projitems*{63b8fda7-2ff5-4a20-8de7-ebb036012a54}*SharedItemsImports = 5
LOGGING\src\CommonShared\CommonShared.projitems*{67291093-4b5f-4ca5-a811-b8a1dcbe3f1f}*SharedItemsImports = 5 LOGGING\src\CommonShared\CommonShared.projitems*{67291093-4b5f-4ca5-a811-b8a1dcbe3f1f}*SharedItemsImports = 5
LOGGING\test\CommonTestShared\CommonTestShared.projitems*{7a903abd-d7fb-4610-aed8-32eb2cbaeebf}*SharedItemsImports = 5 LOGGING\test\CommonTestShared\CommonTestShared.projitems*{7a903abd-d7fb-4610-aed8-32eb2cbaeebf}*SharedItemsImports = 5
LOGGING\test\Shared\Adapters.Shared.Tests.projitems*{7a903abd-d7fb-4610-aed8-32eb2cbaeebf}*SharedItemsImports = 5 LOGGING\test\Shared\Adapters.Shared.Tests.projitems*{7a903abd-d7fb-4610-aed8-32eb2cbaeebf}*SharedItemsImports = 5
WEB\Src\Common\Common.projitems*{7b5d95ee-50ee-4222-a03c-fae5905b3dfd}*SharedItemsImports = 5 WEB\Src\Common\Common.projitems*{7b5d95ee-50ee-4222-a03c-fae5905b3dfd}*SharedItemsImports = 5
WEB\Src\Common\Common.projitems*{8293bc71-7ddc-4dd1-8807-280eef7e752d}*SharedItemsImports = 5
BASE\src\Common\Common\Common.projitems*{936af739-4297-4016-9d70-4280042709be}*SharedItemsImports = 13 BASE\src\Common\Common\Common.projitems*{936af739-4297-4016-9d70-4280042709be}*SharedItemsImports = 13
LOGGING\test\CommonTestShared\CommonTestShared.projitems*{93a35062-6aa4-4778-9769-428a942adcf9}*SharedItemsImports = 5 LOGGING\test\CommonTestShared\CommonTestShared.projitems*{93a35062-6aa4-4778-9769-428a942adcf9}*SharedItemsImports = 5
LOGGING\test\Shared\Adapters.Shared.Tests.projitems*{93a35062-6aa4-4778-9769-428a942adcf9}*SharedItemsImports = 5 LOGGING\test\Shared\Adapters.Shared.Tests.projitems*{93a35062-6aa4-4778-9769-428a942adcf9}*SharedItemsImports = 5
@ -228,10 +228,6 @@ Global
{9DC5C5E5-FC37-4E54-81FD-AA42BB934E9B}.Debug|Any CPU.Build.0 = Debug|Any CPU {9DC5C5E5-FC37-4E54-81FD-AA42BB934E9B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{9DC5C5E5-FC37-4E54-81FD-AA42BB934E9B}.Release|Any CPU.ActiveCfg = Release|Any CPU {9DC5C5E5-FC37-4E54-81FD-AA42BB934E9B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{9DC5C5E5-FC37-4E54-81FD-AA42BB934E9B}.Release|Any CPU.Build.0 = Release|Any CPU {9DC5C5E5-FC37-4E54-81FD-AA42BB934E9B}.Release|Any CPU.Build.0 = Release|Any CPU
{8293BC71-7DDC-4DD1-8807-280EEF7E752D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8293BC71-7DDC-4DD1-8807-280EEF7E752D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8293BC71-7DDC-4DD1-8807-280EEF7E752D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8293BC71-7DDC-4DD1-8807-280EEF7E752D}.Release|Any CPU.Build.0 = Release|Any CPU
{7B5D95EE-50EE-4222-A03C-FAE5905B3DFD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {7B5D95EE-50EE-4222-A03C-FAE5905B3DFD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7B5D95EE-50EE-4222-A03C-FAE5905B3DFD}.Debug|Any CPU.Build.0 = Debug|Any CPU {7B5D95EE-50EE-4222-A03C-FAE5905B3DFD}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7B5D95EE-50EE-4222-A03C-FAE5905B3DFD}.Release|Any CPU.ActiveCfg = Release|Any CPU {7B5D95EE-50EE-4222-A03C-FAE5905B3DFD}.Release|Any CPU.ActiveCfg = Release|Any CPU
@ -284,10 +280,6 @@ Global
{21CB9A8A-F25B-4DEB-92CB-ACB6920EB8BC}.Debug|Any CPU.Build.0 = Debug|Any CPU {21CB9A8A-F25B-4DEB-92CB-ACB6920EB8BC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{21CB9A8A-F25B-4DEB-92CB-ACB6920EB8BC}.Release|Any CPU.ActiveCfg = Release|Any CPU {21CB9A8A-F25B-4DEB-92CB-ACB6920EB8BC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{21CB9A8A-F25B-4DEB-92CB-ACB6920EB8BC}.Release|Any CPU.Build.0 = Release|Any CPU {21CB9A8A-F25B-4DEB-92CB-ACB6920EB8BC}.Release|Any CPU.Build.0 = Release|Any CPU
{262792BF-31A8-4FCD-BBC7-341EB29FAE96}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{262792BF-31A8-4FCD-BBC7-341EB29FAE96}.Debug|Any CPU.Build.0 = Debug|Any CPU
{262792BF-31A8-4FCD-BBC7-341EB29FAE96}.Release|Any CPU.ActiveCfg = Release|Any CPU
{262792BF-31A8-4FCD-BBC7-341EB29FAE96}.Release|Any CPU.Build.0 = Release|Any CPU
{058A0843-A95F-4B0D-91DB-33B9D3FD7324}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {058A0843-A95F-4B0D-91DB-33B9D3FD7324}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{058A0843-A95F-4B0D-91DB-33B9D3FD7324}.Debug|Any CPU.Build.0 = Debug|Any CPU {058A0843-A95F-4B0D-91DB-33B9D3FD7324}.Debug|Any CPU.Build.0 = Debug|Any CPU
{058A0843-A95F-4B0D-91DB-33B9D3FD7324}.Release|Any CPU.ActiveCfg = Release|Any CPU {058A0843-A95F-4B0D-91DB-33B9D3FD7324}.Release|Any CPU.ActiveCfg = Release|Any CPU
@ -376,6 +368,14 @@ Global
{A1891190-0E43-4E2E-BEFE-1AF0068A0D1E}.Debug|Any CPU.Build.0 = Debug|Any CPU {A1891190-0E43-4E2E-BEFE-1AF0068A0D1E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A1891190-0E43-4E2E-BEFE-1AF0068A0D1E}.Release|Any CPU.ActiveCfg = Release|Any CPU {A1891190-0E43-4E2E-BEFE-1AF0068A0D1E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A1891190-0E43-4E2E-BEFE-1AF0068A0D1E}.Release|Any CPU.Build.0 = Release|Any CPU {A1891190-0E43-4E2E-BEFE-1AF0068A0D1E}.Release|Any CPU.Build.0 = Release|Any CPU
{6062A897-6E55-44C9-BA7A-E1C42946EE51}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6062A897-6E55-44C9-BA7A-E1C42946EE51}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6062A897-6E55-44C9-BA7A-E1C42946EE51}.Release|Any CPU.ActiveCfg = Release|Any CPU
{6062A897-6E55-44C9-BA7A-E1C42946EE51}.Release|Any CPU.Build.0 = Release|Any CPU
{8AAC8DC7-A2FC-4767-BDA8-380F86B64772}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8AAC8DC7-A2FC-4767-BDA8-380F86B64772}.Debug|Any CPU.Build.0 = Debug|Any CPU
{8AAC8DC7-A2FC-4767-BDA8-380F86B64772}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8AAC8DC7-A2FC-4767-BDA8-380F86B64772}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE
@ -387,7 +387,6 @@ Global
{13335EB8-3936-407A-9363-1C428318BEA8} = {DFCBB4ED-976C-4239-BCAF-8AA21E684E8C} {13335EB8-3936-407A-9363-1C428318BEA8} = {DFCBB4ED-976C-4239-BCAF-8AA21E684E8C}
{DEEAF599-83F9-4A05-ADD6-F612CDABE570} = {7EC1F6B8-9F94-4947-B596-EB3726C53AE0} {DEEAF599-83F9-4A05-ADD6-F612CDABE570} = {7EC1F6B8-9F94-4947-B596-EB3726C53AE0}
{9DC5C5E5-FC37-4E54-81FD-AA42BB934E9B} = {3EDBC945-E531-4CEE-A038-A6AE1EF9AA96} {9DC5C5E5-FC37-4E54-81FD-AA42BB934E9B} = {3EDBC945-E531-4CEE-A038-A6AE1EF9AA96}
{8293BC71-7DDC-4DD1-8807-280EEF7E752D} = {07076842-9CAA-4B4A-8AEF-88DE88CD37AC}
{7B5D95EE-50EE-4222-A03C-FAE5905B3DFD} = {11AC7235-167E-40B5-B2E3-9CBF08700064} {7B5D95EE-50EE-4222-A03C-FAE5905B3DFD} = {11AC7235-167E-40B5-B2E3-9CBF08700064}
{2E283031-425B-421F-9E81-34ABFEFAB618} = {60CDB555-C5FE-4010-A37B-014B04C5EAC3} {2E283031-425B-421F-9E81-34ABFEFAB618} = {60CDB555-C5FE-4010-A37B-014B04C5EAC3}
{1B0F54BF-078A-421C-9708-2D817D4BCE30} = {05E05465-F285-4689-BFC5-F78FC5761992} {1B0F54BF-078A-421C-9708-2D817D4BCE30} = {05E05465-F285-4689-BFC5-F78FC5761992}
@ -403,7 +402,6 @@ Global
{21CB9A8A-F25B-4DEB-92CB-ACB6920EB8BC} = {FBAFD313-0139-4DA3-BCB3-EE54DC3B6CCD} {21CB9A8A-F25B-4DEB-92CB-ACB6920EB8BC} = {FBAFD313-0139-4DA3-BCB3-EE54DC3B6CCD}
{0196259C-3582-4F4E-A01F-A8F9AE83B0F3} = {3EDBC945-E531-4CEE-A038-A6AE1EF9AA96} {0196259C-3582-4F4E-A01F-A8F9AE83B0F3} = {3EDBC945-E531-4CEE-A038-A6AE1EF9AA96}
{D13C3EC7-B300-4158-9054-216156B203BE} = {3EDBC945-E531-4CEE-A038-A6AE1EF9AA96} {D13C3EC7-B300-4158-9054-216156B203BE} = {3EDBC945-E531-4CEE-A038-A6AE1EF9AA96}
{262792BF-31A8-4FCD-BBC7-341EB29FAE96} = {D2A0AA36-57F7-436C-A7AF-7322927F1734}
{058A0843-A95F-4B0D-91DB-33B9D3FD7324} = {E9AEB857-E8AA-4ED6-A020-DF4D8486CEB0} {058A0843-A95F-4B0D-91DB-33B9D3FD7324} = {E9AEB857-E8AA-4ED6-A020-DF4D8486CEB0}
{B90EDEA5-3CC8-4282-80A0-7116905E2427} = {D8483C3E-C386-48AD-B935-700A54FDCF31} {B90EDEA5-3CC8-4282-80A0-7116905E2427} = {D8483C3E-C386-48AD-B935-700A54FDCF31}
{3D7258E3-5DDC-45A4-A457-9AA3BCC92DE7} = {E9AEB857-E8AA-4ED6-A020-DF4D8486CEB0} {3D7258E3-5DDC-45A4-A457-9AA3BCC92DE7} = {E9AEB857-E8AA-4ED6-A020-DF4D8486CEB0}
@ -426,6 +424,8 @@ Global
{00FC8932-554B-455F-9E02-E8A4B0DBFAA8} = {E9AEB857-E8AA-4ED6-A020-DF4D8486CEB0} {00FC8932-554B-455F-9E02-E8A4B0DBFAA8} = {E9AEB857-E8AA-4ED6-A020-DF4D8486CEB0}
{27B8D7BE-8CB7-48BF-97DA-0F031103C03D} = {3EDBC945-E531-4CEE-A038-A6AE1EF9AA96} {27B8D7BE-8CB7-48BF-97DA-0F031103C03D} = {3EDBC945-E531-4CEE-A038-A6AE1EF9AA96}
{A1891190-0E43-4E2E-BEFE-1AF0068A0D1E} = {DFCBB4ED-976C-4239-BCAF-8AA21E684E8C} {A1891190-0E43-4E2E-BEFE-1AF0068A0D1E} = {DFCBB4ED-976C-4239-BCAF-8AA21E684E8C}
{6062A897-6E55-44C9-BA7A-E1C42946EE51} = {07076842-9CAA-4B4A-8AEF-88DE88CD37AC}
{8AAC8DC7-A2FC-4767-BDA8-380F86B64772} = {D2A0AA36-57F7-436C-A7AF-7322927F1734}
EndGlobalSection EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {0E0415AF-37CC-4999-8E5B-DD36F75BFD4D} SolutionGuid = {0E0415AF-37CC-4999-8E5B-DD36F75BFD4D}

Просмотреть файл

@ -16,7 +16,7 @@ namespace Microsoft.ApplicationInsights.Implementation
{ {
internal static string GetSdkVersion(string versionPrefix) internal static string GetSdkVersion(string versionPrefix)
{ {
#if NET45 || NET46 #if NET452 || NET46
string versionStr = typeof(SdkVersionUtils).Assembly.GetCustomAttributes(false).OfType<AssemblyFileVersionAttribute>().First().Version; string versionStr = typeof(SdkVersionUtils).Assembly.GetCustomAttributes(false).OfType<AssemblyFileVersionAttribute>().First().Version;
#else #else
string versionStr = typeof(SdkVersionUtils).GetTypeInfo().Assembly.GetCustomAttributes<AssemblyFileVersionAttribute>().First().Version; string versionStr = typeof(SdkVersionUtils).GetTypeInfo().Assembly.GetCustomAttributes<AssemblyFileVersionAttribute>().First().Version;

Просмотреть файл

@ -2,7 +2,7 @@
<Import Project="$(PropsRoot)\Product.props" /> <Import Project="$(PropsRoot)\Product.props" />
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>netstandard2.0;net45</TargetFrameworks> <TargetFrameworks>netstandard2.0;net452</TargetFrameworks>
<RootNamespace>Microsoft.ApplicationInsights.DiagnosticSourceListener</RootNamespace> <RootNamespace>Microsoft.ApplicationInsights.DiagnosticSourceListener</RootNamespace>
<AssemblyName>Microsoft.ApplicationInsights.DiagnosticSourceListener</AssemblyName> <AssemblyName>Microsoft.ApplicationInsights.DiagnosticSourceListener</AssemblyName>
</PropertyGroup> </PropertyGroup>

Просмотреть файл

@ -2,7 +2,7 @@
<Import Project="$(PropsRoot)\Product.props" /> <Import Project="$(PropsRoot)\Product.props" />
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>net451</TargetFrameworks> <TargetFrameworks>net452</TargetFrameworks>
<RootNamespace>Microsoft.ApplicationInsights.EtwCollector</RootNamespace> <RootNamespace>Microsoft.ApplicationInsights.EtwCollector</RootNamespace>
<AssemblyName>Microsoft.ApplicationInsights.EtwCollector</AssemblyName> <AssemblyName>Microsoft.ApplicationInsights.EtwCollector</AssemblyName>
</PropertyGroup> </PropertyGroup>

Просмотреть файл

@ -68,7 +68,7 @@ namespace Microsoft.ApplicationInsights.TraceEvent.Shared.Implementation
string name; string name;
try try
{ {
#if NET45 || NET46 #if NET452 || NET46
name = AppDomain.CurrentDomain.FriendlyName; name = AppDomain.CurrentDomain.FriendlyName;
#else #else
name = string.Empty; name = string.Empty;

Просмотреть файл

@ -2,7 +2,7 @@
<Import Project="$(PropsRoot)\Product.props" /> <Import Project="$(PropsRoot)\Product.props" />
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>net45;netstandard2.0</TargetFrameworks> <TargetFrameworks>net452;netstandard2.0</TargetFrameworks>
<RootNamespace>Microsoft.ApplicationInsights.Log4NetAppender</RootNamespace> <RootNamespace>Microsoft.ApplicationInsights.Log4NetAppender</RootNamespace>
<AssemblyName>Microsoft.ApplicationInsights.Log4NetAppender</AssemblyName> <AssemblyName>Microsoft.ApplicationInsights.Log4NetAppender</AssemblyName>
</PropertyGroup> </PropertyGroup>

Просмотреть файл

@ -2,7 +2,7 @@
<Import Project="$(PropsRoot)\Product.props" /> <Import Project="$(PropsRoot)\Product.props" />
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>net45;netstandard2.0</TargetFrameworks> <TargetFrameworks>net452;netstandard2.0</TargetFrameworks>
<RootNamespace>Microsoft.ApplicationInsights.NLogTarget</RootNamespace> <RootNamespace>Microsoft.ApplicationInsights.NLogTarget</RootNamespace>
<AssemblyName>Microsoft.ApplicationInsights.NLogTarget</AssemblyName> <AssemblyName>Microsoft.ApplicationInsights.NLogTarget</AssemblyName>
</PropertyGroup> </PropertyGroup>

Просмотреть файл

@ -2,7 +2,7 @@
<Import Project="$(PropsRoot)\Product.props" /> <Import Project="$(PropsRoot)\Product.props" />
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>net45;netstandard2.0</TargetFrameworks> <TargetFrameworks>net452;netstandard2.0</TargetFrameworks>
<RootNamespace>Microsoft.ApplicationInsights.TraceListener</RootNamespace> <RootNamespace>Microsoft.ApplicationInsights.TraceListener</RootNamespace>
<AssemblyName>Microsoft.ApplicationInsights.TraceListener</AssemblyName> <AssemblyName>Microsoft.ApplicationInsights.TraceListener</AssemblyName>
</PropertyGroup> </PropertyGroup>

Просмотреть файл

@ -8,7 +8,7 @@
{ {
public static string GetExpectedSdkVersion(string prefix, Type loggerType) public static string GetExpectedSdkVersion(string prefix, Type loggerType)
{ {
#if NET45 || NET46 #if NET452 || NET46
string versionStr = loggerType.Assembly.GetCustomAttributes(false).OfType<AssemblyFileVersionAttribute>().First().Version; string versionStr = loggerType.Assembly.GetCustomAttributes(false).OfType<AssemblyFileVersionAttribute>().First().Version;
#else #else
string versionStr = loggerType.GetTypeInfo().Assembly.GetCustomAttributes<AssemblyFileVersionAttribute>().First().Version; string versionStr = loggerType.GetTypeInfo().Assembly.GetCustomAttributes<AssemblyFileVersionAttribute>().First().Version;

Просмотреть файл

@ -15,7 +15,7 @@
<ProjectReference Include="..\..\src\EtwCollector\EtwCollector.csproj" /> <ProjectReference Include="..\..\src\EtwCollector\EtwCollector.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net46'"> <ItemGroup>
<Reference Include="System.Net.Http" /> <Reference Include="System.Net.Http" />
</ItemGroup> </ItemGroup>

Просмотреть файл

@ -4,7 +4,7 @@
<PropertyGroup> <PropertyGroup>
<RootNamespace>Microsoft.ApplicationInsights.Log4NetAppender.Tests</RootNamespace> <RootNamespace>Microsoft.ApplicationInsights.Log4NetAppender.Tests</RootNamespace>
<AssemblyName>Microsoft.ApplicationInsights.Log4NetAppender.Tests</AssemblyName> <AssemblyName>Microsoft.ApplicationInsights.Log4NetAppender.Tests</AssemblyName>
<TargetFrameworks>net45;netcoreapp2.1;netcoreapp3.1</TargetFrameworks> <TargetFrameworks>net452;netcoreapp2.1;netcoreapp3.1</TargetFrameworks>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
@ -16,7 +16,7 @@
<ProjectReference Include="..\..\src\Log4NetAppender\Log4NetAppender.csproj" /> <ProjectReference Include="..\..\src\Log4NetAppender\Log4NetAppender.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net45'"> <ItemGroup Condition="'$(TargetFramework)' == 'net452'">
<Reference Include="System.Net.Http" /> <Reference Include="System.Net.Http" />
</ItemGroup> </ItemGroup>

Просмотреть файл

@ -4,7 +4,7 @@
<PropertyGroup> <PropertyGroup>
<RootNamespace>Microsoft.ApplicationInsights.NLogTarget.Tests</RootNamespace> <RootNamespace>Microsoft.ApplicationInsights.NLogTarget.Tests</RootNamespace>
<AssemblyName>Microsoft.ApplicationInsights.NLogTarget.Tests</AssemblyName> <AssemblyName>Microsoft.ApplicationInsights.NLogTarget.Tests</AssemblyName>
<TargetFrameworks>net45;netcoreapp2.1;netcoreapp3.1</TargetFrameworks> <TargetFrameworks>net452;netcoreapp2.1;netcoreapp3.1</TargetFrameworks>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
@ -16,7 +16,7 @@
<ProjectReference Include="..\..\src\NLogTarget\NLogTarget.csproj" /> <ProjectReference Include="..\..\src\NLogTarget\NLogTarget.csproj" />
</ItemGroup> </ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net45'"> <ItemGroup Condition="'$(TargetFramework)' == 'net452'">
<Reference Include="System.Net.Http" /> <Reference Include="System.Net.Http" />
</ItemGroup> </ItemGroup>

Просмотреть файл

@ -19,7 +19,7 @@ namespace Microsoft.ApplicationInsights.Tracing.Tests
{ {
public string InstrumentationKey { get; } public string InstrumentationKey { get; }
#if NET45 || NET46 #if NET452 || NET46
private static readonly string ApplicationInsightsConfigFilePath = private static readonly string ApplicationInsightsConfigFilePath =
Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "ApplicationInsights.config"); Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "ApplicationInsights.config");
#else #else

Просмотреть файл

@ -21,7 +21,7 @@ namespace Microsoft.ApplicationInsights
public CustomTelemetryChannel() public CustomTelemetryChannel()
{ {
this.waitHandle = new AutoResetEvent(false); this.waitHandle = new AutoResetEvent(false);
#if NET45 #if NET452
this.SentItems = new ITelemetry[0]; this.SentItems = new ITelemetry[0];
#else #else
this.SentItems = Array.Empty<ITelemetry>(); this.SentItems = Array.Empty<ITelemetry>();
@ -89,7 +89,7 @@ namespace Microsoft.ApplicationInsights
{ {
lock (this) lock (this)
{ {
#if NET45 #if NET452
this.SentItems = new ITelemetry[0]; this.SentItems = new ITelemetry[0];
#else #else
this.SentItems = Array.Empty<ITelemetry>(); this.SentItems = Array.Empty<ITelemetry>();

Просмотреть файл

@ -217,7 +217,7 @@
Assert.AreEqual(expectedEventId.ToString(InvariantCulture), telemetry.Properties["EventId"]); Assert.AreEqual(expectedEventId.ToString(InvariantCulture), telemetry.Properties["EventId"]);
} }
#if NET45 #if NET452
[TestMethod] [TestMethod]
[TestCategory("TraceListener")] [TestCategory("TraceListener")]
public void TraceListenerSendsResumeAsVerbose() public void TraceListenerSendsResumeAsVerbose()
@ -357,7 +357,7 @@
source.TraceInformation("TestMessage"); source.TraceInformation("TestMessage");
} }
#if NET45 #if NET452
[TestMethod] [TestMethod]
public void TraceEventDoesNotStoreLogicalOperationStackInTelemetryPropertiesBecauseLongValuesAreRejected() public void TraceEventDoesNotStoreLogicalOperationStackInTelemetryPropertiesBecauseLongValuesAreRejected()
{ {
@ -420,7 +420,7 @@
{ {
listener.TraceOutputOptions = options; listener.TraceOutputOptions = options;
TraceEventCache traceEventCache = new TraceEventCache(); TraceEventCache traceEventCache = new TraceEventCache();
#if NET45 #if NET452
PrivateObject privateObject = new PrivateObject(traceEventCache); PrivateObject privateObject = new PrivateObject(traceEventCache);
privateObject.SetField("timeStamp", DateTime.Now.Ticks); privateObject.SetField("timeStamp", DateTime.Now.Ticks);
privateObject.SetField("stackTrace", "Environment.StackTrace"); privateObject.SetField("stackTrace", "Environment.StackTrace");

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше