Skip to content

Commit 2de8899

Browse files
author
Timothy Mothra
authored
Merge pull request #1683 from microsoft/develop
merge DEVELOP to MASTER (prep 2.13 stable)
2 parents 40c0153 + 5e10925 commit 2de8899

File tree

15 files changed

+69
-36
lines changed

15 files changed

+69
-36
lines changed

.props/_GlobalStaticVersion.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<SemanticVersionMajor>2</SemanticVersionMajor>
1414
<SemanticVersionMinor>13</SemanticVersionMinor> <!-- If changing the Minor version, also update the Date value. -->
1515
<SemanticVersionPatch>0</SemanticVersionPatch>
16-
<PreReleaseMilestone>beta2</PreReleaseMilestone> <!--Valid values: beta1, beta2, EMPTY for stable -->
16+
<PreReleaseMilestone></PreReleaseMilestone> <!--Valid values: beta1, beta2, EMPTY for stable -->
1717
<!--
1818
Date when Semantic Version was changed.
1919
Update for every MINOR release.

BASE/.vsts/linux-build.yml

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
variables:
2-
DotNetVersion: "2.2.101"
3-
41
pool:
52
vmImage: 'ubuntu-16.04'
63
steps:
7-
- task: DotNetCoreInstaller@0
4+
5+
6+
- task: DotNetCoreInstaller@1
7+
displayName: install dotnet core 3.0
88
inputs:
9-
version: $(DotNetVersion)
9+
version: 3.0.x
1010

1111
- task: DotNetCoreCLI@1
1212
displayName: DotNetCoreCLI - Restore Solution
@@ -21,16 +21,35 @@ steps:
2121
projects: "BASE/*.sln"
2222
arguments: "--configuration Release"
2323

24+
- task: DotNetCoreCLI@1
25+
displayName: DotNetCoreCLI - Test NetCore 3.0
26+
inputs:
27+
command: "test"
28+
projects: "BASE/Test/**/Microsoft.ApplicationInsights.Tests.csproj"
29+
arguments: "--configuration Release --framework netcoreapp3.0 -l trx --filter TestCategory!=WindowsOnly"
30+
31+
32+
## Install and test NetCore 2.2
33+
34+
- task: DotNetCoreInstaller@1
35+
displayName: install dotnet core 2.2
36+
inputs:
37+
version: 2.2.x
38+
2439
- task: DotNetCoreCLI@1
2540
displayName: DotNetCoreCLI - Test NetCore 2.0
2641
inputs:
2742
command: "test"
2843
projects: "BASE/Test/**/Microsoft.ApplicationInsights.Tests.csproj"
2944
arguments: "--configuration Release --framework netcoreapp2.0 -l trx --filter TestCategory!=WindowsOnly"
3045

46+
47+
## Install and test NetCore 1.1
48+
3149
- task: DotNetCoreInstaller@0
50+
displayName: install dotnet core 1.1
3251
inputs:
33-
version: "1.1.5"
52+
version: 1.1.5
3453

3554
- task: DotNetCoreCLI@1
3655
displayName: DotNetCoreCLI - Test NetCore 1.1
@@ -39,6 +58,8 @@ steps:
3958
projects: "BASE/Test/**/Microsoft.ApplicationInsights.Tests.csproj"
4059
arguments: "--configuration Release --framework netcoreapp1.1 -l trx --filter TestCategory!=WindowsOnly"
4160

61+
## Publish test results
62+
4263
- task: PublishTestResults@2
4364
condition: always()
4465
inputs:

BASE/Test/Microsoft.ApplicationInsights.Test/Microsoft.ApplicationInsights.Tests/Channel/InMemoryChannelTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public void TelemetryWithNoInstrumentationKeyIsDropped()
5151
}
5252
}
5353

54-
#if (!NETCOREAPP1_1 && !NETCOREAPP2_0)
54+
#if (!NETCOREAPP) // This constant is defined for all versions of NetCore https://docs.microsoft.com/en-us/dotnet/core/tutorials/libraries#how-to-multitarget
5555

5656
[Ignore("This test is failing intermittently and needs to be investigated. ~Timothy")]
5757
[TestMethod]

BASE/Test/Microsoft.ApplicationInsights.Test/Microsoft.ApplicationInsights.Tests/Extensibility/TelemetryConfigurationFactoryTest.cs

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,11 @@ public void LoadInstanceSetsInstancePropertiesOfTimeSpanTypeFromChildElementValu
504504
}
505505

506506
[TestMethod]
507+
#if NETCOREAPP3_0
508+
[ExpectedExceptionWithMessage(typeof(ArgumentException), "Failed to parse configuration value. Property: 'TimeSpanProperty' Reason: String 'TestValue' was not recognized as a valid TimeSpan.")]
509+
#else
507510
[ExpectedExceptionWithMessage(typeof(ArgumentException), "Failed to parse configuration value. Property: 'TimeSpanProperty' Reason: String was not recognized as a valid TimeSpan.")]
511+
#endif
508512
public void LoadInstanceSetsInstancePropertiesOfTimeSpanTypeFromChildElementValuesOfDefinitionWithInvalidFormatThrowsException()
509513
{
510514
var definition = new XElement(
@@ -641,9 +645,9 @@ public void LoadInstanceCreatesNewInstanceOfExpectedTypeWhenPropertiesAreSpecifi
641645
Assert.AreEqual(42, loaded.Int32Property);
642646
}
643647

644-
#endregion
648+
#endregion
645649

646-
#region TelemetryProcesors
650+
#region TelemetryProcesors
647651

648652
[TestMethod]
649653
public void InitializeTelemetryProcessorsFromConfigurationFile()
@@ -873,9 +877,9 @@ public void UseAddsProcessorAfterProcessorsDefinedInConfiguration()
873877
AssertEx.IsType<StubTelemetryProcessor2>(configuration.TelemetryProcessors[1]);
874878
}
875879

876-
#endregion
880+
#endregion
877881

878-
#region Modules
882+
#region Modules
879883

880884
[TestMethod]
881885
public void InitializeTelemetryModulesFromConfigurationFile()
@@ -961,9 +965,9 @@ public void InitializeDoesNotThrowIsModuleInitializationFails()
961965
}
962966
}
963967

964-
#endregion
968+
#endregion
965969

966-
#region TelemetryInitializers
970+
#region TelemetryInitializers
967971
[TestMethod]
968972
public void InitializeAddTelemetryInitializersWithOneInvalid()
969973
{
@@ -982,9 +986,9 @@ public void InitializeAddTelemetryInitializersWithOneInvalid()
982986
}
983987

984988

985-
#endregion
989+
#endregion
986990

987-
#region LoadInstances<T>
991+
#region LoadInstances<T>
988992

989993
[TestMethod]
990994
public void LoadInstancesPopulatesListWithInstancesOfSpecifiedType()
@@ -1055,9 +1059,9 @@ public void LoadInstancesIgnoresElementsOtherThanAdd()
10551059
AssertEx.AreEqual(new[] { 42 }, instances);
10561060
}
10571061

1058-
#endregion
1062+
#endregion
10591063

1060-
#region LoadProperties
1064+
#region LoadProperties
10611065

10621066
[TestMethod]
10631067
public void LoadPropertiesConvertsPropertyValuesFromStringToPropertyType()
@@ -1215,9 +1219,9 @@ public void DeveloperModePropertyCanLoadEmptyValue()
12151219
Assert.IsFalse(instance.TelemetryChannel.DeveloperMode.HasValue);
12161220
}
12171221

1218-
#endregion
1222+
#endregion
12191223

1220-
#region TelemetrySinks
1224+
#region TelemetrySinks
12211225

12221226
[TestMethod]
12231227
public void EmptyConfigurationCreatesDefaultSink()
@@ -1783,7 +1787,7 @@ public void TelemetrySinkInitializesChannelAndAllProcessors()
17831787
Assert.IsTrue(processor.Initialized);
17841788
}
17851789

1786-
#endregion
1790+
#endregion
17871791

17881792
[TestMethod]
17891793
public void InitializeIsMarkesAsInternalSdkOperation()

BASE/Test/Microsoft.ApplicationInsights.Test/Microsoft.ApplicationInsights.Tests/Metrics/TestUtility/TestUtil.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ public static void ValidateSdkVersionString(string versionMoniker)
236236
Assert.IsNotNull(versionMoniker);
237237

238238
// Expected result example: "m-agg2:2.6.0-12552"
239-
#if NETCOREAPP1_1 || NETCOREAPP2_0
239+
#if NETCOREAPP // This constant is defined for all versions of NetCore https://docs.microsoft.com/en-us/dotnet/core/tutorials/libraries#how-to-multitarget
240240
const string expectedPrefix = "m-agg2c:";
241241
#else
242242
const string expectedPrefix = "m-agg2:";

BASE/Test/Microsoft.ApplicationInsights.Test/Microsoft.ApplicationInsights.Tests/Microsoft.ApplicationInsights.Tests.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
</PropertyGroup>
1515

1616
<PropertyGroup>
17-
<TargetFrameworks>net45;net46;netcoreapp1.1;netcoreapp2.0</TargetFrameworks>
18-
<TargetFrameworks Condition="$(OS) != 'Windows_NT'">netcoreapp1.1;netcoreapp2.0</TargetFrameworks>
17+
<TargetFrameworks>net45;net46;netcoreapp1.1;netcoreapp2.0;netcoreapp3.0</TargetFrameworks>
18+
<TargetFrameworks Condition="$(OS) != 'Windows_NT'">netcoreapp1.1;netcoreapp2.0;netcoreapp3.0</TargetFrameworks>
1919
<DebugType>pdbonly</DebugType>
2020
<DebugSymbols>true</DebugSymbols>
2121
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>

BASE/Test/Microsoft.ApplicationInsights.Test/Microsoft.ApplicationInsights.Tests/TelemetryClientTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1045,7 +1045,7 @@ public void TrackCopiesPropertiesFromClientToTelemetryBeforeInvokingInitializers
10451045
Assert.AreEqual(client.Context.Properties[PropertyNameGlobal], globalValueInInitializer);
10461046
}
10471047

1048-
#if (!NETCOREAPP1_1 && !NETCOREAPP2_0)
1048+
#if (!NETCOREAPP) // This constant is defined for all versions of NetCore https://docs.microsoft.com/en-us/dotnet/core/tutorials/libraries#how-to-multitarget
10491049
[TestMethod]
10501050
public void TrackAddsSdkVerionByDefault()
10511051
{

BASE/Test/ServerTelemetryChannel.Test/TelemetryChannel.Tests/TelemetryChannel.Tests.csproj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
</PropertyGroup>
1616

1717
<PropertyGroup>
18-
<TargetFrameworks>net45;netcoreapp1.1;netcoreapp2.0</TargetFrameworks>
19-
<TargetFrameworks Condition="$(OS) != 'Windows_NT'">netcoreapp1.1;netcoreapp2.0</TargetFrameworks>
18+
<TargetFrameworks>net45;netcoreapp1.1;netcoreapp2.0;netcoreapp3.0</TargetFrameworks>
19+
<TargetFrameworks Condition="$(OS) != 'Windows_NT'">netcoreapp1.1;netcoreapp2.0;netcoreapp3.0</TargetFrameworks>
2020

2121
<AssemblyName>Microsoft.ApplicationInsights.TelemetryChannel.Tests</AssemblyName>
2222

BASE/src/Microsoft.ApplicationInsights/Extensibility/Implementation/External/Tags.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,10 @@ internal static void UpdateTagValue(this IDictionary<string, string> tags, strin
6868
{
6969
if (tagValue.HasValue)
7070
{
71-
#if NET45 || NET46 || NETSTANDARD2_0
72-
string value = tagValue.Value.ToString(CultureInfo.InvariantCulture);
73-
#else
71+
#if NETSTANDARD1_3
7472
string value = tagValue.Value.ToString();
73+
#else
74+
string value = tagValue.Value.ToString(CultureInfo.InvariantCulture);
7575
#endif
7676
tags.Add(tagKey, value);
7777
}

BASE/src/Microsoft.ApplicationInsights/Extensibility/Implementation/Tracing/HeartbeatProvider.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ internal class HeartbeatProvider : IDisposable, IHeartbeatProvider
2929
/// <summary>
3030
/// Value for property indicating 'app insights version' related specifically to heartbeats.
3131
/// </summary>
32-
#if NETSTANDARD1_3 || NETSTANDARD2_0
32+
#if NETSTANDARD // This constant is defined for all versions of NetStandard https://docs.microsoft.com/en-us/dotnet/core/tutorials/libraries#how-to-multitarget
3333
private static string sdkVersionPropertyValue = SdkVersionUtils.GetSdkVersion("hbnetc:");
3434
#else
3535
private static string sdkVersionPropertyValue = SdkVersionUtils.GetSdkVersion("hbnet:");

BASE/src/Microsoft.ApplicationInsights/Extensibility/TelemetryConfiguration.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,9 @@ public TelemetryConfiguration(string instrumentationKey, ITelemetryChannel chann
102102
/// If the configuration file does not exist, the active configuration instance is initialized with minimum defaults
103103
/// needed to send telemetry to Application Insights.
104104
/// </summary>
105-
#if NETSTANDARD1_3 || NETSTANDARD2_0
105+
#if NETSTANDARD // This constant is defined for all versions of NetStandard https://docs.microsoft.com/en-us/dotnet/core/tutorials/libraries#how-to-multitarget
106106
[Obsolete("We do not recommend using TelemetryConfiguration.Active on .NET Core. See https://github.com/microsoft/ApplicationInsights-dotnet/issues/1152 for more details")]
107-
#endif
107+
#endif
108108
public static TelemetryConfiguration Active
109109
{
110110
get

BASE/src/Microsoft.ApplicationInsights/Metrics/Implementation/Util.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ internal static class Util
1616

1717
private const string FallbackParameterName = "specified parameter";
1818

19-
#if NETSTANDARD1_3 || NETSTANDARD2_0
19+
#if NETSTANDARD // This constant is defined for all versions of NetStandard https://docs.microsoft.com/en-us/dotnet/core/tutorials/libraries#how-to-multitarget
2020
private static string sdkVersionMoniker = SdkVersionUtils.GetSdkVersion("m-agg2c:");
2121
#else
2222
private static string sdkVersionMoniker = SdkVersionUtils.GetSdkVersion("m-agg2:");

BASE/src/Microsoft.ApplicationInsights/Microsoft.ApplicationInsights.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
<AssemblyName>Microsoft.ApplicationInsights</AssemblyName>
99
<TargetFrameworks>net45;net46;netstandard1.3;netstandard2.0</TargetFrameworks>
1010
<TargetFrameworks Condition="$(OS) != 'Windows_NT'">netstandard1.3;netstandard2.0</TargetFrameworks>
11+
12+
13+
<!-- this constant is set for all other netcore targets except 1-->
14+
<DefineConstants Condition="'$(TargetFramework)' == 'netstandard1.3'">$(DefineConstants);NETSTANDARD;</DefineConstants>
1115
</PropertyGroup>
1216

1317
<PropertyGroup>

BASE/src/Microsoft.ApplicationInsights/TelemetryClient.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
/// </summary>
2020
public sealed class TelemetryClient
2121
{
22-
#if NETSTANDARD1_3 || NETSTANDARD2_0
22+
#if NETSTANDARD // This constant is defined for all versions of NetStandard https://docs.microsoft.com/en-us/dotnet/core/tutorials/libraries#how-to-multitarget
2323
private const string VersionPrefix = "dotnetc:";
2424
#else
2525
private const string VersionPrefix = "dotnet:";
@@ -32,7 +32,7 @@ public sealed class TelemetryClient
3232
/// <summary>
3333
/// Initializes a new instance of the <see cref="TelemetryClient" /> class. Send telemetry with the active configuration, usually loaded from ApplicationInsights.config.
3434
/// </summary>
35-
#if NETSTANDARD1_3 || NETSTANDARD2_0
35+
#if NETSTANDARD // This constant is defined for all versions of NetStandard https://docs.microsoft.com/en-us/dotnet/core/tutorials/libraries#how-to-multitarget
3636
[Obsolete("We do not recommend using TelemetryConfiguration.Active on .NET Core. See https://github.com/microsoft/ApplicationInsights-dotnet/issues/1152 for more details")]
3737
#endif
3838
public TelemetryClient() : this(TelemetryConfiguration.Active)

BASE/src/ServerTelemetryChannel/TelemetryChannel.csproj

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
<AssemblyName>Microsoft.AI.ServerTelemetryChannel</AssemblyName>
99
<TargetFrameworks>net45;netstandard1.3;netstandard2.0</TargetFrameworks>
1010
<TargetFrameworks Condition="$(OS) != 'Windows_NT'">netstandard1.3;netstandard2.0</TargetFrameworks>
11+
12+
13+
<!-- this constant is set for all other netcore targets except 1-->
14+
<DefineConstants Condition="'$(TargetFramework)' == 'netstandard1.3'">$(DefineConstants);NETSTANDARD;</DefineConstants>
1115
</PropertyGroup>
1216

1317
<PropertyGroup>

0 commit comments

Comments
 (0)