diff --git a/.props/_GlobalStaticVersion.props b/.props/_GlobalStaticVersion.props index 256408e1ba..36d64677ee 100644 --- a/.props/_GlobalStaticVersion.props +++ b/.props/_GlobalStaticVersion.props @@ -11,9 +11,9 @@ Update for every public release. --> 2 - 14 + 15 0 - + beta1 - 2020-02-20 + 2020-04-13 + + + + + \ No newline at end of file diff --git a/LOGGING/src/EtwCollector/EtwCollector.csproj b/LOGGING/src/EtwCollector/EtwCollector.csproj index 8943a096bf..a2097502fb 100644 --- a/LOGGING/src/EtwCollector/EtwCollector.csproj +++ b/LOGGING/src/EtwCollector/EtwCollector.csproj @@ -37,6 +37,9 @@ All + + All + @@ -54,6 +57,11 @@ + + + + + diff --git a/LOGGING/src/EtwCollector/Properties/AssemblyInfo.cs b/LOGGING/src/EtwCollector/Properties/AssemblyInfo.cs index 5de21e53dc..8eda39505e 100644 --- a/LOGGING/src/EtwCollector/Properties/AssemblyInfo.cs +++ b/LOGGING/src/EtwCollector/Properties/AssemblyInfo.cs @@ -25,7 +25,7 @@ // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("9becfb0f-4f6d-4a84-931f-70da3e4e2813")] -[assembly: InternalsVisibleTo("Microsoft.ApplicationInsights.EtwCollector.Net46.Tests, PublicKey=" + AssemblyInfo.PublicKey)] +[assembly: InternalsVisibleTo("Microsoft.ApplicationInsights.EtwCollector.Tests, PublicKey=" + AssemblyInfo.PublicKey)] internal static class AssemblyInfo { diff --git a/LOGGING/src/EventSourceListener/EventSourceListener.csproj b/LOGGING/src/EventSourceListener/EventSourceListener.csproj index e2e19a4761..58c7536485 100644 --- a/LOGGING/src/EventSourceListener/EventSourceListener.csproj +++ b/LOGGING/src/EventSourceListener/EventSourceListener.csproj @@ -37,6 +37,9 @@ All + + All + @@ -51,6 +54,11 @@ + + + + + diff --git a/LOGGING/src/EventSourceListener/Properties/AssemblyInfo.cs b/LOGGING/src/EventSourceListener/Properties/AssemblyInfo.cs index 1bb5832ed6..9ee764f0e8 100644 --- a/LOGGING/src/EventSourceListener/Properties/AssemblyInfo.cs +++ b/LOGGING/src/EventSourceListener/Properties/AssemblyInfo.cs @@ -23,7 +23,7 @@ // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("a539bb1d-29ff-48e8-8d6e-dfcc543dc2b4")] -[assembly: InternalsVisibleTo("Microsoft.ApplicationInsights.EventSourceListener.NetCoreApp10.Tests, PublicKey=" + AssemblyInfo.PublicKey)] +[assembly: InternalsVisibleTo("Microsoft.ApplicationInsights.EventSourceListener.Tests, PublicKey=" + AssemblyInfo.PublicKey)] internal static class AssemblyInfo { diff --git a/LOGGING/src/ILogger/ILogger.csproj b/LOGGING/src/ILogger/ILogger.csproj index ad6255cfc0..3c984cdec3 100644 --- a/LOGGING/src/ILogger/ILogger.csproj +++ b/LOGGING/src/ILogger/ILogger.csproj @@ -36,6 +36,9 @@ All + + All + @@ -54,5 +57,10 @@ + + + + + diff --git a/LOGGING/src/Log4NetAppender/AssemblyInfo.cs b/LOGGING/src/Log4NetAppender/AssemblyInfo.cs index b09d65f1da..a2cf8e16bc 100644 --- a/LOGGING/src/Log4NetAppender/AssemblyInfo.cs +++ b/LOGGING/src/Log4NetAppender/AssemblyInfo.cs @@ -30,8 +30,7 @@ // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("599daa99-7d0b-4cae-81b8-3a73509f2efa")] -[assembly: InternalsVisibleTo("Microsoft.ApplicationInsights.Log4NetAppender.Net45.Tests, PublicKey=" + AssemblyInfo.PublicKey)] -[assembly: InternalsVisibleTo("Microsoft.ApplicationInsights.Log4NetAppender.NetCoreApp10.Tests, PublicKey=" + AssemblyInfo.PublicKey)] +[assembly: InternalsVisibleTo("Microsoft.ApplicationInsights.Log4NetAppender.Tests, PublicKey=" + AssemblyInfo.PublicKey)] internal static class AssemblyInfo { diff --git a/LOGGING/src/Log4NetAppender/Log4NetAppender.csproj b/LOGGING/src/Log4NetAppender/Log4NetAppender.csproj index cee0bc5499..138c1d3297 100644 --- a/LOGGING/src/Log4NetAppender/Log4NetAppender.csproj +++ b/LOGGING/src/Log4NetAppender/Log4NetAppender.csproj @@ -28,6 +28,9 @@ All + + All + @@ -52,6 +55,11 @@ + + + + + diff --git a/LOGGING/src/NLogTarget/AssemblyInfo.cs b/LOGGING/src/NLogTarget/AssemblyInfo.cs index 030dfdea9c..58502d58ea 100644 --- a/LOGGING/src/NLogTarget/AssemblyInfo.cs +++ b/LOGGING/src/NLogTarget/AssemblyInfo.cs @@ -30,8 +30,7 @@ // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("44abc834-bd19-449f-ad64-f8c83ca078ed")] -[assembly: InternalsVisibleTo("Microsoft.ApplicationInsights.NLogTarget.Net45.Tests, PublicKey=" + AssemblyInfo.PublicKey)] -[assembly: InternalsVisibleTo("Microsoft.ApplicationInsights.NLogTarget.NetCoreApp10.Tests, PublicKey=" + AssemblyInfo.PublicKey)] +[assembly: InternalsVisibleTo("Microsoft.ApplicationInsights.NLogTarget.Tests, PublicKey=" + AssemblyInfo.PublicKey)] internal static class AssemblyInfo { diff --git a/LOGGING/src/NLogTarget/NLogTarget.csproj b/LOGGING/src/NLogTarget/NLogTarget.csproj index 83b56fbcc3..e6a262c8a1 100644 --- a/LOGGING/src/NLogTarget/NLogTarget.csproj +++ b/LOGGING/src/NLogTarget/NLogTarget.csproj @@ -4,11 +4,11 @@ Microsoft.ApplicationInsights.NLogTarget Microsoft.ApplicationInsights.NLogTarget - + - + Microsoft.ApplicationInsights.NLogTarget @@ -28,6 +28,9 @@ All + + All + @@ -56,5 +59,10 @@ + + + + + \ No newline at end of file diff --git a/LOGGING/src/TraceListener/AssemblyInfo.cs b/LOGGING/src/TraceListener/AssemblyInfo.cs index b53a90796a..a5f2c5589d 100644 --- a/LOGGING/src/TraceListener/AssemblyInfo.cs +++ b/LOGGING/src/TraceListener/AssemblyInfo.cs @@ -30,8 +30,7 @@ // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("3aada9bf-fc15-42fd-ace5-4cb2f11c1f2a")] -[assembly: InternalsVisibleTo("Microsoft.ApplicationInsights.TraceListener.Net45.Tests, PublicKey=" + AssemblyInfo.PublicKey)] -[assembly: InternalsVisibleTo("Microsoft.ApplicationInsights.TraceListener.NetCoreApp10.Tests, PublicKey=" + AssemblyInfo.PublicKey)] +[assembly: InternalsVisibleTo("Microsoft.ApplicationInsights.TraceListener.Tests, PublicKey=" + AssemblyInfo.PublicKey)] internal static class AssemblyInfo { diff --git a/LOGGING/src/TraceListener/TraceListener.csproj b/LOGGING/src/TraceListener/TraceListener.csproj index 2fb4134b9b..ef7fd5ed75 100644 --- a/LOGGING/src/TraceListener/TraceListener.csproj +++ b/LOGGING/src/TraceListener/TraceListener.csproj @@ -4,11 +4,11 @@ Microsoft.ApplicationInsights.TraceListener Microsoft.ApplicationInsights.TraceListener - + - + Microsoft.ApplicationInsights.TraceListener @@ -28,6 +28,9 @@ All + + All + @@ -55,5 +58,10 @@ + + + + + diff --git a/LOGGING/test/DiagnosticSourceListener.netcoreapp10.Tests/DiagnosticSourceListener.netcoreapp1.Tests.csproj b/LOGGING/test/DiagnosticSourceListener.Tests/DiagnosticSourceListener.Tests.csproj similarity index 80% rename from LOGGING/test/DiagnosticSourceListener.netcoreapp10.Tests/DiagnosticSourceListener.netcoreapp1.Tests.csproj rename to LOGGING/test/DiagnosticSourceListener.Tests/DiagnosticSourceListener.Tests.csproj index 8d52fc35f2..cd9cef2b3f 100644 --- a/LOGGING/test/DiagnosticSourceListener.netcoreapp10.Tests/DiagnosticSourceListener.netcoreapp1.Tests.csproj +++ b/LOGGING/test/DiagnosticSourceListener.Tests/DiagnosticSourceListener.Tests.csproj @@ -2,15 +2,15 @@ Microsoft.ApplicationInsights.DiagnosticSourceListener.Tests - Microsoft.ApplicationInsights.DiagnosticSourceListener.NetCoreApp10.Tests - netcoreapp1.0 + Microsoft.ApplicationInsights.DiagnosticSourceListener.Tests + netcoreapp1.1;netcoreapp2.1;netcoreapp3.1 false - - + + diff --git a/LOGGING/test/DiagnosticSourceListener.netcoreapp10.Tests/DiagnosticSourceTelemetryModuleTests.cs b/LOGGING/test/DiagnosticSourceListener.Tests/DiagnosticSourceTelemetryModuleTests.cs similarity index 100% rename from LOGGING/test/DiagnosticSourceListener.netcoreapp10.Tests/DiagnosticSourceTelemetryModuleTests.cs rename to LOGGING/test/DiagnosticSourceListener.Tests/DiagnosticSourceTelemetryModuleTests.cs diff --git a/LOGGING/test/DiagnosticSourceListener.netcoreapp10.Tests/TestDiagnosticSource.cs b/LOGGING/test/DiagnosticSourceListener.Tests/TestDiagnosticSource.cs similarity index 100% rename from LOGGING/test/DiagnosticSourceListener.netcoreapp10.Tests/TestDiagnosticSource.cs rename to LOGGING/test/DiagnosticSourceListener.Tests/TestDiagnosticSource.cs diff --git a/LOGGING/test/EtwCollector.Net46.Tests/EtwCollector.Net46.Tests.csproj b/LOGGING/test/EtwCollector.Tests/EtwCollector.Tests.csproj similarity index 75% rename from LOGGING/test/EtwCollector.Net46.Tests/EtwCollector.Net46.Tests.csproj rename to LOGGING/test/EtwCollector.Tests/EtwCollector.Tests.csproj index b04b1c8a17..5a3c80126f 100644 --- a/LOGGING/test/EtwCollector.Net46.Tests/EtwCollector.Net46.Tests.csproj +++ b/LOGGING/test/EtwCollector.Tests/EtwCollector.Tests.csproj @@ -2,21 +2,25 @@ Microsoft.ApplicationInsights.EtwCollector.Tests - Microsoft.ApplicationInsights.EtwCollector.Net46.Tests - net46 + Microsoft.ApplicationInsights.EtwCollector.Tests + net46 false + false - - + + - + + + + diff --git a/LOGGING/test/EtwCollector.Net46.Tests/EtwTelemetryModuleTests.cs b/LOGGING/test/EtwCollector.Tests/EtwTelemetryModuleTests.cs similarity index 99% rename from LOGGING/test/EtwCollector.Net46.Tests/EtwTelemetryModuleTests.cs rename to LOGGING/test/EtwCollector.Tests/EtwTelemetryModuleTests.cs index 231be448e1..0e255c4975 100644 --- a/LOGGING/test/EtwCollector.Net46.Tests/EtwTelemetryModuleTests.cs +++ b/LOGGING/test/EtwCollector.Tests/EtwTelemetryModuleTests.cs @@ -528,7 +528,7 @@ private async Task WaitForItems(CustomTelemetryChannel channel, int count = 1, T { // Timed out waiting for new events to arrive. return; - } + } } while (itemsCaptured.Value < count); } diff --git a/LOGGING/test/EtwCollector.Net46.Tests/EventSourceModuleDiagnosticListener.cs b/LOGGING/test/EtwCollector.Tests/EventSourceModuleDiagnosticListener.cs similarity index 100% rename from LOGGING/test/EtwCollector.Net46.Tests/EventSourceModuleDiagnosticListener.cs rename to LOGGING/test/EtwCollector.Tests/EventSourceModuleDiagnosticListener.cs diff --git a/LOGGING/test/EtwCollector.Net46.Tests/Properties/AssemblyInfo.cs b/LOGGING/test/EtwCollector.Tests/Properties/AssemblyInfo.cs similarity index 87% rename from LOGGING/test/EtwCollector.Net46.Tests/Properties/AssemblyInfo.cs rename to LOGGING/test/EtwCollector.Tests/Properties/AssemblyInfo.cs index ce078ca29b..323353bc08 100644 --- a/LOGGING/test/EtwCollector.Net46.Tests/Properties/AssemblyInfo.cs +++ b/LOGGING/test/EtwCollector.Tests/Properties/AssemblyInfo.cs @@ -5,8 +5,8 @@ // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly: AssemblyTitle("Etw.Net451.Tests")] -[assembly: AssemblyProduct("Etw.Net451.Tests")] +[assembly: AssemblyTitle("Microsoft.ApplicationInsights.EtwCollector.Tests")] +[assembly: AssemblyProduct("Microsoft.ApplicationInsights.EtwCollector.Tests")] [assembly: AssemblyCopyright("Copyright © 2017")] // Setting ComVisible to false makes the types in this assembly not visible diff --git a/LOGGING/test/EtwCollector.Net46.Tests/TestProvider.cs b/LOGGING/test/EtwCollector.Tests/TestProvider.cs similarity index 100% rename from LOGGING/test/EtwCollector.Net46.Tests/TestProvider.cs rename to LOGGING/test/EtwCollector.Tests/TestProvider.cs diff --git a/LOGGING/test/EtwCollector.Net46.Tests/TraceEventSessionMock.cs b/LOGGING/test/EtwCollector.Tests/TraceEventSessionMock.cs similarity index 100% rename from LOGGING/test/EtwCollector.Net46.Tests/TraceEventSessionMock.cs rename to LOGGING/test/EtwCollector.Tests/TraceEventSessionMock.cs diff --git a/LOGGING/test/EtwCollector.Net46.Tests/TraceTelemetryComparer.cs b/LOGGING/test/EtwCollector.Tests/TraceTelemetryComparer.cs similarity index 100% rename from LOGGING/test/EtwCollector.Net46.Tests/TraceTelemetryComparer.cs rename to LOGGING/test/EtwCollector.Tests/TraceTelemetryComparer.cs diff --git a/LOGGING/test/EventSourceListener.netcoreapp10.Tests/EventSourceListener.netcoreapp10.Tests.csproj b/LOGGING/test/EventSourceListener.Tests/EventSourceListener.Tests.csproj similarity index 57% rename from LOGGING/test/EventSourceListener.netcoreapp10.Tests/EventSourceListener.netcoreapp10.Tests.csproj rename to LOGGING/test/EventSourceListener.Tests/EventSourceListener.Tests.csproj index afe09640a1..461b7f8829 100644 --- a/LOGGING/test/EventSourceListener.netcoreapp10.Tests/EventSourceListener.netcoreapp10.Tests.csproj +++ b/LOGGING/test/EventSourceListener.Tests/EventSourceListener.Tests.csproj @@ -1,23 +1,17 @@ - - - + + - Debug - AnyCPU - Properties Microsoft.ApplicationInsights.EventSourceListener.Tests - Microsoft.ApplicationInsights.EventSourceListener.NetCoreApp10.Tests - netcoreapp1.0 - 512 + Microsoft.ApplicationInsights.EventSourceListener.Tests + netcoreapp1.1;netcoreapp2.1;netcoreapp3.1 false - pdbonly - true + false - - + + diff --git a/LOGGING/test/EventSourceListener.netcoreapp10.Tests/EventSourceModuleDiagnosticListener.cs b/LOGGING/test/EventSourceListener.Tests/EventSourceModuleDiagnosticListener.cs similarity index 100% rename from LOGGING/test/EventSourceListener.netcoreapp10.Tests/EventSourceModuleDiagnosticListener.cs rename to LOGGING/test/EventSourceListener.Tests/EventSourceModuleDiagnosticListener.cs diff --git a/LOGGING/test/EventSourceListener.netcoreapp10.Tests/EventSourceTelemetryModuleTests.cs b/LOGGING/test/EventSourceListener.Tests/EventSourceTelemetryModuleTests.cs similarity index 99% rename from LOGGING/test/EventSourceListener.netcoreapp10.Tests/EventSourceTelemetryModuleTests.cs rename to LOGGING/test/EventSourceListener.Tests/EventSourceTelemetryModuleTests.cs index 43dc2bf175..25302f1b4f 100644 --- a/LOGGING/test/EventSourceListener.netcoreapp10.Tests/EventSourceTelemetryModuleTests.cs +++ b/LOGGING/test/EventSourceListener.Tests/EventSourceTelemetryModuleTests.cs @@ -294,7 +294,7 @@ public void ReportsAllProperties() expected.Properties.Add("EventId", TestEventSource.ComplexEventId.ToString(InvariantCulture)); expected.Properties.Add("EventName", nameof(TestEventSource.ComplexEvent)); expected.Properties.Add("ActivityId", activityId.ToString()); - expected.Properties.Add("Keywords", "0x8000F00000000001"); + expected.Properties.Add("Keywords", "0x0000F00000000001"); expected.Properties.Add("Channel", "Debug"); expected.Properties.Add("Opcode", "Extension"); expected.Properties.Add("Tags", "0x00000011"); diff --git a/LOGGING/test/EventSourceListener.netcoreapp10.Tests/OtherTestEventSource.cs b/LOGGING/test/EventSourceListener.Tests/OtherTestEventSource.cs similarity index 100% rename from LOGGING/test/EventSourceListener.netcoreapp10.Tests/OtherTestEventSource.cs rename to LOGGING/test/EventSourceListener.Tests/OtherTestEventSource.cs diff --git a/LOGGING/test/EventSourceListener.netcoreapp10.Tests/Properties/AssemblyInfo.cs b/LOGGING/test/EventSourceListener.Tests/Properties/AssemblyInfo.cs similarity index 89% rename from LOGGING/test/EventSourceListener.netcoreapp10.Tests/Properties/AssemblyInfo.cs rename to LOGGING/test/EventSourceListener.Tests/Properties/AssemblyInfo.cs index 94470b97d0..6f0f41b8f0 100644 --- a/LOGGING/test/EventSourceListener.netcoreapp10.Tests/Properties/AssemblyInfo.cs +++ b/LOGGING/test/EventSourceListener.Tests/Properties/AssemblyInfo.cs @@ -11,8 +11,8 @@ // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly: AssemblyTitle("EventSource.Net46.Tests")] -[assembly: AssemblyProduct("EventSource.Net46.Tests")] +[assembly: AssemblyTitle("Microsoft.ApplicationInsights.EventSourceListener.Tests")] +[assembly: AssemblyProduct("Microsoft.ApplicationInsights.EventSourceListener.Tests")] [assembly: AssemblyCopyright("Copyright © 2017")] // Setting ComVisible to false makes the types in this assembly not visible diff --git a/LOGGING/test/EventSourceListener.netcoreapp10.Tests/TestEventSource.cs b/LOGGING/test/EventSourceListener.Tests/TestEventSource.cs similarity index 100% rename from LOGGING/test/EventSourceListener.netcoreapp10.Tests/TestEventSource.cs rename to LOGGING/test/EventSourceListener.Tests/TestEventSource.cs diff --git a/LOGGING/test/EventSourceListener.netcoreapp10.Tests/TraceTelemetryComparer.cs b/LOGGING/test/EventSourceListener.Tests/TraceTelemetryComparer.cs similarity index 100% rename from LOGGING/test/EventSourceListener.netcoreapp10.Tests/TraceTelemetryComparer.cs rename to LOGGING/test/EventSourceListener.Tests/TraceTelemetryComparer.cs diff --git a/LOGGING/test/ILogger.NetStandard.Tests/ILogger.NetStandard.Tests.csproj b/LOGGING/test/ILogger.Tests/ILogger.Tests.csproj similarity index 75% rename from LOGGING/test/ILogger.NetStandard.Tests/ILogger.NetStandard.Tests.csproj rename to LOGGING/test/ILogger.Tests/ILogger.Tests.csproj index ea09ded47b..2404a77c00 100644 --- a/LOGGING/test/ILogger.NetStandard.Tests/ILogger.NetStandard.Tests.csproj +++ b/LOGGING/test/ILogger.Tests/ILogger.Tests.csproj @@ -1,7 +1,7 @@ - + - netcoreapp2.1 + netcoreapp2.1;netcoreapp3.1 false false @@ -9,8 +9,8 @@ - - + + diff --git a/LOGGING/test/ILogger.NetStandard.Tests/ILoggerIntegrationTests.cs b/LOGGING/test/ILogger.Tests/ILoggerIntegrationTests.cs similarity index 100% rename from LOGGING/test/ILogger.NetStandard.Tests/ILoggerIntegrationTests.cs rename to LOGGING/test/ILogger.Tests/ILoggerIntegrationTests.cs diff --git a/LOGGING/test/ILogger.NetStandard.Tests/TestTelemetryChannel.cs b/LOGGING/test/ILogger.Tests/TestTelemetryChannel.cs similarity index 100% rename from LOGGING/test/ILogger.NetStandard.Tests/TestTelemetryChannel.cs rename to LOGGING/test/ILogger.Tests/TestTelemetryChannel.cs diff --git a/LOGGING/test/ILogger.NetStandard.Tests/TestTelemetryProcessor.cs b/LOGGING/test/ILogger.Tests/TestTelemetryProcessor.cs similarity index 100% rename from LOGGING/test/ILogger.NetStandard.Tests/TestTelemetryProcessor.cs rename to LOGGING/test/ILogger.Tests/TestTelemetryProcessor.cs diff --git a/LOGGING/test/Log4NetAppender.NetCoreApp10.Tests/Log4NetAppender.NetCoreApp10.Tests.csproj b/LOGGING/test/Log4NetAppender.NetCoreApp10.Tests/Log4NetAppender.NetCoreApp10.Tests.csproj deleted file mode 100644 index f8ee07ad58..0000000000 --- a/LOGGING/test/Log4NetAppender.NetCoreApp10.Tests/Log4NetAppender.NetCoreApp10.Tests.csproj +++ /dev/null @@ -1,33 +0,0 @@ - - - - Microsoft.ApplicationInsights.Log4NetAppender.Tests - Microsoft.ApplicationInsights.Log4NetAppender.NetCoreApp10.Tests - netcoreapp1.0 - false - false - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/LOGGING/test/Log4NetAppender.Net45.Tests/ApplicationInsightsAppenderTests.cs b/LOGGING/test/Log4NetAppender.Tests/ApplicationInsightsAppenderTests.cs similarity index 99% rename from LOGGING/test/Log4NetAppender.Net45.Tests/ApplicationInsightsAppenderTests.cs rename to LOGGING/test/Log4NetAppender.Tests/ApplicationInsightsAppenderTests.cs index 09def85892..fab4faf7c7 100644 --- a/LOGGING/test/Log4NetAppender.Net45.Tests/ApplicationInsightsAppenderTests.cs +++ b/LOGGING/test/Log4NetAppender.Tests/ApplicationInsightsAppenderTests.cs @@ -108,7 +108,7 @@ public void ValidateLoggingIsWorking() { logger.Debug("Trace Debug" + i + DateTime.Now); } - + Assert.AreEqual(instrumentationKey, aiAppender.TelemetryClient.Context.InstrumentationKey); Assert.IsNull(errorHandler.Exception); } diff --git a/LOGGING/test/Log4NetAppender.Net45.Tests/GlobalSuppressions.cs b/LOGGING/test/Log4NetAppender.Tests/GlobalSuppressions.cs similarity index 100% rename from LOGGING/test/Log4NetAppender.Net45.Tests/GlobalSuppressions.cs rename to LOGGING/test/Log4NetAppender.Tests/GlobalSuppressions.cs diff --git a/LOGGING/test/Log4NetAppender.Net45.Tests/Log4NetAppender.Net45.Tests.csproj b/LOGGING/test/Log4NetAppender.Tests/Log4NetAppender.Tests.csproj similarity index 76% rename from LOGGING/test/Log4NetAppender.Net45.Tests/Log4NetAppender.Net45.Tests.csproj rename to LOGGING/test/Log4NetAppender.Tests/Log4NetAppender.Tests.csproj index a4040d6dfc..1e9a0f4bf4 100644 --- a/LOGGING/test/Log4NetAppender.Net45.Tests/Log4NetAppender.Net45.Tests.csproj +++ b/LOGGING/test/Log4NetAppender.Tests/Log4NetAppender.Tests.csproj @@ -2,20 +2,23 @@ Microsoft.ApplicationInsights.Log4NetAppender.Tests - Microsoft.ApplicationInsights.Log4NetAppender.Net45.Tests - net45 + Microsoft.ApplicationInsights.Log4NetAppender.Tests + net45;netcoreapp1.1;netcoreapp2.1;netcoreapp3.1 false + false - - + + - + + + diff --git a/LOGGING/test/Log4NetAppender.Net45.Tests/Properties/AssemblyInfo.cs b/LOGGING/test/Log4NetAppender.Tests/Properties/AssemblyInfo.cs similarity index 93% rename from LOGGING/test/Log4NetAppender.Net45.Tests/Properties/AssemblyInfo.cs rename to LOGGING/test/Log4NetAppender.Tests/Properties/AssemblyInfo.cs index 5fccfa640a..93b9728076 100644 --- a/LOGGING/test/Log4NetAppender.Net45.Tests/Properties/AssemblyInfo.cs +++ b/LOGGING/test/Log4NetAppender.Tests/Properties/AssemblyInfo.cs @@ -12,11 +12,11 @@ // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly: AssemblyTitle("Log4NetAppender.Net45.Tests")] +[assembly: AssemblyTitle("Log4NetAppender.Tests")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Log4NetAppender.Net45.Tests")] +[assembly: AssemblyProduct("Log4NetAppender.Tests")] [assembly: AssemblyCopyright("Copyright © 2015")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/LOGGING/test/NLogTarget.NetCoreApp10.Tests/NLogTarget.NetCoreApp10.Tests.csproj b/LOGGING/test/NLogTarget.NetCoreApp10.Tests/NLogTarget.NetCoreApp10.Tests.csproj deleted file mode 100644 index b4b031b49c..0000000000 --- a/LOGGING/test/NLogTarget.NetCoreApp10.Tests/NLogTarget.NetCoreApp10.Tests.csproj +++ /dev/null @@ -1,32 +0,0 @@ - - - - Microsoft.ApplicationInsights.NLogTarget.Tests - Microsoft.ApplicationInsights.NLogTarget.NetCoreApp10.Tests - netcoreapp1.0 - false - false - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/LOGGING/test/NLogTarget.Net45.Tests/NLogTarget.Net45.Tests.csproj b/LOGGING/test/NLogTarget.Tests/NLogTarget.Tests.csproj similarity index 72% rename from LOGGING/test/NLogTarget.Net45.Tests/NLogTarget.Net45.Tests.csproj rename to LOGGING/test/NLogTarget.Tests/NLogTarget.Tests.csproj index b610cb92a7..090616488c 100644 --- a/LOGGING/test/NLogTarget.Net45.Tests/NLogTarget.Net45.Tests.csproj +++ b/LOGGING/test/NLogTarget.Tests/NLogTarget.Tests.csproj @@ -2,18 +2,22 @@ Microsoft.ApplicationInsights.NLogTarget.Tests - Microsoft.ApplicationInsights.NLogTarget.Net45.Tests - net45 + Microsoft.ApplicationInsights.NLogTarget.Tests + net45;netcoreapp1.1;netcoreapp2.1;netcoreapp3.1 false + false - - + + + + + diff --git a/LOGGING/test/NLogTarget.Net45.Tests/NLogTargetTests.cs b/LOGGING/test/NLogTarget.Tests/NLogTargetTests.cs similarity index 100% rename from LOGGING/test/NLogTarget.Net45.Tests/NLogTargetTests.cs rename to LOGGING/test/NLogTarget.Tests/NLogTargetTests.cs diff --git a/LOGGING/test/NLogTarget.Net45.Tests/Properties/AssemblyInfo.cs b/LOGGING/test/NLogTarget.Tests/Properties/AssemblyInfo.cs similarity index 93% rename from LOGGING/test/NLogTarget.Net45.Tests/Properties/AssemblyInfo.cs rename to LOGGING/test/NLogTarget.Tests/Properties/AssemblyInfo.cs index 756aca27d7..abb8b02f13 100644 --- a/LOGGING/test/NLogTarget.Net45.Tests/Properties/AssemblyInfo.cs +++ b/LOGGING/test/NLogTarget.Tests/Properties/AssemblyInfo.cs @@ -12,11 +12,11 @@ // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly: AssemblyTitle("NLogTarget.Net45.Tests")] +[assembly: AssemblyTitle("NLogTarget.Tests")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("NLogTarget.Net45.Tests")] +[assembly: AssemblyProduct("NLogTarget.Tests")] [assembly: AssemblyCopyright("Copyright © 2015")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/LOGGING/test/Shared/ApplicationInsightsTraceFilterTests.cs b/LOGGING/test/TraceListener.Tests/ApplicationInsightsTraceFilterTests.cs similarity index 100% rename from LOGGING/test/Shared/ApplicationInsightsTraceFilterTests.cs rename to LOGGING/test/TraceListener.Tests/ApplicationInsightsTraceFilterTests.cs diff --git a/LOGGING/test/Shared/ApplicationInsightsTraceListenerTests.cs b/LOGGING/test/TraceListener.Tests/ApplicationInsightsTraceListenerTests.cs similarity index 100% rename from LOGGING/test/Shared/ApplicationInsightsTraceListenerTests.cs rename to LOGGING/test/TraceListener.Tests/ApplicationInsightsTraceListenerTests.cs diff --git a/LOGGING/test/TraceListener.Net45.Tests/Properties/AssemblyInfo.cs b/LOGGING/test/TraceListener.Tests/Properties/AssemblyInfo.cs similarity index 93% rename from LOGGING/test/TraceListener.Net45.Tests/Properties/AssemblyInfo.cs rename to LOGGING/test/TraceListener.Tests/Properties/AssemblyInfo.cs index 3ed8efd821..408b30adb7 100644 --- a/LOGGING/test/TraceListener.Net45.Tests/Properties/AssemblyInfo.cs +++ b/LOGGING/test/TraceListener.Tests/Properties/AssemblyInfo.cs @@ -12,11 +12,11 @@ // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly: AssemblyTitle("TraceListener.Net45.Tests")] +[assembly: AssemblyTitle("TraceListener.Tests")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("TraceListener.Net45.Tests")] +[assembly: AssemblyProduct("TraceListener.Tests")] [assembly: AssemblyCopyright("Copyright © 2015")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/LOGGING/test/TraceListener.Net45.Tests/TraceEventOptionsMatrix.xml b/LOGGING/test/TraceListener.Tests/TraceEventOptionsMatrix.xml similarity index 100% rename from LOGGING/test/TraceListener.Net45.Tests/TraceEventOptionsMatrix.xml rename to LOGGING/test/TraceListener.Tests/TraceEventOptionsMatrix.xml diff --git a/LOGGING/test/TraceListener.Net45.Tests/TraceFilterMatrix.xml b/LOGGING/test/TraceListener.Tests/TraceFilterMatrix.xml similarity index 100% rename from LOGGING/test/TraceListener.Net45.Tests/TraceFilterMatrix.xml rename to LOGGING/test/TraceListener.Tests/TraceFilterMatrix.xml diff --git a/LOGGING/test/TraceListener.Net45.Tests/TraceListener.Net45.Tests.csproj b/LOGGING/test/TraceListener.Tests/TraceListener.Tests.csproj similarity index 67% rename from LOGGING/test/TraceListener.Net45.Tests/TraceListener.Net45.Tests.csproj rename to LOGGING/test/TraceListener.Tests/TraceListener.Tests.csproj index 2818d25c06..43d943b5a9 100644 --- a/LOGGING/test/TraceListener.Net45.Tests/TraceListener.Net45.Tests.csproj +++ b/LOGGING/test/TraceListener.Tests/TraceListener.Tests.csproj @@ -2,27 +2,25 @@ Microsoft.ApplicationInsights.TraceListener.Tests - Microsoft.ApplicationInsights.TraceListener.Net45.Tests - net45 + Microsoft.ApplicationInsights.TraceListener.Tests + net45;netcoreapp1.1;netcoreapp2.1;netcoreapp3.1 false + false - - - - - - - + + - - + + + + diff --git a/LOGGING/test/TraceListener.netcoreapp10.Tests/TraceListener.netcoreapp10.Tests.csproj b/LOGGING/test/TraceListener.netcoreapp10.Tests/TraceListener.netcoreapp10.Tests.csproj deleted file mode 100644 index 70f55bb37e..0000000000 --- a/LOGGING/test/TraceListener.netcoreapp10.Tests/TraceListener.netcoreapp10.Tests.csproj +++ /dev/null @@ -1,36 +0,0 @@ - - - - Microsoft.ApplicationInsights.TraceListener.Tests - Microsoft.ApplicationInsights.TraceListener.NetCoreApp10.Tests - netcoreapp1.0 - false - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/LOGGING/test/Xdt.Tests/Xdt.Tests.csproj b/LOGGING/test/Xdt.Tests/Xdt.Tests.csproj index 38325123f0..28dd650864 100644 --- a/LOGGING/test/Xdt.Tests/Xdt.Tests.csproj +++ b/LOGGING/test/Xdt.Tests/Xdt.Tests.csproj @@ -9,8 +9,8 @@ - - + + diff --git a/NETCORE/.vsts/linux-build.yml b/NETCORE/.vsts/linux-build.yml index 1e96495132..88edc93429 100644 --- a/NETCORE/.vsts/linux-build.yml +++ b/NETCORE/.vsts/linux-build.yml @@ -2,20 +2,22 @@ pool: vmImage: 'ubuntu-16.04' steps: -- task: DotNetCoreInstaller@2 - displayName: install dotnet core 3.0.100-preview8-013656 +## Install NetCore 3.1, Restore Solution, Build Solution, Test NetCore 3.1 + +- task: DotNetCoreInstaller@1 + displayName: install dotnet core 3.1 inputs: - version: "3.0.100-preview8-013656" + version: 3.1.x - task: DotNetCoreCLI@1 - displayName: Restore solutions + displayName: DotNetCoreCLI - Restore Solution inputs: command: "restore" projects: "NETCORE/*.sln" continueOnError: true - task: DotNetCoreCLI@1 - displayName: build all projects + displayName: DotNetCoreCLI - Build Solution inputs: command: "build" projects: "NETCORE/*.sln" @@ -29,10 +31,28 @@ steps: projects: "NETCORE/test/**/TestApp30.Tests30.csproj" arguments: "--configuration Release -l trx" -- task: DotNetCoreInstaller@2 - displayName: install dotnet core 2.2.104 +- task: DotNetCoreCLI@1 + displayName: Unit Tests for AspNetCore 3.1 + continueOnError: true + inputs: + command: "test" + projects: "NETCORE/test/**/*AspNetCore.Tests.csproj" + arguments: "--configuration Release --framework netcoreapp3.1 -l trx" + +- task: DotNetCoreCLI@1 + displayName: Unit Tests + Func Tests for WorkerService for AspNetCore 3.1 + continueOnError: true + inputs: + command: "test" + projects: "NETCORE/test/**/*WorkerService.Tests.csproj" + arguments: "--configuration Release --framework netcoreapp3.1 -l trx" + +## Install and Test NetCore 2.2 + +- task: DotNetCoreInstaller@1 + displayName: install dotnet core 2.2 inputs: - version: "2.2.104" + version: 2.2.x - task: DotNetCoreCLI@1 displayName: Functional Tests 2.0 @@ -43,36 +63,39 @@ steps: arguments: "--configuration Release -l trx" - task: DotNetCoreCLI@1 - displayName: Unit Tests for AspNetCore + displayName: Unit Tests for AspNetCore 2.1 continueOnError: true inputs: command: "test" projects: "NETCORE/test/**/*AspNetCore.Tests.csproj" - arguments: "--configuration Release -l trx" - + arguments: "--configuration Release --framework netcoreapp2.1 -l trx" + - task: DotNetCoreCLI@1 - displayName: Unit Tests + Func Tests for WorkerService + displayName: Unit Tests + Func Tests for WorkerService for AspNetCore 2.1 continueOnError: true inputs: command: "test" projects: "NETCORE/test/**/*WorkerService.Tests.csproj" - arguments: "--configuration Release -l trx" + arguments: "--configuration Release --framework netcoreapp2.1 -l trx" + +## Publish Test results - task: PublishTestResults@2 + condition: always() inputs: testRunner: "VSTest" testResultsFiles: "**/*.trx" -- task: DotNetCoreCLI@1 - displayName: Package Nuget - inputs: - command: "pack" - projects: "NETCORE/src/**/**.csproj" - arguments: "--configuration Release --include-symbols --output $(build.artifactstagingdirectory)" +#- task: DotNetCoreCLI@1 +# displayName: Package Nuget +# inputs: +# command: "pack" +# projects: "NETCORE/src/**/**.csproj" +# arguments: "--configuration Release --include-symbols --output $(build.artifactstagingdirectory)" -- task: PublishBuildArtifacts@1 - inputs: - PathtoPublish: "$(build.artifactstagingdirectory)" - ArtifactName: "drop" - ArtifactType: "Container" \ No newline at end of file +#- task: PublishBuildArtifacts@1 +# inputs: +# PathtoPublish: "$(build.artifactstagingdirectory)" +# ArtifactName: "drop" +# ArtifactType: "Container" diff --git a/NETCORE/ApplicationInsights.AspNetCore.sln b/NETCORE/ApplicationInsights.AspNetCore.sln index 373c9e082b..af0cb6de35 100644 --- a/NETCORE/ApplicationInsights.AspNetCore.sln +++ b/NETCORE/ApplicationInsights.AspNetCore.sln @@ -28,27 +28,19 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ApplicationInsigh EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ApplicationInsights.AspNetCore.Tests", "test\Microsoft.ApplicationInsights.AspNetCore.Tests\Microsoft.ApplicationInsights.AspNetCore.Tests.csproj", "{2766D8AF-C20B-4F3A-8260-6C2D39B7A8A0}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FunctionalTestUtils", "test\FunctionalTestUtils\FunctionalTestUtils.csproj", "{B7217A00-66FA-49A8-8EF3-39C07E1F7E33}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EmptyApp.FunctionalTests10", "test\EmptyApp.FunctionalTests\EmptyApp.FunctionalTests10.csproj", "{71CE2DB2-C7AA-4454-B5F2-774BC575E321}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EmptyApp20.FunctionalTests20", "test\EmptyApp20.FunctionalTests\EmptyApp20.FunctionalTests20.csproj", "{C47AFD8A-3326-4391-8115-69349C04C3DA}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FunctionalTestUtils20", "test\FunctionalTestUtils20\FunctionalTestUtils20.csproj", "{937AF006-898E-43FD-80A6-B20D7E3A1944}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MVCFramework.FunctionalTests10", "test\MVCFramework.FunctionalTests\MVCFramework.FunctionalTests10.csproj", "{1D5825CC-2EC9-43A1-BE32-778EFF5EAC80}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MVCFramework20.FunctionalTests20", "test\MVCFramework20.FunctionalTests\MVCFramework20.FunctionalTests20.csproj", "{51198C41-CD4A-4006-84D4-DE20A0A44363}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebApi.FunctionalTests10", "test\WebApi.FunctionalTests\WebApi.FunctionalTests10.csproj", "{325C4ECE-BD4A-4CF2-BC80-FBD1024B5935}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebApi20.FunctionalTests20", "test\WebApi20.FunctionalTests\WebApi20.FunctionalTests20.csproj", "{C3B3F515-0305-4809-A9A8-37FD80428F74}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ApplicationInsightsTypes", "test\ApplicationInsightsTypes\ApplicationInsightsTypes.csproj", "{9DA7024F-216F-4FA5-9B6D-CE4216C2DD72}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestApp30", "test\TestApp30\TestApp30.csproj", "{8E71FECF-E090-409E-8551-C597F9DFB91C}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IntegrationTests.WebApp", "test\IntegrationTests.WebApp\IntegrationTests.WebApp.csproj", "{8E71FECF-E090-409E-8551-C597F9DFB91C}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestApp30.Tests30", "test\TestApp30.Tests\TestApp30.Tests30.csproj", "{FE9DB9A7-D9AE-4188-945C-393D70022D9A}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "IntegrationTests.Tests", "test\IntegrationTests.Tests\IntegrationTests.Tests.csproj", "{FE9DB9A7-D9AE-4188-945C-393D70022D9A}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.ApplicationInsights.WorkerService", "src\Microsoft.ApplicationInsights.WorkerService\Microsoft.ApplicationInsights.WorkerService.csproj", "{AECEE8DD-09AE-4DEA-8690-F76A37C0534B}" EndProject @@ -84,11 +76,9 @@ Global ..\WEB\Src\PerformanceCollector\Perf.Shared\Perf.Shared.projitems*{3c157fc2-2e52-45fc-87e8-76e4fced4260}*SharedItemsImports = 5 ..\LOGGING\src\CommonShared\CommonShared.projitems*{4a9ec531-f8b2-4cd1-bd6b-745f33e52e7b}*SharedItemsImports = 5 ..\WEB\Src\Common\Common.projitems*{8d13f3c8-d938-44fd-a0d8-b5d1712c95db}*SharedItemsImports = 5 - ..\WEB\Src\DependencyCollector\Shared\DependencyCollector.Shared.projitems*{8d13f3c8-d938-44fd-a0d8-b5d1712c95db}*SharedItemsImports = 5 src\Shared\Shared.projitems*{95ec3635-22e4-4c3a-a066-f5823a0648da}*SharedItemsImports = 5 src\Shared\Shared.projitems*{aecee8dd-09ae-4dea-8690-f76a37c0534b}*SharedItemsImports = 5 ..\WEB\Src\Common\Common.projitems*{af9287b2-0d23-4d85-9a3e-200a2a603278}*SharedItemsImports = 5 - ..\WEB\Src\WindowsServer\WindowsServer.Shared\WindowsServer.Shared.projitems*{af9287b2-0d23-4d85-9a3e-200a2a603278}*SharedItemsImports = 5 src\Shared\Shared.projitems*{d56f2979-d6bc-4ef2-bb9b-4077b3290599}*SharedItemsImports = 13 EndGlobalSection GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -104,14 +94,6 @@ Global {2766D8AF-C20B-4F3A-8260-6C2D39B7A8A0}.Debug|Any CPU.Build.0 = Debug|Any CPU {2766D8AF-C20B-4F3A-8260-6C2D39B7A8A0}.Release|Any CPU.ActiveCfg = Release|Any CPU {2766D8AF-C20B-4F3A-8260-6C2D39B7A8A0}.Release|Any CPU.Build.0 = Release|Any CPU - {B7217A00-66FA-49A8-8EF3-39C07E1F7E33}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B7217A00-66FA-49A8-8EF3-39C07E1F7E33}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B7217A00-66FA-49A8-8EF3-39C07E1F7E33}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B7217A00-66FA-49A8-8EF3-39C07E1F7E33}.Release|Any CPU.Build.0 = Release|Any CPU - {71CE2DB2-C7AA-4454-B5F2-774BC575E321}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {71CE2DB2-C7AA-4454-B5F2-774BC575E321}.Debug|Any CPU.Build.0 = Debug|Any CPU - {71CE2DB2-C7AA-4454-B5F2-774BC575E321}.Release|Any CPU.ActiveCfg = Release|Any CPU - {71CE2DB2-C7AA-4454-B5F2-774BC575E321}.Release|Any CPU.Build.0 = Release|Any CPU {C47AFD8A-3326-4391-8115-69349C04C3DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C47AFD8A-3326-4391-8115-69349C04C3DA}.Debug|Any CPU.Build.0 = Debug|Any CPU {C47AFD8A-3326-4391-8115-69349C04C3DA}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -120,18 +102,10 @@ Global {937AF006-898E-43FD-80A6-B20D7E3A1944}.Debug|Any CPU.Build.0 = Debug|Any CPU {937AF006-898E-43FD-80A6-B20D7E3A1944}.Release|Any CPU.ActiveCfg = Release|Any CPU {937AF006-898E-43FD-80A6-B20D7E3A1944}.Release|Any CPU.Build.0 = Release|Any CPU - {1D5825CC-2EC9-43A1-BE32-778EFF5EAC80}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1D5825CC-2EC9-43A1-BE32-778EFF5EAC80}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1D5825CC-2EC9-43A1-BE32-778EFF5EAC80}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1D5825CC-2EC9-43A1-BE32-778EFF5EAC80}.Release|Any CPU.Build.0 = Release|Any CPU {51198C41-CD4A-4006-84D4-DE20A0A44363}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {51198C41-CD4A-4006-84D4-DE20A0A44363}.Debug|Any CPU.Build.0 = Debug|Any CPU {51198C41-CD4A-4006-84D4-DE20A0A44363}.Release|Any CPU.ActiveCfg = Release|Any CPU {51198C41-CD4A-4006-84D4-DE20A0A44363}.Release|Any CPU.Build.0 = Release|Any CPU - {325C4ECE-BD4A-4CF2-BC80-FBD1024B5935}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {325C4ECE-BD4A-4CF2-BC80-FBD1024B5935}.Debug|Any CPU.Build.0 = Debug|Any CPU - {325C4ECE-BD4A-4CF2-BC80-FBD1024B5935}.Release|Any CPU.ActiveCfg = Release|Any CPU - {325C4ECE-BD4A-4CF2-BC80-FBD1024B5935}.Release|Any CPU.Build.0 = Release|Any CPU {C3B3F515-0305-4809-A9A8-37FD80428F74}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {C3B3F515-0305-4809-A9A8-37FD80428F74}.Debug|Any CPU.Build.0 = Debug|Any CPU {C3B3F515-0305-4809-A9A8-37FD80428F74}.Release|Any CPU.ActiveCfg = Release|Any CPU @@ -192,13 +166,9 @@ Global {16B44D67-6214-4DDE-B419-93EF073E2E69} = {8B5230E5-8138-44D6-839F-DF9248F195EE} {95EC3635-22E4-4C3A-A066-F5823A0648DA} = {2E6DDE9E-8C75-4F9C-8906-08EBDD6E73EF} {2766D8AF-C20B-4F3A-8260-6C2D39B7A8A0} = {8B5230E5-8138-44D6-839F-DF9248F195EE} - {B7217A00-66FA-49A8-8EF3-39C07E1F7E33} = {8B5230E5-8138-44D6-839F-DF9248F195EE} - {71CE2DB2-C7AA-4454-B5F2-774BC575E321} = {8B5230E5-8138-44D6-839F-DF9248F195EE} {C47AFD8A-3326-4391-8115-69349C04C3DA} = {8B5230E5-8138-44D6-839F-DF9248F195EE} {937AF006-898E-43FD-80A6-B20D7E3A1944} = {8B5230E5-8138-44D6-839F-DF9248F195EE} - {1D5825CC-2EC9-43A1-BE32-778EFF5EAC80} = {8B5230E5-8138-44D6-839F-DF9248F195EE} {51198C41-CD4A-4006-84D4-DE20A0A44363} = {8B5230E5-8138-44D6-839F-DF9248F195EE} - {325C4ECE-BD4A-4CF2-BC80-FBD1024B5935} = {8B5230E5-8138-44D6-839F-DF9248F195EE} {C3B3F515-0305-4809-A9A8-37FD80428F74} = {8B5230E5-8138-44D6-839F-DF9248F195EE} {9DA7024F-216F-4FA5-9B6D-CE4216C2DD72} = {8B5230E5-8138-44D6-839F-DF9248F195EE} {8E71FECF-E090-409E-8551-C597F9DFB91C} = {8B5230E5-8138-44D6-839F-DF9248F195EE} diff --git a/NETCORE/src/Microsoft.ApplicationInsights.AspNetCore/Extensions/RequestCollectionOptions.cs b/NETCORE/src/Microsoft.ApplicationInsights.AspNetCore/Extensions/RequestCollectionOptions.cs index 306dea33b8..f815698a99 100644 --- a/NETCORE/src/Microsoft.ApplicationInsights.AspNetCore/Extensions/RequestCollectionOptions.cs +++ b/NETCORE/src/Microsoft.ApplicationInsights.AspNetCore/Extensions/RequestCollectionOptions.cs @@ -25,12 +25,12 @@ public RequestCollectionOptions() } /// - /// Gets or sets a value indicating whether Request-Context header is injected into the response. + /// Gets or sets a value indicating whether the Request-Context header is to be injected into the response. /// public bool InjectResponseHeaders { get; set; } /// - /// Gets or sets a value indicating whether exceptions are be tracked by the RequestCOllectionModule. + /// Gets or sets a value indicating whether exceptions are to be tracked by the RequestCollectionModule. /// Exceptions could be tracked by ApplicationInsightsLoggerProvider as well which is not affected by /// this setting. /// diff --git a/NETCORE/src/Microsoft.ApplicationInsights.WorkerService/Microsoft.ApplicationInsights.WorkerService.csproj b/NETCORE/src/Microsoft.ApplicationInsights.WorkerService/Microsoft.ApplicationInsights.WorkerService.csproj index e8474791d8..cf2467e258 100644 --- a/NETCORE/src/Microsoft.ApplicationInsights.WorkerService/Microsoft.ApplicationInsights.WorkerService.csproj +++ b/NETCORE/src/Microsoft.ApplicationInsights.WorkerService/Microsoft.ApplicationInsights.WorkerService.csproj @@ -24,7 +24,7 @@ Microsoft.ApplicationInsights.WorkerService Application Insights for .NET Core Worker Service Applications Application Insights for .NET Core Worker Service Applications - Application Insights for .NET Core Worker Service (messaging, background tasks, and any non-HTTP workloads) applications. See https://azure.microsoft.com/documentation/articles/app-insights-asp-net-five/ for more information. Privacy statement: https://go.microsoft.com/fwlink/?LinkId=512156 + Application Insights for .NET Core Worker Service (messaging, background tasks, and any non-HTTP workloads) applications. See https://docs.microsoft.com/azure/azure-monitor/app/worker-service for more information. Privacy statement: https://go.microsoft.com/fwlink/?LinkId=512156 $(PackageTags)worker;console;backgroundtasks; @@ -39,6 +39,9 @@ All + + All + @@ -59,6 +62,11 @@ - + + + + + + diff --git a/NETCORE/test/EmptyApp.FunctionalTests/App.config b/NETCORE/test/EmptyApp.FunctionalTests/App.config deleted file mode 100644 index 17f9414bab..0000000000 --- a/NETCORE/test/EmptyApp.FunctionalTests/App.config +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/NETCORE/test/EmptyApp.FunctionalTests/EmptyApp.FunctionalTests10.csproj b/NETCORE/test/EmptyApp.FunctionalTests/EmptyApp.FunctionalTests10.csproj deleted file mode 100644 index e7d0758c00..0000000000 --- a/NETCORE/test/EmptyApp.FunctionalTests/EmptyApp.FunctionalTests10.csproj +++ /dev/null @@ -1,46 +0,0 @@ - - - - 2.0.0 - net46;netcoreapp1.0 - netcoreapp1.0 - win7-x86 - true - true - EmptyApp.FunctionalTests.Tests - EmptyApp.FunctionalTests - true - - pdbonly - true - - - - - - - - - - - - - - - - - - - - - - - Always - SettingsSingleFileGenerator - - - - - - - diff --git a/NETCORE/test/EmptyApp.FunctionalTests/FunctionalTest/ExceptionTelemetryEmptyAppTests.cs b/NETCORE/test/EmptyApp.FunctionalTests/FunctionalTest/ExceptionTelemetryEmptyAppTests.cs deleted file mode 100644 index eeef146c5b..0000000000 --- a/NETCORE/test/EmptyApp.FunctionalTests/FunctionalTest/ExceptionTelemetryEmptyAppTests.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System.Diagnostics; -using Xunit; -using Xunit.Abstractions; - -[assembly: CollectionBehavior(DisableTestParallelization = true)] -namespace EmptyApp.FunctionalTests.FunctionalTest -{ - using System; - using System.Reflection; - using FunctionalTestUtils; - using Microsoft.ApplicationInsights.DataContracts; - - public class ExceptionTelemetryEmptyAppTests : TelemetryTestsBase - { - private readonly string assemblyName; - - public ExceptionTelemetryEmptyAppTests(ITestOutputHelper output) : base(output) - { - this.assemblyName = this.GetType().GetTypeInfo().Assembly.GetName().Name; - } - - [Fact] - public void TestBasicRequestPropertiesAfterRequestingRequestThatThrows() - { - using (var server = new InProcessServer(assemblyName)) - { - const string RequestPath = "/Exception"; - - var expectedRequestTelemetry = new RequestTelemetry(); - - expectedRequestTelemetry.Name = "GET /Exception"; - expectedRequestTelemetry.ResponseCode = "500"; - expectedRequestTelemetry.Success = false; - expectedRequestTelemetry.Url = new System.Uri(server.BaseHost + RequestPath); - this.ValidateBasicRequest(server, "/Exception", expectedRequestTelemetry); - } - } - - [Fact] - public void TestBasicExceptionPropertiesAfterRequestingRequestThatThrows() - { - using (var server = new InProcessServer(assemblyName)) - { - var expectedExceptionTelemetry = new ExceptionTelemetry(); - expectedExceptionTelemetry.Exception = new InvalidOperationException(); - - this.ValidateBasicException(server, "/Exception", expectedExceptionTelemetry); - } - } - } -} diff --git a/NETCORE/test/EmptyApp.FunctionalTests/FunctionalTest/RequestTelemetryEmptyAppTests.cs b/NETCORE/test/EmptyApp.FunctionalTests/FunctionalTest/RequestTelemetryEmptyAppTests.cs deleted file mode 100644 index 3677a6c677..0000000000 --- a/NETCORE/test/EmptyApp.FunctionalTests/FunctionalTest/RequestTelemetryEmptyAppTests.cs +++ /dev/null @@ -1,79 +0,0 @@ -namespace EmptyApp.FunctionalTests.FunctionalTest -{ - using System.Linq; - using System.Net.Http; - using System.Reflection; - using FunctionalTestUtils; - using Microsoft.ApplicationInsights.DataContracts; - using Xunit; - using Xunit.Abstractions; - - public class RequestTelemetryEmptyAppTests : TelemetryTestsBase - { - private readonly string assemblyName; - - public RequestTelemetryEmptyAppTests(ITestOutputHelper output) : base(output) - { - this.assemblyName = this.GetType().GetTypeInfo().Assembly.GetName().Name; - } - - [Fact] - public void TestBasicRequestPropertiesAfterRequestingBasicPage() - { - using (var server = new InProcessServer(assemblyName)) - { - const string RequestPath = "/"; - - var expectedRequestTelemetry = new RequestTelemetry(); - expectedRequestTelemetry.Name = "GET /"; - expectedRequestTelemetry.ResponseCode = "200"; - expectedRequestTelemetry.Success = true; - expectedRequestTelemetry.Url = new System.Uri(server.BaseHost + RequestPath); - - this.ValidateBasicRequest(server, RequestPath, expectedRequestTelemetry); - } - } - - [Fact] - public void TestBasicRequestPropertiesAfterRequestingNotExistingPage() - { - using (var server = new InProcessServer(assemblyName)) - { - const string RequestPath = "/not/existing/controller"; - - var expectedRequestTelemetry = new RequestTelemetry(); - expectedRequestTelemetry.Name = "GET /not/existing/controller"; - expectedRequestTelemetry.ResponseCode = "404"; - expectedRequestTelemetry.Success = false; - expectedRequestTelemetry.Url = new System.Uri(server.BaseHost + RequestPath); - - this.ValidateBasicRequest(server, RequestPath, expectedRequestTelemetry); - } - } - - [Fact] - public void TestMixedTelemetryItemsReceived() - { - InProcessServer server; - using (server = new InProcessServer(assemblyName)) - { - using (var httpClient = new HttpClient()) - { - var task = httpClient.GetAsync(server.BaseHost + "/Mixed"); - task.Wait(TestTimeoutMs); - } - } - - var telemetries = server.BackChannel.Buffer; - Assert.Contains(telemetries.OfType(), t => t.Name == "GET /Mixed"); - Assert.True(telemetries.Count >= 4); - Assert.Contains(telemetries.OfType(), t => t.Name == "GET /Mixed"); - Assert.Contains(telemetries.OfType(), t => t.Name == "GetContact"); - Assert.Contains(telemetries.OfType(), - t => t.Name == "ContactFile" && t.Value == 1); - - Assert.Contains(telemetries.OfType(), - t => t.Message == "Fetched contact details." && t.SeverityLevel == SeverityLevel.Information); - } - } -} diff --git a/NETCORE/test/EmptyApp.FunctionalTests/FunctionalTest/TelemetryModuleWorkingEmptyAppTests.cs b/NETCORE/test/EmptyApp.FunctionalTests/FunctionalTest/TelemetryModuleWorkingEmptyAppTests.cs deleted file mode 100644 index ffb17a1eec..0000000000 --- a/NETCORE/test/EmptyApp.FunctionalTests/FunctionalTest/TelemetryModuleWorkingEmptyAppTests.cs +++ /dev/null @@ -1,32 +0,0 @@ -namespace EmptyApp.FunctionalTests.FunctionalTest -{ - using System.Reflection; - using FunctionalTestUtils; - using Xunit; - using Xunit.Abstractions; - - public class TelemetryModuleWorkingEmptyAppTests : TelemetryTestsBase - { - private readonly string assemblyName; - - public TelemetryModuleWorkingEmptyAppTests(ITestOutputHelper output) : base(output) - { - this.assemblyName = this.GetType().GetTypeInfo().Assembly.GetName().Name; - } - - // The NET451 conditional check is wrapped inside the test to make the tests visible in the test explorer. We can move them to the class level once if the issue is resolved. - [Fact] - public void TestBasicDependencyPropertiesAfterRequestingBasicPage() - { - this.ValidateBasicDependency(assemblyName, "/"); - } - - [Fact] - public void TestIfPerformanceCountersAreCollected() - { -#if NET451 || NET46 - ValidatePerformanceCountersAreCollected(assemblyName); -#endif - } - } -} diff --git a/NETCORE/test/EmptyApp.FunctionalTests/Properties/launchSettings.json b/NETCORE/test/EmptyApp.FunctionalTests/Properties/launchSettings.json deleted file mode 100644 index e37175bc3f..0000000000 --- a/NETCORE/test/EmptyApp.FunctionalTests/Properties/launchSettings.json +++ /dev/null @@ -1,25 +0,0 @@ -{ - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:4828/", - "sslPort": 0 - } - }, - "profiles": { - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "environmentVariables": { - "ASPNET_ENVIRONMENT": "Development" - } - }, - "web": { - "commandName": "web", - "environmentVariables": { - "ASPNET_ENVIRONMENT": "Development" - } - } - } -} \ No newline at end of file diff --git a/NETCORE/test/EmptyApp.FunctionalTests/Startup.cs b/NETCORE/test/EmptyApp.FunctionalTests/Startup.cs deleted file mode 100644 index 07d782ce3b..0000000000 --- a/NETCORE/test/EmptyApp.FunctionalTests/Startup.cs +++ /dev/null @@ -1,57 +0,0 @@ -namespace EmptyApp.FunctionalTests -{ - using System; - using Microsoft.AspNetCore.Builder; - using Microsoft.AspNetCore.Http; - using Microsoft.Extensions.DependencyInjection; - using Microsoft.ApplicationInsights.AspNetCore.Extensions; - using Microsoft.Extensions.Configuration; - using Microsoft.ApplicationInsights.Channel; - using FunctionalTestUtils; - using Microsoft.ApplicationInsights; - using Microsoft.ApplicationInsights.DataContracts; - - public class Startup - { - // For more information on how to configure your application, visit http://go.microsoft.com/fwlink/?LinkID=398940 - public void ConfigureServices(IServiceCollection services) - { - services.AddSingleton(new BackTelemetryChannel()); - - var builder = new ConfigurationBuilder(); - builder.AddApplicationInsightsSettings(instrumentationKey: "Foo"); - services.AddApplicationInsightsTelemetry(builder.Build()); - } - - public void Configure(IApplicationBuilder app) - { - app.UseDeveloperExceptionPage(); - app.Use(next => - { - return async context => - { - if (context.Request.GetUri().ToString().Contains("Exception")) - { - throw new InvalidOperationException(); - } - else if (context.Request.GetUri().PathAndQuery == "/") - { - await context.Response.WriteAsync("Hello!"); - } - else if (context.Request.GetUri().ToString().Contains("Mixed")) - { - TelemetryClient telemetryClient = (TelemetryClient)context.RequestServices.GetService(typeof(TelemetryClient)); - telemetryClient.TrackEvent("GetContact"); - telemetryClient.TrackMetric("ContactFile", 1); - telemetryClient.TrackTrace("Fetched contact details.", SeverityLevel.Information); - await context.Response.WriteAsync("Hello!"); - } - else - { - await next(context); - } - }; - }); - } - } -} diff --git a/NETCORE/test/FunctionalTestUtils/BackTelemetryChannel.cs b/NETCORE/test/FunctionalTestUtils/BackTelemetryChannel.cs deleted file mode 100644 index ecde949c3f..0000000000 --- a/NETCORE/test/FunctionalTestUtils/BackTelemetryChannel.cs +++ /dev/null @@ -1,60 +0,0 @@ -namespace FunctionalTestUtils -{ - using System; - using System.Collections.Generic; - using Microsoft.ApplicationInsights.Channel; - - public class BackTelemetryChannel : ITelemetryChannel - { - private IList buffer; - - public BackTelemetryChannel() - { - this.buffer = new List(); - } - - public IList Buffer - { - get - { - return this.buffer; - } - } - - public bool? DeveloperMode - { - get - { - return true; - } - set - { - } - } - - public string EndpointAddress - { - get - { - return "https://dc.services.visualstudio.com/v2/track"; - } - - set - { - } - } - - public void Dispose() - { - } - - public void Flush() - { - } - - public void Send(ITelemetry item) - { - this.buffer.Add(item); - } - } -} \ No newline at end of file diff --git a/NETCORE/test/FunctionalTestUtils/FunctionalTestUtils.csproj b/NETCORE/test/FunctionalTestUtils/FunctionalTestUtils.csproj deleted file mode 100644 index 5e3e0d48fc..0000000000 --- a/NETCORE/test/FunctionalTestUtils/FunctionalTestUtils.csproj +++ /dev/null @@ -1,31 +0,0 @@ - - - - 1.0.2 - net46;netstandard1.6 - netstandard1.6 - true - FunctionalTestUtils - FunctionalTestUtils - 1.6.1 - - - - - - - - - - - - - - - - - - - - - diff --git a/NETCORE/test/FunctionalTestUtils/InProcessServer.cs b/NETCORE/test/FunctionalTestUtils/InProcessServer.cs deleted file mode 100644 index 8e456f1b70..0000000000 --- a/NETCORE/test/FunctionalTestUtils/InProcessServer.cs +++ /dev/null @@ -1,79 +0,0 @@ -namespace FunctionalTestUtils -{ - using System; - using System.IO; - using Microsoft.ApplicationInsights.Channel; - using Microsoft.AspNetCore.Hosting; - using Microsoft.Extensions.DependencyInjection; - - // a variant of aspnet/Hosting/test/Microsoft.AspNetCore.Hosting.Tests/HostingEngineTests.cs - public class InProcessServer : IDisposable - { - private static Random random = new Random(); - - public static Func UseApplicationInsights = - builder => builder.UseApplicationInsights(); - - private readonly Func configureHost; - private IWebHost hostingEngine; - private string url; - - private readonly BackTelemetryChannel backChannel; - - public BackTelemetryChannel BackChannel - { - get - { - return this.backChannel; - } - } - - public InProcessServer(string assemblyName, Func configureHost = null) - { - this.configureHost = configureHost; - // localhost instead of machine name, as its not possible to get machine name when running non windows. - var machineName = "localhost"; - this.url = "http://" + machineName + ":" + random.Next(5000, 14000).ToString(); - this.backChannel = this.Start(assemblyName); - } - - public string BaseHost - { - get - { - return this.url; - } - } - - public IServiceProvider ApplicationServices { get; private set; } - - private BackTelemetryChannel Start(string assemblyName) - { - var builder = new WebHostBuilder() - .UseContentRoot(Directory.GetCurrentDirectory()) - .UseUrls(this.BaseHost) - .UseKestrel() - .UseStartup(assemblyName) - .UseEnvironment("Production"); - if (configureHost != null) - { - builder = configureHost(builder); - } - - this.hostingEngine = builder.Build(); - - this.hostingEngine.Start(); - - this.ApplicationServices = this.hostingEngine.Services; - return (BackTelemetryChannel)this.hostingEngine.Services.GetService(); - } - - public void Dispose() - { - if (this.hostingEngine != null) - { - this.hostingEngine.Dispose(); - } - } - } -} diff --git a/NETCORE/test/FunctionalTestUtils/Properties/launchSettings.json b/NETCORE/test/FunctionalTestUtils/Properties/launchSettings.json deleted file mode 100644 index 454a7722af..0000000000 --- a/NETCORE/test/FunctionalTestUtils/Properties/launchSettings.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:4824/", - "sslPort": 0 - } - }, - "profiles": { - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "environmentVariables": { - "ASPNET_ENVIRONMENT": "Development" - } - } - } -} \ No newline at end of file diff --git a/NETCORE/test/FunctionalTestUtils/TelemetryTestsBase.cs b/NETCORE/test/FunctionalTestUtils/TelemetryTestsBase.cs deleted file mode 100644 index 732dbd41c2..0000000000 --- a/NETCORE/test/FunctionalTestUtils/TelemetryTestsBase.cs +++ /dev/null @@ -1,165 +0,0 @@ -namespace FunctionalTestUtils -{ - using System; - using System.Diagnostics; - using System.Collections.Generic; - using System.Linq; - using System.Net.Http; - using System.Reflection; - using System.Runtime.CompilerServices; - using System.Threading; - using System.Threading.Tasks; - using Microsoft.ApplicationInsights.DataContracts; - using Microsoft.AspNetCore.Hosting; - using Microsoft.Extensions.DependencyInjection; - using Xunit; - using Xunit.Abstractions; -#if NET451 || NET46 - using System.Net; - using Microsoft.ApplicationInsights.Extensibility.PerfCounterCollector; - using Microsoft.ApplicationInsights.Extensibility; -#endif - - public abstract class TelemetryTestsBase - { - protected const int TestTimeoutMs = 10000; - private object noParallelism = new object(); - protected readonly ITestOutputHelper output; - public TelemetryTestsBase(ITestOutputHelper output) - { - this.output = output; - } - - [MethodImpl(MethodImplOptions.NoOptimization)] - public void ValidateBasicRequest(InProcessServer server, string requestPath, RequestTelemetry expected) - { - lock (noParallelism) - { - // Subtract 50 milliseconds to hack around strange behavior on build server where the RequestTelemetry.Timestamp is somehow sometimes earlier than now by a few milliseconds. - expected.Timestamp = DateTimeOffset.Now.Subtract(TimeSpan.FromMilliseconds(50)); - server.BackChannel.Buffer.Clear(); - Stopwatch timer = Stopwatch.StartNew(); - - var httpClientHandler = new HttpClientHandler(); - httpClientHandler.UseDefaultCredentials = true; - - Task task; - using (HttpClient httpClient = new HttpClient(httpClientHandler, true)) - { - task = httpClient.GetAsync(server.BaseHost + requestPath); - task.Wait(TestTimeoutMs); - } - - timer.Stop(); - server.Dispose(); - - RequestTelemetry actual = server.BackChannel.Buffer.OfType().Where(t => t.Name == expected.Name).Single(); - server.BackChannel.Buffer.Clear(); - - Assert.Equal(expected.ResponseCode, actual.ResponseCode); - Assert.Equal(expected.Name, actual.Name); - Assert.Equal(expected.Success, actual.Success); - Assert.Equal(expected.Url, actual.Url); - InRange(actual.Timestamp, expected.Timestamp, DateTimeOffset.Now); - Assert.True(actual.Duration < timer.Elapsed, $"actual.Duration '{actual.Duration}' is not less than timer.Elpased '{timer.Elapsed}'"); - } - } - - public void ValidateBasicException(InProcessServer server, string requestPath, ExceptionTelemetry expected) - { - var httpClientHandler = new HttpClientHandler(); - httpClientHandler.UseDefaultCredentials = true; - - Task task; - using (var httpClient = new HttpClient(httpClientHandler, true)) - { - task = httpClient.GetAsync(server.BaseHost + requestPath); - task.Wait(TestTimeoutMs); - } - var result = task.Result; - server.Dispose(); - var actual = server.BackChannel.Buffer.OfType().Single(); - - Assert.Equal(expected.Exception.GetType(), actual.Exception.GetType()); - Assert.NotEmpty(actual.Exception.StackTrace); - Assert.NotEmpty(actual.Context.Operation.Name); - Assert.NotEmpty(actual.Context.Operation.Id); - } - - public void ValidateBasicDependency(string assemblyName, string requestPath, Func configureHost = null) - { - DependencyTelemetry expected = new DependencyTelemetry(); - expected.ResultCode = "200"; - expected.Success = true; - expected.Name = "GET " + requestPath; - - InProcessServer server; - using (server = new InProcessServer(assemblyName, configureHost)) - { - expected.Data = server.BaseHost + requestPath; - - var timer = Stopwatch.StartNew(); - Task task; - using (var httpClient = new HttpClient()) - { - task = httpClient.GetAsync(server.BaseHost + requestPath); - task.Wait(TestTimeoutMs); - } - var result = task.Result; - timer.Stop(); - } - - IEnumerable dependencies = server.BackChannel.Buffer.OfType(); - Assert.NotNull(dependencies); - Assert.NotEmpty(dependencies); - - var dependencyTelemetry = dependencies.FirstOrDefault(d => d.Name == expected.Name - && d.Data == expected.Data - && d.Success == expected.Success - && d.ResultCode == expected.ResultCode); - Assert.NotNull(dependencyTelemetry); - -#if netcoreapp1_0 - var requestTelemetry = server.BackChannel.Buffer.OfType().Single(); - Assert.Equal(requestTelemetry.Context.Operation.ParentId, dependencyTelemetry.Id); -#endif - } - -#if NET451 || NET46 - public void ValidatePerformanceCountersAreCollected(string assemblyName, Func configureHost = null) - { - using (var server = new InProcessServer(assemblyName, configureHost)) - { - // Reconfigure the PerformanceCollectorModule timer. - Type perfModuleType = typeof(PerformanceCollectorModule); - PerformanceCollectorModule perfModule = (PerformanceCollectorModule)server.ApplicationServices.GetServices().FirstOrDefault(m => m.GetType() == perfModuleType); - FieldInfo timerField = perfModuleType.GetField("timer", BindingFlags.NonPublic | BindingFlags.Instance); - var timer = timerField.GetValue(perfModule); - timerField.FieldType.InvokeMember("ScheduleNextTick", BindingFlags.InvokeMethod | BindingFlags.Public | BindingFlags.Instance, null, timer, new object[] { TimeSpan.FromMilliseconds(10) }); - - DateTime timeout = DateTime.UtcNow.AddMilliseconds(TestTimeoutMs); - int numberOfCountersSent = 0; - do - { - Thread.Sleep(1000); - numberOfCountersSent += server.BackChannel.Buffer.OfType().Distinct().Count(); - } while (numberOfCountersSent == 0 && DateTime.UtcNow < timeout); - - Assert.True(numberOfCountersSent > 0); - } - } -#endif - - /// - /// Tests if a DateTimeOffset is in a specified range and prints a more detailed error message if it is not. - /// - /// The actual value to test. - /// The minimum of the range. - /// The maximum of the range. - private void InRange(DateTimeOffset actual, DateTimeOffset low, DateTimeOffset high) - { - string dateFormat = "yyyy-MM-dd HH:mm:ss.ffffzzz"; - Assert.True(low <= actual && actual <= high, $"Range: ({low.ToString(dateFormat)} - {high.ToString(dateFormat)})\nActual: {actual.ToString(dateFormat)}"); - } - } -} \ No newline at end of file diff --git a/NETCORE/test/TestApp30.Tests/BasicTestWithCorrelation.cs b/NETCORE/test/IntegrationTests.Tests/BasicTestWithCorrelation.cs similarity index 98% rename from NETCORE/test/TestApp30.Tests/BasicTestWithCorrelation.cs rename to NETCORE/test/IntegrationTests.Tests/BasicTestWithCorrelation.cs index cc3f7dd601..a963e9d5b5 100644 --- a/NETCORE/test/TestApp30.Tests/BasicTestWithCorrelation.cs +++ b/NETCORE/test/IntegrationTests.Tests/BasicTestWithCorrelation.cs @@ -10,15 +10,15 @@ using Xunit; using Xunit.Abstractions; -namespace TestApp30.Tests +namespace IntegrationTests.Tests { - public class BasicTestWithCorrelation : IClassFixture> + public class BasicTestWithCorrelation : IClassFixture> { - private readonly CustomWebApplicationFactory _factory; + private readonly CustomWebApplicationFactory _factory; protected readonly ITestOutputHelper output; - public BasicTestWithCorrelation(CustomWebApplicationFactory factory, ITestOutputHelper output) + public BasicTestWithCorrelation(CustomWebApplicationFactory factory, ITestOutputHelper output) { this.output = output; _factory = factory; diff --git a/NETCORE/test/TestApp30.Tests/CustomWebApplicationFactory.cs b/NETCORE/test/IntegrationTests.Tests/CustomWebApplicationFactory.cs similarity index 97% rename from NETCORE/test/TestApp30.Tests/CustomWebApplicationFactory.cs rename to NETCORE/test/IntegrationTests.Tests/CustomWebApplicationFactory.cs index b9db6d8c15..7a289d4416 100644 --- a/NETCORE/test/TestApp30.Tests/CustomWebApplicationFactory.cs +++ b/NETCORE/test/IntegrationTests.Tests/CustomWebApplicationFactory.cs @@ -10,7 +10,7 @@ using System.Linq; using System.Threading.Tasks; -namespace TestApp30.Tests +namespace IntegrationTests.Tests { public class CustomWebApplicationFactory : WebApplicationFactory where TStartup : class diff --git a/NETCORE/test/IntegrationTests.Tests/IntegrationTests.Tests.csproj b/NETCORE/test/IntegrationTests.Tests/IntegrationTests.Tests.csproj new file mode 100644 index 0000000000..08226f1006 --- /dev/null +++ b/NETCORE/test/IntegrationTests.Tests/IntegrationTests.Tests.csproj @@ -0,0 +1,28 @@ + + + + + + netcoreapp3.1 + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + + + + + diff --git a/NETCORE/test/TestApp30.Tests/Properties/launchSettings.json b/NETCORE/test/IntegrationTests.Tests/Properties/launchSettings.json similarity index 100% rename from NETCORE/test/TestApp30.Tests/Properties/launchSettings.json rename to NETCORE/test/IntegrationTests.Tests/Properties/launchSettings.json diff --git a/NETCORE/test/TestApp30.Tests/StubChannel.cs b/NETCORE/test/IntegrationTests.Tests/StubChannel.cs similarity index 94% rename from NETCORE/test/TestApp30.Tests/StubChannel.cs rename to NETCORE/test/IntegrationTests.Tests/StubChannel.cs index 22c308ab59..9ece18ec87 100644 --- a/NETCORE/test/TestApp30.Tests/StubChannel.cs +++ b/NETCORE/test/IntegrationTests.Tests/StubChannel.cs @@ -1,7 +1,7 @@ using Microsoft.ApplicationInsights.Channel; using System; -namespace TestApp30.Tests +namespace IntegrationTests.Tests { internal class StubChannel : ITelemetryChannel { diff --git a/NETCORE/test/TestApp30/Controllers/HomeController.cs b/NETCORE/test/IntegrationTests.WebApp/Controllers/HomeController.cs similarity index 92% rename from NETCORE/test/TestApp30/Controllers/HomeController.cs rename to NETCORE/test/IntegrationTests.WebApp/Controllers/HomeController.cs index 9e6f9564ad..b71c7ed3eb 100644 --- a/NETCORE/test/TestApp30/Controllers/HomeController.cs +++ b/NETCORE/test/IntegrationTests.WebApp/Controllers/HomeController.cs @@ -5,9 +5,9 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; -using TestApp30.Models; +using IntegrationTests.WebApp.Models; -namespace TestApp30.Controllers +namespace IntegrationTests.WebApp.Controllers { public class HomeController : Controller { diff --git a/NETCORE/test/IntegrationTests.WebApp/IntegrationTests.WebApp.csproj b/NETCORE/test/IntegrationTests.WebApp/IntegrationTests.WebApp.csproj new file mode 100644 index 0000000000..d61dbf2948 --- /dev/null +++ b/NETCORE/test/IntegrationTests.WebApp/IntegrationTests.WebApp.csproj @@ -0,0 +1,19 @@ + + + + + + netcoreapp3.1 + + + + + + + diff --git a/NETCORE/test/TestApp30/Models/ErrorViewModel.cs b/NETCORE/test/IntegrationTests.WebApp/Models/ErrorViewModel.cs similarity index 81% rename from NETCORE/test/TestApp30/Models/ErrorViewModel.cs rename to NETCORE/test/IntegrationTests.WebApp/Models/ErrorViewModel.cs index d2524f0fd2..1052488b0c 100644 --- a/NETCORE/test/TestApp30/Models/ErrorViewModel.cs +++ b/NETCORE/test/IntegrationTests.WebApp/Models/ErrorViewModel.cs @@ -1,6 +1,6 @@ using System; -namespace TestApp30.Models +namespace IntegrationTests.WebApp.Models { public class ErrorViewModel { diff --git a/NETCORE/test/TestApp30/Program.cs b/NETCORE/test/IntegrationTests.WebApp/Program.cs similarity index 95% rename from NETCORE/test/TestApp30/Program.cs rename to NETCORE/test/IntegrationTests.WebApp/Program.cs index 4231b20f15..e382a728f7 100644 --- a/NETCORE/test/TestApp30/Program.cs +++ b/NETCORE/test/IntegrationTests.WebApp/Program.cs @@ -7,7 +7,7 @@ using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Logging; -namespace TestApp30 +namespace IntegrationTests.WebApp { public class Program { diff --git a/NETCORE/test/TestApp30/Properties/launchSettings.json b/NETCORE/test/IntegrationTests.WebApp/Properties/launchSettings.json similarity index 100% rename from NETCORE/test/TestApp30/Properties/launchSettings.json rename to NETCORE/test/IntegrationTests.WebApp/Properties/launchSettings.json diff --git a/NETCORE/test/TestApp30/Startup.cs b/NETCORE/test/IntegrationTests.WebApp/Startup.cs similarity index 97% rename from NETCORE/test/TestApp30/Startup.cs rename to NETCORE/test/IntegrationTests.WebApp/Startup.cs index 732f15573e..5a5c10eeb3 100644 --- a/NETCORE/test/TestApp30/Startup.cs +++ b/NETCORE/test/IntegrationTests.WebApp/Startup.cs @@ -8,7 +8,7 @@ using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; -namespace TestApp30 +namespace IntegrationTests.WebApp { public class Startup { diff --git a/NETCORE/test/TestApp30/Views/Home/Index.cshtml b/NETCORE/test/IntegrationTests.WebApp/Views/Home/Index.cshtml similarity index 100% rename from NETCORE/test/TestApp30/Views/Home/Index.cshtml rename to NETCORE/test/IntegrationTests.WebApp/Views/Home/Index.cshtml diff --git a/NETCORE/test/TestApp30/Views/Home/Privacy.cshtml b/NETCORE/test/IntegrationTests.WebApp/Views/Home/Privacy.cshtml similarity index 100% rename from NETCORE/test/TestApp30/Views/Home/Privacy.cshtml rename to NETCORE/test/IntegrationTests.WebApp/Views/Home/Privacy.cshtml diff --git a/NETCORE/test/TestApp30/Views/Shared/Error.cshtml b/NETCORE/test/IntegrationTests.WebApp/Views/Shared/Error.cshtml similarity index 100% rename from NETCORE/test/TestApp30/Views/Shared/Error.cshtml rename to NETCORE/test/IntegrationTests.WebApp/Views/Shared/Error.cshtml diff --git a/NETCORE/test/TestApp30/Views/Shared/_Layout.cshtml b/NETCORE/test/IntegrationTests.WebApp/Views/Shared/_Layout.cshtml similarity index 100% rename from NETCORE/test/TestApp30/Views/Shared/_Layout.cshtml rename to NETCORE/test/IntegrationTests.WebApp/Views/Shared/_Layout.cshtml diff --git a/NETCORE/test/TestApp30/Views/Shared/_ValidationScriptsPartial.cshtml b/NETCORE/test/IntegrationTests.WebApp/Views/Shared/_ValidationScriptsPartial.cshtml similarity index 100% rename from NETCORE/test/TestApp30/Views/Shared/_ValidationScriptsPartial.cshtml rename to NETCORE/test/IntegrationTests.WebApp/Views/Shared/_ValidationScriptsPartial.cshtml diff --git a/NETCORE/test/IntegrationTests.WebApp/Views/_ViewImports.cshtml b/NETCORE/test/IntegrationTests.WebApp/Views/_ViewImports.cshtml new file mode 100644 index 0000000000..6655e40048 --- /dev/null +++ b/NETCORE/test/IntegrationTests.WebApp/Views/_ViewImports.cshtml @@ -0,0 +1,3 @@ +@using IntegrationTests.WebApp +@using IntegrationTests.WebApp.Models +@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers diff --git a/NETCORE/test/MVCFramework.FunctionalTests/Views/_ViewStart.cshtml b/NETCORE/test/IntegrationTests.WebApp/Views/_ViewStart.cshtml similarity index 100% rename from NETCORE/test/MVCFramework.FunctionalTests/Views/_ViewStart.cshtml rename to NETCORE/test/IntegrationTests.WebApp/Views/_ViewStart.cshtml diff --git a/NETCORE/test/TestApp30/appsettings.Development.json b/NETCORE/test/IntegrationTests.WebApp/appsettings.Development.json similarity index 100% rename from NETCORE/test/TestApp30/appsettings.Development.json rename to NETCORE/test/IntegrationTests.WebApp/appsettings.Development.json diff --git a/NETCORE/test/TestApp30/appsettings.json b/NETCORE/test/IntegrationTests.WebApp/appsettings.json similarity index 100% rename from NETCORE/test/TestApp30/appsettings.json rename to NETCORE/test/IntegrationTests.WebApp/appsettings.json diff --git a/NETCORE/test/TestApp30/wwwroot/css/site.css b/NETCORE/test/IntegrationTests.WebApp/wwwroot/css/site.css similarity index 100% rename from NETCORE/test/TestApp30/wwwroot/css/site.css rename to NETCORE/test/IntegrationTests.WebApp/wwwroot/css/site.css diff --git a/NETCORE/test/MVCFramework.FunctionalTests/wwwroot/favicon.ico b/NETCORE/test/IntegrationTests.WebApp/wwwroot/favicon.ico similarity index 100% rename from NETCORE/test/MVCFramework.FunctionalTests/wwwroot/favicon.ico rename to NETCORE/test/IntegrationTests.WebApp/wwwroot/favicon.ico diff --git a/NETCORE/test/TestApp30/wwwroot/js/site.js b/NETCORE/test/IntegrationTests.WebApp/wwwroot/js/site.js similarity index 100% rename from NETCORE/test/TestApp30/wwwroot/js/site.js rename to NETCORE/test/IntegrationTests.WebApp/wwwroot/js/site.js diff --git a/NETCORE/test/MVCFramework.FunctionalTests/.bowerrc b/NETCORE/test/MVCFramework.FunctionalTests/.bowerrc deleted file mode 100644 index 6406626abf..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/.bowerrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "directory": "wwwroot/lib" -} diff --git a/NETCORE/test/MVCFramework.FunctionalTests/App.config b/NETCORE/test/MVCFramework.FunctionalTests/App.config deleted file mode 100644 index 58c01219df..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/App.config +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/NETCORE/test/MVCFramework.FunctionalTests/Controllers/AccountController.cs b/NETCORE/test/MVCFramework.FunctionalTests/Controllers/AccountController.cs deleted file mode 100644 index 03a1a6dc44..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/Controllers/AccountController.cs +++ /dev/null @@ -1,468 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Security.Claims; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Identity; -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.Rendering; -using Microsoft.Extensions.Logging; -using MVCFramework45.FunctionalTests.Models; -using MVCFramework45.FunctionalTests.Models.AccountViewModels; -using MVCFramework45.FunctionalTests.Services; - -namespace MVCFramework45.FunctionalTests.Controllers -{ - [Authorize] - public class AccountController : Controller - { - private readonly UserManager _userManager; - private readonly SignInManager _signInManager; - private readonly IEmailSender _emailSender; - private readonly ISmsSender _smsSender; - private readonly ILogger _logger; - - public AccountController( - UserManager userManager, - SignInManager signInManager, - IEmailSender emailSender, - ISmsSender smsSender, - ILoggerFactory loggerFactory) - { - _userManager = userManager; - _signInManager = signInManager; - _emailSender = emailSender; - _smsSender = smsSender; - _logger = loggerFactory.CreateLogger(); - } - - // - // GET: /Account/Login - [HttpGet] - [AllowAnonymous] - public IActionResult Login(string returnUrl = null) - { - ViewData["ReturnUrl"] = returnUrl; - return View(); - } - - // - // POST: /Account/Login - [HttpPost] - [AllowAnonymous] - [ValidateAntiForgeryToken] - public async Task Login(LoginViewModel model, string returnUrl = null) - { - ViewData["ReturnUrl"] = returnUrl; - if (ModelState.IsValid) - { - // This doesn't count login failures towards account lockout - // To enable password failures to trigger account lockout, set lockoutOnFailure: true - var result = await _signInManager.PasswordSignInAsync(model.Email, model.Password, model.RememberMe, lockoutOnFailure: false); - if (result.Succeeded) - { - _logger.LogInformation(1, "User logged in."); - return RedirectToLocal(returnUrl); - } - if (result.RequiresTwoFactor) - { - return RedirectToAction(nameof(SendCode), new { ReturnUrl = returnUrl, RememberMe = model.RememberMe }); - } - if (result.IsLockedOut) - { - _logger.LogWarning(2, "User account locked out."); - return View("Lockout"); - } - else - { - ModelState.AddModelError(string.Empty, "Invalid login attempt."); - return View(model); - } - } - - // If we got this far, something failed, redisplay form - return View(model); - } - - // - // GET: /Account/Register - [HttpGet] - [AllowAnonymous] - public IActionResult Register(string returnUrl = null) - { - ViewData["ReturnUrl"] = returnUrl; - return View(); - } - - // - // POST: /Account/Register - [HttpPost] - [AllowAnonymous] - [ValidateAntiForgeryToken] - public async Task Register(RegisterViewModel model, string returnUrl = null) - { - ViewData["ReturnUrl"] = returnUrl; - if (ModelState.IsValid) - { - var user = new ApplicationUser { UserName = model.Email, Email = model.Email }; - var result = await _userManager.CreateAsync(user, model.Password); - if (result.Succeeded) - { - // For more information on how to enable account confirmation and password reset please visit http://go.microsoft.com/fwlink/?LinkID=532713 - // Send an email with this link - //var code = await _userManager.GenerateEmailConfirmationTokenAsync(user); - //var callbackUrl = Url.Action("ConfirmEmail", "Account", new { userId = user.Id, code = code }, protocol: HttpContext.Request.Scheme); - //await _emailSender.SendEmailAsync(model.Email, "Confirm your account", - // $"Please confirm your account by clicking this link: link"); - await _signInManager.SignInAsync(user, isPersistent: false); - _logger.LogInformation(3, "User created a new account with password."); - return RedirectToLocal(returnUrl); - } - AddErrors(result); - } - - // If we got this far, something failed, redisplay form - return View(model); - } - - // - // POST: /Account/LogOff - [HttpPost] - [ValidateAntiForgeryToken] - public async Task LogOff() - { - await _signInManager.SignOutAsync(); - _logger.LogInformation(4, "User logged out."); - return RedirectToAction(nameof(HomeController.Index), "Home"); - } - - // - // POST: /Account/ExternalLogin - [HttpPost] - [AllowAnonymous] - [ValidateAntiForgeryToken] - public IActionResult ExternalLogin(string provider, string returnUrl = null) - { - // Request a redirect to the external login provider. - var redirectUrl = Url.Action("ExternalLoginCallback", "Account", new { ReturnUrl = returnUrl }); - var properties = _signInManager.ConfigureExternalAuthenticationProperties(provider, redirectUrl); - return Challenge(properties, provider); - } - - // - // GET: /Account/ExternalLoginCallback - [HttpGet] - [AllowAnonymous] - public async Task ExternalLoginCallback(string returnUrl = null, string remoteError = null) - { - if (remoteError != null) - { - ModelState.AddModelError(string.Empty, $"Error from external provider: {remoteError}"); - return View(nameof(Login)); - } - var info = await _signInManager.GetExternalLoginInfoAsync(); - if (info == null) - { - return RedirectToAction(nameof(Login)); - } - - // Sign in the user with this external login provider if the user already has a login. - var result = await _signInManager.ExternalLoginSignInAsync(info.LoginProvider, info.ProviderKey, isPersistent: false); - if (result.Succeeded) - { - _logger.LogInformation(5, "User logged in with {Name} provider.", info.LoginProvider); - return RedirectToLocal(returnUrl); - } - if (result.RequiresTwoFactor) - { - return RedirectToAction(nameof(SendCode), new { ReturnUrl = returnUrl }); - } - if (result.IsLockedOut) - { - return View("Lockout"); - } - else - { - // If the user does not have an account, then ask the user to create an account. - ViewData["ReturnUrl"] = returnUrl; - ViewData["LoginProvider"] = info.LoginProvider; - var email = info.Principal.FindFirstValue(ClaimTypes.Email); - return View("ExternalLoginConfirmation", new ExternalLoginConfirmationViewModel { Email = email }); - } - } - - // - // POST: /Account/ExternalLoginConfirmation - [HttpPost] - [AllowAnonymous] - [ValidateAntiForgeryToken] - public async Task ExternalLoginConfirmation(ExternalLoginConfirmationViewModel model, string returnUrl = null) - { - if (ModelState.IsValid) - { - // Get the information about the user from the external login provider - var info = await _signInManager.GetExternalLoginInfoAsync(); - if (info == null) - { - return View("ExternalLoginFailure"); - } - var user = new ApplicationUser { UserName = model.Email, Email = model.Email }; - var result = await _userManager.CreateAsync(user); - if (result.Succeeded) - { - result = await _userManager.AddLoginAsync(user, info); - if (result.Succeeded) - { - await _signInManager.SignInAsync(user, isPersistent: false); - _logger.LogInformation(6, "User created an account using {Name} provider.", info.LoginProvider); - return RedirectToLocal(returnUrl); - } - } - AddErrors(result); - } - - ViewData["ReturnUrl"] = returnUrl; - return View(model); - } - - // GET: /Account/ConfirmEmail - [HttpGet] - [AllowAnonymous] - public async Task ConfirmEmail(string userId, string code) - { - if (userId == null || code == null) - { - return View("Error"); - } - var user = await _userManager.FindByIdAsync(userId); - if (user == null) - { - return View("Error"); - } - var result = await _userManager.ConfirmEmailAsync(user, code); - return View(result.Succeeded ? "ConfirmEmail" : "Error"); - } - - // - // GET: /Account/ForgotPassword - [HttpGet] - [AllowAnonymous] - public IActionResult ForgotPassword() - { - return View(); - } - - // - // POST: /Account/ForgotPassword - [HttpPost] - [AllowAnonymous] - [ValidateAntiForgeryToken] - public async Task ForgotPassword(ForgotPasswordViewModel model) - { - if (ModelState.IsValid) - { - var user = await _userManager.FindByNameAsync(model.Email); - if (user == null || !(await _userManager.IsEmailConfirmedAsync(user))) - { - // Don't reveal that the user does not exist or is not confirmed - return View("ForgotPasswordConfirmation"); - } - - // For more information on how to enable account confirmation and password reset please visit http://go.microsoft.com/fwlink/?LinkID=532713 - // Send an email with this link - //var code = await _userManager.GeneratePasswordResetTokenAsync(user); - //var callbackUrl = Url.Action("ResetPassword", "Account", new { userId = user.Id, code = code }, protocol: HttpContext.Request.Scheme); - //await _emailSender.SendEmailAsync(model.Email, "Reset Password", - // $"Please reset your password by clicking here: link"); - //return View("ForgotPasswordConfirmation"); - } - - // If we got this far, something failed, redisplay form - return View(model); - } - - // - // GET: /Account/ForgotPasswordConfirmation - [HttpGet] - [AllowAnonymous] - public IActionResult ForgotPasswordConfirmation() - { - return View(); - } - - // - // GET: /Account/ResetPassword - [HttpGet] - [AllowAnonymous] - public IActionResult ResetPassword(string code = null) - { - return code == null ? View("Error") : View(); - } - - // - // POST: /Account/ResetPassword - [HttpPost] - [AllowAnonymous] - [ValidateAntiForgeryToken] - public async Task ResetPassword(ResetPasswordViewModel model) - { - if (!ModelState.IsValid) - { - return View(model); - } - var user = await _userManager.FindByNameAsync(model.Email); - if (user == null) - { - // Don't reveal that the user does not exist - return RedirectToAction(nameof(AccountController.ResetPasswordConfirmation), "Account"); - } - var result = await _userManager.ResetPasswordAsync(user, model.Code, model.Password); - if (result.Succeeded) - { - return RedirectToAction(nameof(AccountController.ResetPasswordConfirmation), "Account"); - } - AddErrors(result); - return View(); - } - - // - // GET: /Account/ResetPasswordConfirmation - [HttpGet] - [AllowAnonymous] - public IActionResult ResetPasswordConfirmation() - { - return View(); - } - - // - // GET: /Account/SendCode - [HttpGet] - [AllowAnonymous] - public async Task SendCode(string returnUrl = null, bool rememberMe = false) - { - var user = await _signInManager.GetTwoFactorAuthenticationUserAsync(); - if (user == null) - { - return View("Error"); - } - var userFactors = await _userManager.GetValidTwoFactorProvidersAsync(user); - var factorOptions = userFactors.Select(purpose => new SelectListItem { Text = purpose, Value = purpose }).ToList(); - return View(new SendCodeViewModel { Providers = factorOptions, ReturnUrl = returnUrl, RememberMe = rememberMe }); - } - - // - // POST: /Account/SendCode - [HttpPost] - [AllowAnonymous] - [ValidateAntiForgeryToken] - public async Task SendCode(SendCodeViewModel model) - { - if (!ModelState.IsValid) - { - return View(); - } - - var user = await _signInManager.GetTwoFactorAuthenticationUserAsync(); - if (user == null) - { - return View("Error"); - } - - // Generate the token and send it - var code = await _userManager.GenerateTwoFactorTokenAsync(user, model.SelectedProvider); - if (string.IsNullOrWhiteSpace(code)) - { - return View("Error"); - } - - var message = "Your security code is: " + code; - if (model.SelectedProvider == "Email") - { - await _emailSender.SendEmailAsync(await _userManager.GetEmailAsync(user), "Security Code", message); - } - else if (model.SelectedProvider == "Phone") - { - await _smsSender.SendSmsAsync(await _userManager.GetPhoneNumberAsync(user), message); - } - - return RedirectToAction(nameof(VerifyCode), new { Provider = model.SelectedProvider, ReturnUrl = model.ReturnUrl, RememberMe = model.RememberMe }); - } - - // - // GET: /Account/VerifyCode - [HttpGet] - [AllowAnonymous] - public async Task VerifyCode(string provider, bool rememberMe, string returnUrl = null) - { - // Require that the user has already logged in via username/password or external login - var user = await _signInManager.GetTwoFactorAuthenticationUserAsync(); - if (user == null) - { - return View("Error"); - } - return View(new VerifyCodeViewModel { Provider = provider, ReturnUrl = returnUrl, RememberMe = rememberMe }); - } - - // - // POST: /Account/VerifyCode - [HttpPost] - [AllowAnonymous] - [ValidateAntiForgeryToken] - public async Task VerifyCode(VerifyCodeViewModel model) - { - if (!ModelState.IsValid) - { - return View(model); - } - - // The following code protects for brute force attacks against the two factor codes. - // If a user enters incorrect codes for a specified amount of time then the user account - // will be locked out for a specified amount of time. - var result = await _signInManager.TwoFactorSignInAsync(model.Provider, model.Code, model.RememberMe, model.RememberBrowser); - if (result.Succeeded) - { - return RedirectToLocal(model.ReturnUrl); - } - if (result.IsLockedOut) - { - _logger.LogWarning(7, "User account locked out."); - return View("Lockout"); - } - else - { - ModelState.AddModelError(string.Empty, "Invalid code."); - return View(model); - } - } - - #region Helpers - - private void AddErrors(IdentityResult result) - { - foreach (var error in result.Errors) - { - ModelState.AddModelError(string.Empty, error.Description); - } - } - - private Task GetCurrentUserAsync() - { - return _userManager.GetUserAsync(HttpContext.User); - } - - private IActionResult RedirectToLocal(string returnUrl) - { - if (Url.IsLocalUrl(returnUrl)) - { - return Redirect(returnUrl); - } - else - { - return RedirectToAction(nameof(HomeController.Index), "Home"); - } - } - - #endregion - } -} diff --git a/NETCORE/test/MVCFramework.FunctionalTests/Controllers/HomeController.cs b/NETCORE/test/MVCFramework.FunctionalTests/Controllers/HomeController.cs deleted file mode 100644 index 49f0dd9407..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/Controllers/HomeController.cs +++ /dev/null @@ -1,54 +0,0 @@ -using System; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; -using Microsoft.ApplicationInsights.DataContracts; -using Microsoft.ApplicationInsights; - -namespace MVCFramework45.FunctionalTests.Controllers -{ - public class HomeController : Controller - { - private TelemetryClient telemetryClient; - - public HomeController(TelemetryClient telemetryClient) - { - this.telemetryClient = telemetryClient; - } - - public IActionResult Index() - { - return View(); - } - - public IActionResult Exception() - { - throw new InvalidOperationException("Do not call the method called Exception"); - } - - public IActionResult About(int index) - { - ViewBag.Message = "Your application description page # " + index; - - return View(); - } - - public IActionResult Contact() - { - this.telemetryClient.TrackEvent("GetContact"); - this.telemetryClient.TrackMetric("ContactFile", 1); - this.telemetryClient.TrackTrace("Fetched contact details.", SeverityLevel.Information); - return View(); - } - - public IActionResult Dependency() - { - this.telemetryClient.TrackDependency("MyDependency", "MyCommand", DateTimeOffset.Now, TimeSpan.FromMilliseconds(1), success: true); - return View(); - } - - public IActionResult Error() - { - return View("~/Views/Shared/Error.cshtml"); - } - } -} diff --git a/NETCORE/test/MVCFramework.FunctionalTests/Controllers/ManageController.cs b/NETCORE/test/MVCFramework.FunctionalTests/Controllers/ManageController.cs deleted file mode 100644 index d6df46fda2..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/Controllers/ManageController.cs +++ /dev/null @@ -1,347 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Identity; -using Microsoft.AspNetCore.Mvc; -using Microsoft.Extensions.Logging; -using MVCFramework45.FunctionalTests.Models; -using MVCFramework45.FunctionalTests.Models.ManageViewModels; -using MVCFramework45.FunctionalTests.Services; - -namespace MVCFramework45.FunctionalTests.Controllers -{ - [Authorize] - public class ManageController : Controller - { - private readonly UserManager _userManager; - private readonly SignInManager _signInManager; - private readonly IEmailSender _emailSender; - private readonly ISmsSender _smsSender; - private readonly ILogger _logger; - - public ManageController( - UserManager userManager, - SignInManager signInManager, - IEmailSender emailSender, - ISmsSender smsSender, - ILoggerFactory loggerFactory) - { - _userManager = userManager; - _signInManager = signInManager; - _emailSender = emailSender; - _smsSender = smsSender; - _logger = loggerFactory.CreateLogger(); - } - - // - // GET: /Manage/Index - [HttpGet] - public async Task Index(ManageMessageId? message = null) - { - ViewData["StatusMessage"] = - message == ManageMessageId.ChangePasswordSuccess ? "Your password has been changed." - : message == ManageMessageId.SetPasswordSuccess ? "Your password has been set." - : message == ManageMessageId.SetTwoFactorSuccess ? "Your two-factor authentication provider has been set." - : message == ManageMessageId.Error ? "An error has occurred." - : message == ManageMessageId.AddPhoneSuccess ? "Your phone number was added." - : message == ManageMessageId.RemovePhoneSuccess ? "Your phone number was removed." - : ""; - - var user = await GetCurrentUserAsync(); - var model = new IndexViewModel - { - HasPassword = await _userManager.HasPasswordAsync(user), - PhoneNumber = await _userManager.GetPhoneNumberAsync(user), - TwoFactor = await _userManager.GetTwoFactorEnabledAsync(user), - Logins = await _userManager.GetLoginsAsync(user), - BrowserRemembered = await _signInManager.IsTwoFactorClientRememberedAsync(user) - }; - return View(model); - } - - // - // POST: /Manage/RemoveLogin - [HttpPost] - [ValidateAntiForgeryToken] - public async Task RemoveLogin(RemoveLoginViewModel account) - { - ManageMessageId? message = ManageMessageId.Error; - var user = await GetCurrentUserAsync(); - if (user != null) - { - var result = await _userManager.RemoveLoginAsync(user, account.LoginProvider, account.ProviderKey); - if (result.Succeeded) - { - await _signInManager.SignInAsync(user, isPersistent: false); - message = ManageMessageId.RemoveLoginSuccess; - } - } - return RedirectToAction(nameof(ManageLogins), new { Message = message }); - } - - // - // GET: /Manage/AddPhoneNumber - public IActionResult AddPhoneNumber() - { - return View(); - } - - // - // POST: /Manage/AddPhoneNumber - [HttpPost] - [ValidateAntiForgeryToken] - public async Task AddPhoneNumber(AddPhoneNumberViewModel model) - { - if (!ModelState.IsValid) - { - return View(model); - } - // Generate the token and send it - var user = await GetCurrentUserAsync(); - var code = await _userManager.GenerateChangePhoneNumberTokenAsync(user, model.PhoneNumber); - await _smsSender.SendSmsAsync(model.PhoneNumber, "Your security code is: " + code); - return RedirectToAction(nameof(VerifyPhoneNumber), new { PhoneNumber = model.PhoneNumber }); - } - - // - // POST: /Manage/EnableTwoFactorAuthentication - [HttpPost] - [ValidateAntiForgeryToken] - public async Task EnableTwoFactorAuthentication() - { - var user = await GetCurrentUserAsync(); - if (user != null) - { - await _userManager.SetTwoFactorEnabledAsync(user, true); - await _signInManager.SignInAsync(user, isPersistent: false); - _logger.LogInformation(1, "User enabled two-factor authentication."); - } - return RedirectToAction(nameof(Index), "Manage"); - } - - // - // POST: /Manage/DisableTwoFactorAuthentication - [HttpPost] - [ValidateAntiForgeryToken] - public async Task DisableTwoFactorAuthentication() - { - var user = await GetCurrentUserAsync(); - if (user != null) - { - await _userManager.SetTwoFactorEnabledAsync(user, false); - await _signInManager.SignInAsync(user, isPersistent: false); - _logger.LogInformation(2, "User disabled two-factor authentication."); - } - return RedirectToAction(nameof(Index), "Manage"); - } - - // - // GET: /Manage/VerifyPhoneNumber - [HttpGet] - public async Task VerifyPhoneNumber(string phoneNumber) - { - var code = await _userManager.GenerateChangePhoneNumberTokenAsync(await GetCurrentUserAsync(), phoneNumber); - // Send an SMS to verify the phone number - return phoneNumber == null ? View("Error") : View(new VerifyPhoneNumberViewModel { PhoneNumber = phoneNumber }); - } - - // - // POST: /Manage/VerifyPhoneNumber - [HttpPost] - [ValidateAntiForgeryToken] - public async Task VerifyPhoneNumber(VerifyPhoneNumberViewModel model) - { - if (!ModelState.IsValid) - { - return View(model); - } - var user = await GetCurrentUserAsync(); - if (user != null) - { - var result = await _userManager.ChangePhoneNumberAsync(user, model.PhoneNumber, model.Code); - if (result.Succeeded) - { - await _signInManager.SignInAsync(user, isPersistent: false); - return RedirectToAction(nameof(Index), new { Message = ManageMessageId.AddPhoneSuccess }); - } - } - // If we got this far, something failed, redisplay the form - ModelState.AddModelError(string.Empty, "Failed to verify phone number"); - return View(model); - } - - // - // POST: /Manage/RemovePhoneNumber - [HttpPost] - [ValidateAntiForgeryToken] - public async Task RemovePhoneNumber() - { - var user = await GetCurrentUserAsync(); - if (user != null) - { - var result = await _userManager.SetPhoneNumberAsync(user, null); - if (result.Succeeded) - { - await _signInManager.SignInAsync(user, isPersistent: false); - return RedirectToAction(nameof(Index), new { Message = ManageMessageId.RemovePhoneSuccess }); - } - } - return RedirectToAction(nameof(Index), new { Message = ManageMessageId.Error }); - } - - // - // GET: /Manage/ChangePassword - [HttpGet] - public IActionResult ChangePassword() - { - return View(); - } - - // - // POST: /Manage/ChangePassword - [HttpPost] - [ValidateAntiForgeryToken] - public async Task ChangePassword(ChangePasswordViewModel model) - { - if (!ModelState.IsValid) - { - return View(model); - } - var user = await GetCurrentUserAsync(); - if (user != null) - { - var result = await _userManager.ChangePasswordAsync(user, model.OldPassword, model.NewPassword); - if (result.Succeeded) - { - await _signInManager.SignInAsync(user, isPersistent: false); - _logger.LogInformation(3, "User changed their password successfully."); - return RedirectToAction(nameof(Index), new { Message = ManageMessageId.ChangePasswordSuccess }); - } - AddErrors(result); - return View(model); - } - return RedirectToAction(nameof(Index), new { Message = ManageMessageId.Error }); - } - - // - // GET: /Manage/SetPassword - [HttpGet] - public IActionResult SetPassword() - { - return View(); - } - - // - // POST: /Manage/SetPassword - [HttpPost] - [ValidateAntiForgeryToken] - public async Task SetPassword(SetPasswordViewModel model) - { - if (!ModelState.IsValid) - { - return View(model); - } - - var user = await GetCurrentUserAsync(); - if (user != null) - { - var result = await _userManager.AddPasswordAsync(user, model.NewPassword); - if (result.Succeeded) - { - await _signInManager.SignInAsync(user, isPersistent: false); - return RedirectToAction(nameof(Index), new { Message = ManageMessageId.SetPasswordSuccess }); - } - AddErrors(result); - return View(model); - } - return RedirectToAction(nameof(Index), new { Message = ManageMessageId.Error }); - } - - //GET: /Manage/ManageLogins - [HttpGet] - public async Task ManageLogins(ManageMessageId? message = null) - { - ViewData["StatusMessage"] = - message == ManageMessageId.RemoveLoginSuccess ? "The external login was removed." - : message == ManageMessageId.AddLoginSuccess ? "The external login was added." - : message == ManageMessageId.Error ? "An error has occurred." - : ""; - var user = await GetCurrentUserAsync(); - if (user == null) - { - return View("Error"); - } - var userLogins = await _userManager.GetLoginsAsync(user); - var otherLogins = _signInManager.GetExternalAuthenticationSchemes().Where(auth => userLogins.All(ul => auth.AuthenticationScheme != ul.LoginProvider)).ToList(); - ViewData["ShowRemoveButton"] = user.PasswordHash != null || userLogins.Count > 1; - return View(new ManageLoginsViewModel - { - CurrentLogins = userLogins, - OtherLogins = otherLogins - }); - } - - // - // POST: /Manage/LinkLogin - [HttpPost] - [ValidateAntiForgeryToken] - public IActionResult LinkLogin(string provider) - { - // Request a redirect to the external login provider to link a login for the current user - var redirectUrl = Url.Action("LinkLoginCallback", "Manage"); - var properties = _signInManager.ConfigureExternalAuthenticationProperties(provider, redirectUrl, _userManager.GetUserId(User)); - return Challenge(properties, provider); - } - - // - // GET: /Manage/LinkLoginCallback - [HttpGet] - public async Task LinkLoginCallback() - { - var user = await GetCurrentUserAsync(); - if (user == null) - { - return View("Error"); - } - var info = await _signInManager.GetExternalLoginInfoAsync(await _userManager.GetUserIdAsync(user)); - if (info == null) - { - return RedirectToAction(nameof(ManageLogins), new { Message = ManageMessageId.Error }); - } - var result = await _userManager.AddLoginAsync(user, info); - var message = result.Succeeded ? ManageMessageId.AddLoginSuccess : ManageMessageId.Error; - return RedirectToAction(nameof(ManageLogins), new { Message = message }); - } - - #region Helpers - - private void AddErrors(IdentityResult result) - { - foreach (var error in result.Errors) - { - ModelState.AddModelError(string.Empty, error.Description); - } - } - - public enum ManageMessageId - { - AddPhoneSuccess, - AddLoginSuccess, - ChangePasswordSuccess, - SetTwoFactorSuccess, - SetPasswordSuccess, - RemoveLoginSuccess, - RemovePhoneSuccess, - Error - } - - private Task GetCurrentUserAsync() - { - return _userManager.GetUserAsync(HttpContext.User); - } - - #endregion - } -} diff --git a/NETCORE/test/MVCFramework.FunctionalTests/Data/ApplicationDbContext.cs b/NETCORE/test/MVCFramework.FunctionalTests/Data/ApplicationDbContext.cs deleted file mode 100644 index 54df44c99c..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/Data/ApplicationDbContext.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Identity.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore; -using MVCFramework45.FunctionalTests.Models; - -namespace MVCFramework45.FunctionalTests.Data -{ - public class ApplicationDbContext : IdentityDbContext - { - public ApplicationDbContext(DbContextOptions options) - : base(options) - { - } - - protected override void OnModelCreating(ModelBuilder builder) - { - base.OnModelCreating(builder); - // Customize the ASP.NET Identity model and override the defaults if needed. - // For example, you can rename the ASP.NET Identity table names and more. - // Add your customizations after calling base.OnModelCreating(builder); - } - } -} diff --git a/NETCORE/test/MVCFramework.FunctionalTests/Data/Migrations/ApplicationDbContextModelSnapshot.cs b/NETCORE/test/MVCFramework.FunctionalTests/Data/Migrations/ApplicationDbContextModelSnapshot.cs deleted file mode 100644 index ea2ca3fe3a..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/Data/Migrations/ApplicationDbContextModelSnapshot.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore.Infrastructure; -using Microsoft.EntityFrameworkCore.Metadata; - -namespace MVCFramework45.FunctionalTests.Data.Migrations -{ - [DbContext(typeof(ApplicationDbContext))] - partial class ApplicationDbContextModelSnapshot : ModelSnapshot - { - protected override void BuildModel(ModelBuilder modelBuilder) - { - } - } -} diff --git a/NETCORE/test/MVCFramework.FunctionalTests/FunctionalTest/CorrelationMvcTests.cs b/NETCORE/test/MVCFramework.FunctionalTests/FunctionalTest/CorrelationMvcTests.cs deleted file mode 100644 index 2ffd7672dc..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/FunctionalTest/CorrelationMvcTests.cs +++ /dev/null @@ -1,42 +0,0 @@ -namespace MVCFramework.FunctionalTests.FunctionalTest -{ - using FunctionalTestUtils; - using Microsoft.ApplicationInsights.DataContracts; - using System; - using System.Linq; - using System.Net.Http; - using Xunit; - using Xunit.Abstractions; - - public class CorrelationMvcTests : TelemetryTestsBase - { - private const string assemblyName = "MVCFramework.FunctionalTests"; - public CorrelationMvcTests(ITestOutputHelper output) : base(output) - { - } - [Fact] - public void CorrelationInfoIsPropagatedToDependendedService() - { -#if netcoreapp1_0 // Correlation works on .Net core. - InProcessServer server; - - using (server = new InProcessServer(assemblyName, InProcessServer.UseApplicationInsights)) - { - using (var httpClient = new HttpClient()) - { - var task = httpClient.GetAsync(server.BaseHost + "/"); - task.Wait(TestTimeoutMs); - } - } - - var telemetries = server.BackChannel.Buffer; - - Assert.True(telemetries.Count >= 2); - var requestTelemetry = telemetries.OfType().Single(); - var dependencyTelemetry = telemetries.OfType().Single(); - Assert.Equal(requestTelemetry.Context.Operation.Id, dependencyTelemetry.Context.Operation.Id); - Assert.Equal(requestTelemetry.Context.Operation.ParentId, dependencyTelemetry.Id); -#endif - } - } -} diff --git a/NETCORE/test/MVCFramework.FunctionalTests/FunctionalTest/DependencyTelemetryMvcTests.cs b/NETCORE/test/MVCFramework.FunctionalTests/FunctionalTest/DependencyTelemetryMvcTests.cs deleted file mode 100644 index d0c2a190ff..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/FunctionalTest/DependencyTelemetryMvcTests.cs +++ /dev/null @@ -1,143 +0,0 @@ -using System.Diagnostics; - -namespace MVCFramework.FunctionalTests.FunctionalTest -{ - using System; - using System.Collections.Generic; - using System.Linq; - using System.Net.Http; - using System.Text; - using FunctionalTestUtils; - using Microsoft.ApplicationInsights.Channel; - using Microsoft.ApplicationInsights.DataContracts; - using Xunit; - using Xunit.Abstractions; - using Microsoft.ApplicationInsights.Extensibility; - using Microsoft.ApplicationInsights.DependencyCollector; - using Microsoft.Extensions.DependencyInjection; - using System.Reflection; - - public class DependencyTelemetryMvcTests : TelemetryTestsBase - { - private readonly string assemblyName; - - public DependencyTelemetryMvcTests(ITestOutputHelper output) : base(output) - { - this.assemblyName = this.GetType().GetTypeInfo().Assembly.GetName().Name; - } - - [Fact] - public void CorrelationInfoIsNotAddedToRequestHeaderIfUserAddDomainToExcludedList() - { -#if netcoreapp1_0 // Correlation is supported on .Net core. - InProcessServer server; - - using (server = new InProcessServer(assemblyName, InProcessServer.UseApplicationInsights)) - { - var dependencyCollectorModule = server.ApplicationServices.GetServices().OfType().Single(); - dependencyCollectorModule.ExcludeComponentCorrelationHttpHeadersOnDomains.Add(server.BaseHost); - - using (var httpClient = new HttpClient()) - { - var task = httpClient.GetAsync(server.BaseHost + "/"); - task.Wait(TestTimeoutMs); - } - } - - var telemetries = server.BackChannel.Buffer; - try - { - Assert.True(telemetries.Count >= 2); - var requestTelemetry = telemetries.OfType().Single(); - var dependencyTelemetry = telemetries.OfType().Single(); - Assert.NotEqual(requestTelemetry.Context.Operation.Id, dependencyTelemetry.Context.Operation.Id); - } - catch (Exception e) - { - string data = DebugTelemetryItems(telemetries); - throw new Exception(data, e); - } -#endif - } - - [Fact] - public void OperationIdOfRequestIsPropagatedToChildDependency() - { - // https://github.com/Microsoft/ApplicationInsights-aspnetcore/issues/340 - // Verify operation of OperationIdTelemetryInitializer - string path = "Home/Dependency"; - InProcessServer server; - - using (server = new InProcessServer(assemblyName, InProcessServer.UseApplicationInsights)) - { - using (var httpClient = new HttpClient()) - { - var task = httpClient.GetAsync(server.BaseHost + "/" + path); - task.Wait(TestTimeoutMs); - } - } - - var telemetries = server.BackChannel.Buffer; - try - { - Assert.True(telemetries.Count >= 2); - var requestTelemetry = telemetries.OfType().Single(); - var dependencyTelemetry = telemetries.OfType().First(t => t.Name == "MyDependency"); - Assert.Equal(requestTelemetry.Context.Operation.Id, dependencyTelemetry.Context.Operation.Id); - } - catch (Exception e) - { - string data = DebugTelemetryItems(telemetries); - throw new Exception(data, e); - } - } - - [Fact] - public void ParentIdOfChildDependencyIsIdOfRequest() - { - // https://github.com/Microsoft/ApplicationInsights-aspnetcore/issues/333 - // Verify operation of OperationCorrelationTelemetryInitializer - string path = "Home/Dependency"; - InProcessServer server; - using (server = new InProcessServer(assemblyName, InProcessServer.UseApplicationInsights)) - { - using (var httpClient = new HttpClient()) - { - var task = httpClient.GetAsync(server.BaseHost + "/" + path); - task.Wait(TestTimeoutMs); - } - } - - // Filter out any unexpected telemetry items. - IEnumerable telemetries = server.BackChannel.Buffer.Where((t) => t.Context?.Operation?.Name != null && t.Context.Operation.Name.Contains(path)); - try - { - Assert.NotNull(telemetries); - var requestTelemetry = telemetries.OfType().Single(); - var dependencyTelemetry = telemetries.First(t => t is DependencyTelemetry && (t as DependencyTelemetry).Name == "MyDependency"); - Assert.Equal(requestTelemetry.Id, dependencyTelemetry.Context.Operation.ParentId); - } - catch (Exception e) - { - string data = DebugTelemetryItems(server.BackChannel.Buffer); - throw new Exception(data, e); - } - } - - private string DebugTelemetryItems(IList telemetries) - { - StringBuilder builder = new StringBuilder(); - foreach (ITelemetry telemetry in telemetries) - { - DependencyTelemetry dependency = telemetry as DependencyTelemetry; - if (dependency != null) { - builder.AppendLine($"{dependency.ToString()} - {dependency.Data} - {dependency.Duration} - {dependency.Id} - {dependency.Name} - {dependency.ResultCode} - {dependency.Sequence} - {dependency.Success} - {dependency.Target} - {dependency.Type}"); - } else { - builder.AppendLine($"{telemetry.ToString()} - {telemetry.Context?.Operation?.Name}"); - } - } - - return builder.ToString(); - } - } -} diff --git a/NETCORE/test/MVCFramework.FunctionalTests/FunctionalTest/ExceptionTelemetryMvcTests.cs b/NETCORE/test/MVCFramework.FunctionalTests/FunctionalTest/ExceptionTelemetryMvcTests.cs deleted file mode 100644 index 559ada1091..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/FunctionalTest/ExceptionTelemetryMvcTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -using Xunit; - -[assembly: CollectionBehavior(DisableTestParallelization = true)] -namespace MVCFramework.FunctionalTests.FunctionalTest -{ - using System; - using System.Reflection; - using FunctionalTestUtils; - using Microsoft.ApplicationInsights.DataContracts; - using Xunit; - using Xunit.Abstractions; - - public class ExceptionTelemetryMvcTests : TelemetryTestsBase - { - private readonly string assemblyName; - - public ExceptionTelemetryMvcTests(ITestOutputHelper output) : base(output) - { - this.assemblyName = this.GetType().GetTypeInfo().Assembly.GetName().Name; - } - - [Fact] - public void TestBasicRequestPropertiesAfterRequestingControllerThatThrows() - { - using (var server = new InProcessServer(assemblyName, InProcessServer.UseApplicationInsights)) - { - const string RequestPath = "/Home/Exception"; - - var expectedRequestTelemetry = new RequestTelemetry(); - expectedRequestTelemetry.Name = "GET Home/Exception"; - expectedRequestTelemetry.ResponseCode = "500"; - expectedRequestTelemetry.Success = false; - expectedRequestTelemetry.Url = new System.Uri(server.BaseHost + RequestPath); - this.ValidateBasicRequest(server, "/Home/Exception", expectedRequestTelemetry); - } - } - - [Fact] - public void TestBasicExceptionPropertiesAfterRequestingControllerThatThrows() - { - using (var server = new InProcessServer(assemblyName, InProcessServer.UseApplicationInsights)) - { - var expectedExceptionTelemetry = new ExceptionTelemetry(); - expectedExceptionTelemetry.Exception = new InvalidOperationException(); - - this.ValidateBasicException(server, "/Home/Exception", expectedExceptionTelemetry); - } - } - } -} diff --git a/NETCORE/test/MVCFramework.FunctionalTests/FunctionalTest/RequestTelemetryMvcTests.cs b/NETCORE/test/MVCFramework.FunctionalTests/FunctionalTest/RequestTelemetryMvcTests.cs deleted file mode 100644 index 06092e0d98..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/FunctionalTest/RequestTelemetryMvcTests.cs +++ /dev/null @@ -1,98 +0,0 @@ -using System.Threading; -using System.Threading.Tasks; - -namespace MVCFramework.FunctionalTests.FunctionalTest -{ - using System.Linq; - using System.Net.Http; - using System.Reflection; - using FunctionalTestUtils; - using Microsoft.ApplicationInsights.DataContracts; - using Xunit; - using Xunit.Abstractions; - - public class RequestTelemetryMvcTests : TelemetryTestsBase - { - private readonly string assemblyName; - - public RequestTelemetryMvcTests(ITestOutputHelper output) : base(output) - { - this.assemblyName = this.GetType().GetTypeInfo().Assembly.GetName().Name; - } - - [Fact] - public void TestBasicRequestPropertiesAfterRequestingHomeController() - { - using (var server = new InProcessServer(assemblyName, InProcessServer.UseApplicationInsights)) - { - const string RequestPath = "/"; - - var expectedRequestTelemetry = new RequestTelemetry(); - expectedRequestTelemetry.Name = "GET Home/Index"; - expectedRequestTelemetry.ResponseCode = "200"; - expectedRequestTelemetry.Success = true; - expectedRequestTelemetry.Url = new System.Uri(server.BaseHost + RequestPath); - - this.ValidateBasicRequest(server, RequestPath, expectedRequestTelemetry); - } - } - - [Fact] - public void TestBasicRequestPropertiesAfterRequestingActionWithParameter() - { - using (var server = new InProcessServer(assemblyName, InProcessServer.UseApplicationInsights)) - { - const string RequestPath = "/Home/About/5"; - - var expectedRequestTelemetry = new RequestTelemetry(); - expectedRequestTelemetry.Name = "GET Home/About [id]"; - expectedRequestTelemetry.ResponseCode = "200"; - expectedRequestTelemetry.Success = true; - expectedRequestTelemetry.Url = new System.Uri(server.BaseHost + RequestPath); - - this.ValidateBasicRequest(server, RequestPath, expectedRequestTelemetry); - } - } - - [Fact] - public void TestBasicRequestPropertiesAfterRequestingNotExistingController() - { - using (var server = new InProcessServer(assemblyName, InProcessServer.UseApplicationInsights)) - { - const string RequestPath = "/not/existing/controller"; - - var expectedRequestTelemetry = new RequestTelemetry(); - expectedRequestTelemetry.Name = "GET /not/existing/controller"; - expectedRequestTelemetry.ResponseCode = "404"; - expectedRequestTelemetry.Success = false; - expectedRequestTelemetry.Url = new System.Uri(server.BaseHost + RequestPath); - - this.ValidateBasicRequest(server, RequestPath, expectedRequestTelemetry); - } - } - - [Fact] - public void TestMixedTelemetryItemsReceived() - { - InProcessServer server; - using (server = new InProcessServer(assemblyName, InProcessServer.UseApplicationInsights)) - { - using (var httpClient = new HttpClient()) - { - var task = httpClient.GetAsync(server.BaseHost + "/Home/Contact"); - task.Wait(TestTimeoutMs); - } - } - var telemetries = server.BackChannel.Buffer; - Assert.Contains(telemetries.OfType(), t => t.Name == "GET /Home/Contact"); - Assert.True(telemetries.Count >= 4); - Assert.Contains(telemetries.OfType(), t => t.Name == "GET Home/Contact"); - Assert.Contains(telemetries.OfType(), t => t.Name == "GetContact"); - Assert.Contains(telemetries.OfType(), - t => t.Name == "ContactFile" && t.Value == 1); - - Assert.Contains(telemetries.OfType(), - t => t.Message == "Fetched contact details." && t.SeverityLevel == SeverityLevel.Information); - } - } -} diff --git a/NETCORE/test/MVCFramework.FunctionalTests/FunctionalTest/TelemetryModuleWorkingMvcTests.cs b/NETCORE/test/MVCFramework.FunctionalTests/FunctionalTest/TelemetryModuleWorkingMvcTests.cs deleted file mode 100644 index a009513ecd..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/FunctionalTest/TelemetryModuleWorkingMvcTests.cs +++ /dev/null @@ -1,33 +0,0 @@ -namespace MVCFramework.FunctionalTests.FunctionalTest -{ - using System.Reflection; - using FunctionalTestUtils; - using Xunit; - using Xunit.Abstractions; - - public class TelemetryModuleWorkingMvcTests : TelemetryTestsBase - { - private readonly string assemblyName; - - public TelemetryModuleWorkingMvcTests(ITestOutputHelper output) : base(output) - { - this.assemblyName = this.GetType().GetTypeInfo().Assembly.GetName().Name; - } - - // The NET451 conditional check is wrapped inside the test to make the tests visible in the test explorer. We can move them to the class level once if the issue is resolved. - - [Fact] - public void TestBasicDependencyPropertiesAfterRequestingBasicPage() - { - this.ValidateBasicDependency(assemblyName, "/Home/About/5", InProcessServer.UseApplicationInsights); - } - - [Fact] - public void TestIfPerformanceCountersAreCollected() - { -#if NET451 || NET46 - ValidatePerformanceCountersAreCollected(assemblyName, InProcessServer.UseApplicationInsights); -#endif - } - } -} diff --git a/NETCORE/test/MVCFramework.FunctionalTests/MVCFramework.FunctionalTests10.csproj b/NETCORE/test/MVCFramework.FunctionalTests/MVCFramework.FunctionalTests10.csproj deleted file mode 100644 index 633176431d..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/MVCFramework.FunctionalTests10.csproj +++ /dev/null @@ -1,74 +0,0 @@ - - - - 2.0.0 - net46;netcoreapp1.0 - netcoreapp1.0 - win7-x86 - true - MVCFramework.FunctionalTests.Tests - MVCFramework.FunctionalTests - true - aspnet-MVCFramework45.FunctionalTests-60cfc765-2dc9-454c-bb34-dc379ed92cd0 - 1.1.5 - true - true - pdbonly - true - - - - - Always - SettingsSingleFileGenerator - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/NETCORE/test/MVCFramework.FunctionalTests/Models/AccountViewModels/ExternalLoginConfirmationViewModel.cs b/NETCORE/test/MVCFramework.FunctionalTests/Models/AccountViewModels/ExternalLoginConfirmationViewModel.cs deleted file mode 100644 index 45869e97a5..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/Models/AccountViewModels/ExternalLoginConfirmationViewModel.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Threading.Tasks; - -namespace MVCFramework45.FunctionalTests.Models.AccountViewModels -{ - public class ExternalLoginConfirmationViewModel - { - [Required] - [EmailAddress] - public string Email { get; set; } - } -} diff --git a/NETCORE/test/MVCFramework.FunctionalTests/Models/AccountViewModels/ForgotPasswordViewModel.cs b/NETCORE/test/MVCFramework.FunctionalTests/Models/AccountViewModels/ForgotPasswordViewModel.cs deleted file mode 100644 index be49c40e3f..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/Models/AccountViewModels/ForgotPasswordViewModel.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Threading.Tasks; - -namespace MVCFramework45.FunctionalTests.Models.AccountViewModels -{ - public class ForgotPasswordViewModel - { - [Required] - [EmailAddress] - public string Email { get; set; } - } -} diff --git a/NETCORE/test/MVCFramework.FunctionalTests/Models/AccountViewModels/LoginViewModel.cs b/NETCORE/test/MVCFramework.FunctionalTests/Models/AccountViewModels/LoginViewModel.cs deleted file mode 100644 index 8c8659abe1..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/Models/AccountViewModels/LoginViewModel.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Threading.Tasks; - -namespace MVCFramework45.FunctionalTests.Models.AccountViewModels -{ - public class LoginViewModel - { - [Required] - [EmailAddress] - public string Email { get; set; } - - [Required] - [DataType(DataType.Password)] - public string Password { get; set; } - - [Display(Name = "Remember me?")] - public bool RememberMe { get; set; } - } -} diff --git a/NETCORE/test/MVCFramework.FunctionalTests/Models/AccountViewModels/RegisterViewModel.cs b/NETCORE/test/MVCFramework.FunctionalTests/Models/AccountViewModels/RegisterViewModel.cs deleted file mode 100644 index 5d842085bd..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/Models/AccountViewModels/RegisterViewModel.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Threading.Tasks; - -namespace MVCFramework45.FunctionalTests.Models.AccountViewModels -{ - public class RegisterViewModel - { - [Required] - [EmailAddress] - [Display(Name = "Email")] - public string Email { get; set; } - - [Required] - [StringLength(100, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)] - [DataType(DataType.Password)] - [Display(Name = "Password")] - public string Password { get; set; } - - [DataType(DataType.Password)] - [Display(Name = "Confirm password")] - [Compare("Password", ErrorMessage = "The password and confirmation password do not match.")] - public string ConfirmPassword { get; set; } - } -} diff --git a/NETCORE/test/MVCFramework.FunctionalTests/Models/AccountViewModels/ResetPasswordViewModel.cs b/NETCORE/test/MVCFramework.FunctionalTests/Models/AccountViewModels/ResetPasswordViewModel.cs deleted file mode 100644 index afd64ff845..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/Models/AccountViewModels/ResetPasswordViewModel.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Threading.Tasks; - -namespace MVCFramework45.FunctionalTests.Models.AccountViewModels -{ - public class ResetPasswordViewModel - { - [Required] - [EmailAddress] - public string Email { get; set; } - - [Required] - [StringLength(100, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)] - [DataType(DataType.Password)] - public string Password { get; set; } - - [DataType(DataType.Password)] - [Display(Name = "Confirm password")] - [Compare("Password", ErrorMessage = "The password and confirmation password do not match.")] - public string ConfirmPassword { get; set; } - - public string Code { get; set; } - } -} diff --git a/NETCORE/test/MVCFramework.FunctionalTests/Models/AccountViewModels/SendCodeViewModel.cs b/NETCORE/test/MVCFramework.FunctionalTests/Models/AccountViewModels/SendCodeViewModel.cs deleted file mode 100644 index 5d697503b4..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/Models/AccountViewModels/SendCodeViewModel.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc.Rendering; - -namespace MVCFramework45.FunctionalTests.Models.AccountViewModels -{ - public class SendCodeViewModel - { - public string SelectedProvider { get; set; } - - public ICollection Providers { get; set; } - - public string ReturnUrl { get; set; } - - public bool RememberMe { get; set; } - } -} diff --git a/NETCORE/test/MVCFramework.FunctionalTests/Models/AccountViewModels/VerifyCodeViewModel.cs b/NETCORE/test/MVCFramework.FunctionalTests/Models/AccountViewModels/VerifyCodeViewModel.cs deleted file mode 100644 index f522940025..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/Models/AccountViewModels/VerifyCodeViewModel.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Threading.Tasks; - -namespace MVCFramework45.FunctionalTests.Models.AccountViewModels -{ - public class VerifyCodeViewModel - { - [Required] - public string Provider { get; set; } - - [Required] - public string Code { get; set; } - - public string ReturnUrl { get; set; } - - [Display(Name = "Remember this browser?")] - public bool RememberBrowser { get; set; } - - [Display(Name = "Remember me?")] - public bool RememberMe { get; set; } - } -} diff --git a/NETCORE/test/MVCFramework.FunctionalTests/Models/ApplicationUser.cs b/NETCORE/test/MVCFramework.FunctionalTests/Models/ApplicationUser.cs deleted file mode 100644 index 52caa91b56..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/Models/ApplicationUser.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Identity.EntityFrameworkCore; - -namespace MVCFramework45.FunctionalTests.Models -{ - // Add profile data for application users by adding properties to the ApplicationUser class - public class ApplicationUser : IdentityUser - { - } -} diff --git a/NETCORE/test/MVCFramework.FunctionalTests/Models/ManageViewModels/AddPhoneNumberViewModel.cs b/NETCORE/test/MVCFramework.FunctionalTests/Models/ManageViewModels/AddPhoneNumberViewModel.cs deleted file mode 100644 index 8c55f7d50d..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/Models/ManageViewModels/AddPhoneNumberViewModel.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Threading.Tasks; - -namespace MVCFramework45.FunctionalTests.Models.ManageViewModels -{ - public class AddPhoneNumberViewModel - { - [Required] - [Phone] - [Display(Name = "Phone number")] - public string PhoneNumber { get; set; } - } -} diff --git a/NETCORE/test/MVCFramework.FunctionalTests/Models/ManageViewModels/ChangePasswordViewModel.cs b/NETCORE/test/MVCFramework.FunctionalTests/Models/ManageViewModels/ChangePasswordViewModel.cs deleted file mode 100644 index f508432406..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/Models/ManageViewModels/ChangePasswordViewModel.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Threading.Tasks; - -namespace MVCFramework45.FunctionalTests.Models.ManageViewModels -{ - public class ChangePasswordViewModel - { - [Required] - [DataType(DataType.Password)] - [Display(Name = "Current password")] - public string OldPassword { get; set; } - - [Required] - [StringLength(100, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)] - [DataType(DataType.Password)] - [Display(Name = "New password")] - public string NewPassword { get; set; } - - [DataType(DataType.Password)] - [Display(Name = "Confirm new password")] - [Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")] - public string ConfirmPassword { get; set; } - } -} diff --git a/NETCORE/test/MVCFramework.FunctionalTests/Models/ManageViewModels/ConfigureTwoFactorViewModel.cs b/NETCORE/test/MVCFramework.FunctionalTests/Models/ManageViewModels/ConfigureTwoFactorViewModel.cs deleted file mode 100644 index 592ffa749a..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/Models/ManageViewModels/ConfigureTwoFactorViewModel.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc.Rendering; - -namespace MVCFramework45.FunctionalTests.Models.ManageViewModels -{ - public class ConfigureTwoFactorViewModel - { - public string SelectedProvider { get; set; } - - public ICollection Providers { get; set; } - } -} diff --git a/NETCORE/test/MVCFramework.FunctionalTests/Models/ManageViewModels/FactorViewModel.cs b/NETCORE/test/MVCFramework.FunctionalTests/Models/ManageViewModels/FactorViewModel.cs deleted file mode 100644 index a77d4bf1e2..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/Models/ManageViewModels/FactorViewModel.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace MVCFramework45.FunctionalTests.Models.ManageViewModels -{ - public class FactorViewModel - { - public string Purpose { get; set; } - } -} diff --git a/NETCORE/test/MVCFramework.FunctionalTests/Models/ManageViewModels/IndexViewModel.cs b/NETCORE/test/MVCFramework.FunctionalTests/Models/ManageViewModels/IndexViewModel.cs deleted file mode 100644 index 3321343296..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/Models/ManageViewModels/IndexViewModel.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Identity; - -namespace MVCFramework45.FunctionalTests.Models.ManageViewModels -{ - public class IndexViewModel - { - public bool HasPassword { get; set; } - - public IList Logins { get; set; } - - public string PhoneNumber { get; set; } - - public bool TwoFactor { get; set; } - - public bool BrowserRemembered { get; set; } - } -} diff --git a/NETCORE/test/MVCFramework.FunctionalTests/Models/ManageViewModels/ManageLoginsViewModel.cs b/NETCORE/test/MVCFramework.FunctionalTests/Models/ManageViewModels/ManageLoginsViewModel.cs deleted file mode 100644 index 079d1c773d..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/Models/ManageViewModels/ManageLoginsViewModel.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Http.Authentication; -using Microsoft.AspNetCore.Identity; - -namespace MVCFramework45.FunctionalTests.Models.ManageViewModels -{ - public class ManageLoginsViewModel - { - public IList CurrentLogins { get; set; } - - public IList OtherLogins { get; set; } - } -} diff --git a/NETCORE/test/MVCFramework.FunctionalTests/Models/ManageViewModels/RemoveLoginViewModel.cs b/NETCORE/test/MVCFramework.FunctionalTests/Models/ManageViewModels/RemoveLoginViewModel.cs deleted file mode 100644 index 583fb46a38..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/Models/ManageViewModels/RemoveLoginViewModel.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Threading.Tasks; - -namespace MVCFramework45.FunctionalTests.Models.ManageViewModels -{ - public class RemoveLoginViewModel - { - public string LoginProvider { get; set; } - public string ProviderKey { get; set; } - } -} diff --git a/NETCORE/test/MVCFramework.FunctionalTests/Models/ManageViewModels/SetPasswordViewModel.cs b/NETCORE/test/MVCFramework.FunctionalTests/Models/ManageViewModels/SetPasswordViewModel.cs deleted file mode 100644 index 5f966a1ff5..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/Models/ManageViewModels/SetPasswordViewModel.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Threading.Tasks; - -namespace MVCFramework45.FunctionalTests.Models.ManageViewModels -{ - public class SetPasswordViewModel - { - [Required] - [StringLength(100, ErrorMessage = "The {0} must be at least {2} and at max {1} characters long.", MinimumLength = 6)] - [DataType(DataType.Password)] - [Display(Name = "New password")] - public string NewPassword { get; set; } - - [DataType(DataType.Password)] - [Display(Name = "Confirm new password")] - [Compare("NewPassword", ErrorMessage = "The new password and confirmation password do not match.")] - public string ConfirmPassword { get; set; } - } -} diff --git a/NETCORE/test/MVCFramework.FunctionalTests/Models/ManageViewModels/VerifyPhoneNumberViewModel.cs b/NETCORE/test/MVCFramework.FunctionalTests/Models/ManageViewModels/VerifyPhoneNumberViewModel.cs deleted file mode 100644 index c80f51e5b9..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/Models/ManageViewModels/VerifyPhoneNumberViewModel.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel.DataAnnotations; -using System.Linq; -using System.Threading.Tasks; - -namespace MVCFramework45.FunctionalTests.Models.ManageViewModels -{ - public class VerifyPhoneNumberViewModel - { - [Required] - public string Code { get; set; } - - [Required] - [Phone] - [Display(Name = "Phone number")] - public string PhoneNumber { get; set; } - } -} diff --git a/NETCORE/test/MVCFramework.FunctionalTests/Project_Readme.html b/NETCORE/test/MVCFramework.FunctionalTests/Project_Readme.html deleted file mode 100644 index bddf864a13..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/Project_Readme.html +++ /dev/null @@ -1,187 +0,0 @@ - - - - - Welcome to ASP.NET Core - - - - - - - - - - diff --git a/NETCORE/test/MVCFramework.FunctionalTests/Properties/launchSettings.json b/NETCORE/test/MVCFramework.FunctionalTests/Properties/launchSettings.json deleted file mode 100644 index c4eb8da4c1..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/Properties/launchSettings.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:29543/", - "sslPort": 0 - } - }, - "profiles": { - "IIS Express": { - "commandName": "IISExpress", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - } - } -} \ No newline at end of file diff --git a/NETCORE/test/MVCFramework.FunctionalTests/Services/IEmailSender.cs b/NETCORE/test/MVCFramework.FunctionalTests/Services/IEmailSender.cs deleted file mode 100644 index 6cee07877e..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/Services/IEmailSender.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace MVCFramework45.FunctionalTests.Services -{ - public interface IEmailSender - { - Task SendEmailAsync(string email, string subject, string message); - } -} diff --git a/NETCORE/test/MVCFramework.FunctionalTests/Services/ISmsSender.cs b/NETCORE/test/MVCFramework.FunctionalTests/Services/ISmsSender.cs deleted file mode 100644 index 289bca814e..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/Services/ISmsSender.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace MVCFramework45.FunctionalTests.Services -{ - public interface ISmsSender - { - Task SendSmsAsync(string number, string message); - } -} diff --git a/NETCORE/test/MVCFramework.FunctionalTests/Services/MessageServices.cs b/NETCORE/test/MVCFramework.FunctionalTests/Services/MessageServices.cs deleted file mode 100644 index 48c68d6f52..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/Services/MessageServices.cs +++ /dev/null @@ -1,25 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace MVCFramework45.FunctionalTests.Services -{ - // This class is used by the application to send Email and SMS - // when you turn on two-factor authentication in ASP.NET Identity. - // For more details see this link http://go.microsoft.com/fwlink/?LinkID=532713 - public class AuthMessageSender : IEmailSender, ISmsSender - { - public Task SendEmailAsync(string email, string subject, string message) - { - // Plug in your email service here to send an email. - return Task.FromResult(0); - } - - public Task SendSmsAsync(string number, string message) - { - // Plug in your SMS service here to send a text message. - return Task.FromResult(0); - } - } -} diff --git a/NETCORE/test/MVCFramework.FunctionalTests/Startup.cs b/NETCORE/test/MVCFramework.FunctionalTests/Startup.cs deleted file mode 100644 index b3ec309327..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/Startup.cs +++ /dev/null @@ -1,96 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Builder; -using Microsoft.AspNetCore.Hosting; -using Microsoft.AspNetCore.Identity.EntityFrameworkCore; -using Microsoft.EntityFrameworkCore; -using Microsoft.Extensions.Configuration; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; -using MVCFramework45.FunctionalTests.Data; -using MVCFramework45.FunctionalTests.Models; -using MVCFramework45.FunctionalTests.Services; -using FunctionalTestUtils; -using Microsoft.ApplicationInsights.Channel; - -namespace MVCFramework45.FunctionalTests -{ - public class Startup - { - public Startup(IHostingEnvironment env) - { - // Set up configuration sources. - var builder = new ConfigurationBuilder() - .SetBasePath(env.ContentRootPath) - .AddJsonFile("appsettings.json", true, true) - .AddJsonFile($"appsettings.{env.EnvironmentName}.json", optional: true); - - Configuration = builder.Build(); - } - - public IConfigurationRoot Configuration { get; set; } - - // This method gets called by the runtime. Use this method to add services to the container. - public void ConfigureServices(IServiceCollection services) - { - services.AddSingleton(new BackTelemetryChannel()); - // Add framework services. - services.AddDbContext(options => - options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection"))); - - services.AddIdentity() - .AddEntityFrameworkStores() - .AddDefaultTokenProviders(); - - services.AddMvc(); - - // Add application services. - services.AddTransient(); - services.AddTransient(); - } - - // This method gets called by the runtime. Use this method to configure the HTTP request pipeline. - public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) - { - loggerFactory.AddConsole(Configuration.GetSection("Logging")); - loggerFactory.AddDebug(); - - if (env.IsDevelopment()) - { - app.UseDeveloperExceptionPage(); - app.UseDatabaseErrorPage(); - } - else - { - app.UseExceptionHandler("/Home/Error"); - - // For more details on creating database during deployment see http://go.microsoft.com/fwlink/?LinkID=615859 - try - { - using (var serviceScope = app.ApplicationServices.GetRequiredService() - .CreateScope()) - { - serviceScope.ServiceProvider.GetService() - .Database.Migrate(); - } - } - catch { } - } - - app.UseStaticFiles(); - - app.UseIdentity(); - - // To configure external authentication please see http://go.microsoft.com/fwlink/?LinkID=532715 - - app.UseMvc(routes => - { - routes.MapRoute( - name: "default", - template: "{controller=Home}/{action=Index}/{id?}"); - }); - } - } -} diff --git a/NETCORE/test/MVCFramework.FunctionalTests/Views/Account/ConfirmEmail.cshtml b/NETCORE/test/MVCFramework.FunctionalTests/Views/Account/ConfirmEmail.cshtml deleted file mode 100644 index 3244fef5f1..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/Views/Account/ConfirmEmail.cshtml +++ /dev/null @@ -1,10 +0,0 @@ -@{ - ViewData["Title"] = "Confirm Email"; -} - -

@ViewData["Title"].

-
-

- Thank you for confirming your email. Please Click here to Log in. -

-
diff --git a/NETCORE/test/MVCFramework.FunctionalTests/Views/Account/ExternalLoginConfirmation.cshtml b/NETCORE/test/MVCFramework.FunctionalTests/Views/Account/ExternalLoginConfirmation.cshtml deleted file mode 100644 index 987fff41c4..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/Views/Account/ExternalLoginConfirmation.cshtml +++ /dev/null @@ -1,35 +0,0 @@ -@model ExternalLoginConfirmationViewModel -@{ - ViewData["Title"] = "Register"; -} - -

@ViewData["Title"].

-

Associate your @ViewData["LoginProvider"] account.

- -
-

Association Form

-
-
- -

- You've successfully authenticated with @ViewData["LoginProvider"]. - Please enter an email address for this site below and click the Register button to finish - logging in. -

-
- -
- - -
-
-
-
- -
-
-
- -@section Scripts { - @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } -} diff --git a/NETCORE/test/MVCFramework.FunctionalTests/Views/Account/ExternalLoginFailure.cshtml b/NETCORE/test/MVCFramework.FunctionalTests/Views/Account/ExternalLoginFailure.cshtml deleted file mode 100644 index d89339e012..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/Views/Account/ExternalLoginFailure.cshtml +++ /dev/null @@ -1,8 +0,0 @@ -@{ - ViewData["Title"] = "Login Failure"; -} - -
-

@ViewData["Title"].

-

Unsuccessful login with service.

-
diff --git a/NETCORE/test/MVCFramework.FunctionalTests/Views/Account/ForgotPassword.cshtml b/NETCORE/test/MVCFramework.FunctionalTests/Views/Account/ForgotPassword.cshtml deleted file mode 100644 index ee02538a06..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/Views/Account/ForgotPassword.cshtml +++ /dev/null @@ -1,31 +0,0 @@ -@model ForgotPasswordViewModel -@{ - ViewData["Title"] = "Forgot your password?"; -} - -

@ViewData["Title"]

-

- For more information on how to enable reset password please see this article. -

- -@*
-

Enter your email.

-
-
-
- -
- - -
-
-
-
- -
-
-
*@ - -@section Scripts { - @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } -} diff --git a/NETCORE/test/MVCFramework.FunctionalTests/Views/Account/ForgotPasswordConfirmation.cshtml b/NETCORE/test/MVCFramework.FunctionalTests/Views/Account/ForgotPasswordConfirmation.cshtml deleted file mode 100644 index ab9bf44c8d..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/Views/Account/ForgotPasswordConfirmation.cshtml +++ /dev/null @@ -1,8 +0,0 @@ -@{ - ViewData["Title"] = "Forgot Password Confirmation"; -} - -

@ViewData["Title"].

-

- Please check your email to reset your password. -

diff --git a/NETCORE/test/MVCFramework.FunctionalTests/Views/Account/Lockout.cshtml b/NETCORE/test/MVCFramework.FunctionalTests/Views/Account/Lockout.cshtml deleted file mode 100644 index 2cc946d5c4..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/Views/Account/Lockout.cshtml +++ /dev/null @@ -1,8 +0,0 @@ -@{ - ViewData["Title"] = "Locked out"; -} - -
-

Locked out.

-

This account has been locked out, please try again later.

-
diff --git a/NETCORE/test/MVCFramework.FunctionalTests/Views/Account/Login.cshtml b/NETCORE/test/MVCFramework.FunctionalTests/Views/Account/Login.cshtml deleted file mode 100644 index d80381934f..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/Views/Account/Login.cshtml +++ /dev/null @@ -1,92 +0,0 @@ -@using System.Collections.Generic -@using Microsoft.AspNetCore.Http -@using Microsoft.AspNetCore.Http.Authentication -@model LoginViewModel -@inject SignInManager SignInManager - -@{ - ViewData["Title"] = "Log in"; -} - -

@ViewData["Title"].

-
-
-
-
-

Use a local account to log in.

-
-
-
- -
- - -
-
-
- -
- - -
-
-
-
-
- -
-
-
-
-
- -
-
-

- Register as a new user? -

-

- Forgot your password? -

-
-
-
-
-
-

Use another service to log in.

-
- @{ - var loginProviders = SignInManager.GetExternalAuthenticationSchemes().ToList(); - if (loginProviders.Count == 0) - { -
-

- There are no external authentication services configured. See this article - for details on setting up this ASP.NET application to support logging in via external services. -

-
- } - else - { -
-
-

- @foreach (var provider in loginProviders) - { - - } -

-
-
- } - } -
-
-
- -@section Scripts { - @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } -} diff --git a/NETCORE/test/MVCFramework.FunctionalTests/Views/Account/Register.cshtml b/NETCORE/test/MVCFramework.FunctionalTests/Views/Account/Register.cshtml deleted file mode 100644 index dad5ea2fb6..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/Views/Account/Register.cshtml +++ /dev/null @@ -1,42 +0,0 @@ -@model RegisterViewModel -@{ - ViewData["Title"] = "Register"; -} - -

@ViewData["Title"].

- -
-

Create a new account.

-
-
-
- -
- - -
-
-
- -
- - -
-
-
- -
- - -
-
-
-
- -
-
-
- -@section Scripts { - @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } -} diff --git a/NETCORE/test/MVCFramework.FunctionalTests/Views/Account/ResetPassword.cshtml b/NETCORE/test/MVCFramework.FunctionalTests/Views/Account/ResetPassword.cshtml deleted file mode 100644 index 6e584da56d..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/Views/Account/ResetPassword.cshtml +++ /dev/null @@ -1,43 +0,0 @@ -@model ResetPasswordViewModel -@{ - ViewData["Title"] = "Reset password"; -} - -

@ViewData["Title"].

- -
-

Reset your password.

-
-
- -
- -
- - -
-
-
- -
- - -
-
-
- -
- - -
-
-
-
- -
-
-
- -@section Scripts { - @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } -} diff --git a/NETCORE/test/MVCFramework.FunctionalTests/Views/Account/ResetPasswordConfirmation.cshtml b/NETCORE/test/MVCFramework.FunctionalTests/Views/Account/ResetPasswordConfirmation.cshtml deleted file mode 100644 index bef2e4570d..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/Views/Account/ResetPasswordConfirmation.cshtml +++ /dev/null @@ -1,8 +0,0 @@ -@{ - ViewData["Title"] = "Reset password confirmation"; -} - -

@ViewData["Title"].

-

- Your password has been reset. Please Click here to log in. -

diff --git a/NETCORE/test/MVCFramework.FunctionalTests/Views/Account/SendCode.cshtml b/NETCORE/test/MVCFramework.FunctionalTests/Views/Account/SendCode.cshtml deleted file mode 100644 index 8621ce71f9..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/Views/Account/SendCode.cshtml +++ /dev/null @@ -1,21 +0,0 @@ -@model SendCodeViewModel -@{ - ViewData["Title"] = "Send Verification Code"; -} - -

@ViewData["Title"].

- -
- -
-
- Select Two-Factor Authentication Provider: - - -
-
-
- -@section Scripts { - @{await Html.RenderPartialAsync("_ValidationScriptsPartial"); } -} diff --git a/NETCORE/test/MVCFramework.FunctionalTests/Views/Account/VerifyCode.cshtml b/NETCORE/test/MVCFramework.FunctionalTests/Views/Account/VerifyCode.cshtml deleted file mode 100644 index c067534aad..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/Views/Account/VerifyCode.cshtml +++ /dev/null @@ -1,38 +0,0 @@ -@model VerifyCodeViewModel -@{ - ViewData["Title"] = "Verify"; -} - -

@ViewData["Title"].

- -
-
- - -

@ViewData["Status"]

-
-
- -
- - -
-
-
-
-
- - -
-
-
-
-
- -
-
-
- -@section Scripts { - @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } -} diff --git a/NETCORE/test/MVCFramework.FunctionalTests/Views/Home/About.cshtml b/NETCORE/test/MVCFramework.FunctionalTests/Views/Home/About.cshtml deleted file mode 100644 index 50476d1fbd..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/Views/Home/About.cshtml +++ /dev/null @@ -1,7 +0,0 @@ -@{ - ViewData["Title"] = "About"; -} -

@ViewData["Title"].

-

@ViewData["Message"]

- -

Use this area to provide additional information.

diff --git a/NETCORE/test/MVCFramework.FunctionalTests/Views/Home/Contact.cshtml b/NETCORE/test/MVCFramework.FunctionalTests/Views/Home/Contact.cshtml deleted file mode 100644 index 15c12c6d12..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/Views/Home/Contact.cshtml +++ /dev/null @@ -1,17 +0,0 @@ -@{ - ViewData["Title"] = "Contact"; -} -

@ViewData["Title"].

-

@ViewData["Message"]

- -
- One Microsoft Way
- Redmond, WA 98052-6399
- P: - 425.555.0100 -
- -
- Support: Support@example.com
- Marketing: Marketing@example.com -
diff --git a/NETCORE/test/MVCFramework.FunctionalTests/Views/Home/Dependency.cshtml b/NETCORE/test/MVCFramework.FunctionalTests/Views/Home/Dependency.cshtml deleted file mode 100644 index 0537b0e100..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/Views/Home/Dependency.cshtml +++ /dev/null @@ -1,2 +0,0 @@ -@{ -} diff --git a/NETCORE/test/MVCFramework.FunctionalTests/Views/Home/Index.cshtml b/NETCORE/test/MVCFramework.FunctionalTests/Views/Home/Index.cshtml deleted file mode 100644 index 146ccc3b6d..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/Views/Home/Index.cshtml +++ /dev/null @@ -1,109 +0,0 @@ -@{ - ViewData["Title"] = "Home Page"; -} - - - - diff --git a/NETCORE/test/MVCFramework.FunctionalTests/Views/Manage/AddPhoneNumber.cshtml b/NETCORE/test/MVCFramework.FunctionalTests/Views/Manage/AddPhoneNumber.cshtml deleted file mode 100644 index 5e96c6e218..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/Views/Manage/AddPhoneNumber.cshtml +++ /dev/null @@ -1,27 +0,0 @@ -@model AddPhoneNumberViewModel -@{ - ViewData["Title"] = "Add Phone Number"; -} - -

@ViewData["Title"].

-
-

Add a phone number.

-
-
-
- -
- - -
-
-
-
- -
-
-
- -@section Scripts { - @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } -} diff --git a/NETCORE/test/MVCFramework.FunctionalTests/Views/Manage/ChangePassword.cshtml b/NETCORE/test/MVCFramework.FunctionalTests/Views/Manage/ChangePassword.cshtml deleted file mode 100644 index d19ef1dd07..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/Views/Manage/ChangePassword.cshtml +++ /dev/null @@ -1,42 +0,0 @@ -@model ChangePasswordViewModel -@{ - ViewData["Title"] = "Change Password"; -} - -

@ViewData["Title"].

- -
-

Change Password Form

-
-
-
- -
- - -
-
-
- -
- - -
-
-
- -
- - -
-
-
-
- -
-
-
- -@section Scripts { - @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } -} diff --git a/NETCORE/test/MVCFramework.FunctionalTests/Views/Manage/Index.cshtml b/NETCORE/test/MVCFramework.FunctionalTests/Views/Manage/Index.cshtml deleted file mode 100644 index 413c19d3c1..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/Views/Manage/Index.cshtml +++ /dev/null @@ -1,71 +0,0 @@ -@model IndexViewModel -@{ - ViewData["Title"] = "Manage your account"; -} - -

@ViewData["Title"].

-

@ViewData["StatusMessage"]

- -
-

Change your account settings

-
-
-
Password:
-
- @if (Model.HasPassword) - { - Change - } - else - { - Create - } -
-
External Logins:
-
- - @Model.Logins.Count Manage -
-
Phone Number:
-
-

- Phone Numbers can used as a second factor of verification in two-factor authentication. - See this article - for details on setting up this ASP.NET application to support two-factor authentication using SMS. -

- @*@(Model.PhoneNumber ?? "None") - @if (Model.PhoneNumber != null) - { -
- Change -
- [] -
- } - else - { - Add - }*@ -
- -
Two-Factor Authentication:
-
-

- There are no two-factor authentication providers configured. See this article - for setting up this application to support two-factor authentication. -

- @*@if (Model.TwoFactor) - { -
- Enabled -
- } - else - { -
- Disabled -
- }*@ -
-
-
diff --git a/NETCORE/test/MVCFramework.FunctionalTests/Views/Manage/ManageLogins.cshtml b/NETCORE/test/MVCFramework.FunctionalTests/Views/Manage/ManageLogins.cshtml deleted file mode 100644 index cb764d4a0c..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/Views/Manage/ManageLogins.cshtml +++ /dev/null @@ -1,54 +0,0 @@ -@model ManageLoginsViewModel -@using Microsoft.AspNetCore.Http.Authentication -@{ - ViewData["Title"] = "Manage your external logins"; -} - -

@ViewData["Title"].

- -

@ViewData["StatusMessage"]

-@if (Model.CurrentLogins.Count > 0) -{ -

Registered Logins

- - - @for (var index = 0; index < Model.CurrentLogins.Count; index++) - { - - - - - } - -
@Model.CurrentLogins[index].LoginProvider - @if ((bool)ViewData["ShowRemoveButton"]) - { -
-
- - - -
-
- } - else - { - @:   - } -
-} -@if (Model.OtherLogins.Count > 0) -{ -

Add another service to log in.

-
-
-
-

- @foreach (var provider in Model.OtherLogins) - { - - } -

-
-
-} diff --git a/NETCORE/test/MVCFramework.FunctionalTests/Views/Manage/SetPassword.cshtml b/NETCORE/test/MVCFramework.FunctionalTests/Views/Manage/SetPassword.cshtml deleted file mode 100644 index 8f832ed907..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/Views/Manage/SetPassword.cshtml +++ /dev/null @@ -1,38 +0,0 @@ -@model SetPasswordViewModel -@{ - ViewData["Title"] = "Set Password"; -} - -

- You do not have a local username/password for this site. Add a local - account so you can log in without an external login. -

- -
-

Set your password

-
-
-
- -
- - -
-
-
- -
- - -
-
-
-
- -
-
-
- -@section Scripts { - @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } -} diff --git a/NETCORE/test/MVCFramework.FunctionalTests/Views/Manage/VerifyPhoneNumber.cshtml b/NETCORE/test/MVCFramework.FunctionalTests/Views/Manage/VerifyPhoneNumber.cshtml deleted file mode 100644 index e8b460ee4e..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/Views/Manage/VerifyPhoneNumber.cshtml +++ /dev/null @@ -1,30 +0,0 @@ -@model VerifyPhoneNumberViewModel -@{ - ViewData["Title"] = "Verify Phone Number"; -} - -

@ViewData["Title"].

- -
- -

Add a phone number.

-
@ViewData["Status"]
-
-
-
- -
- - -
-
-
-
- -
-
-
- -@section Scripts { - @{ await Html.RenderPartialAsync("_ValidationScriptsPartial"); } -} diff --git a/NETCORE/test/MVCFramework.FunctionalTests/Views/Shared/Error.cshtml b/NETCORE/test/MVCFramework.FunctionalTests/Views/Shared/Error.cshtml deleted file mode 100644 index e514139c45..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/Views/Shared/Error.cshtml +++ /dev/null @@ -1,14 +0,0 @@ -@{ - ViewData["Title"] = "Error"; -} - -

Error.

-

An error occurred while processing your request.

- -

Development Mode

-

- Swapping to Development environment will display more detailed information about the error that occurred. -

-

- Development environment should not be enabled in deployed applications, as it can result in sensitive information from exceptions being displayed to end users. For local debugging, development environment can be enabled by setting the ASPNETCORE_ENVIRONMENT environment variable to Development, and restarting the application. -

diff --git a/NETCORE/test/MVCFramework.FunctionalTests/Views/Shared/_Layout.cshtml b/NETCORE/test/MVCFramework.FunctionalTests/Views/Shared/_Layout.cshtml deleted file mode 100644 index 09b80a252b..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/Views/Shared/_Layout.cshtml +++ /dev/null @@ -1,68 +0,0 @@ - - - - - - @ViewData["Title"] - MVCFramework45.FunctionalTests - - - - - - - - - - - - -
- @RenderBody() -
-
-

© 2016 - MVCFramework45.FunctionalTests

-
-
- - - - - - - - - - - - - @RenderSection("scripts", required: false) - - diff --git a/NETCORE/test/MVCFramework.FunctionalTests/Views/Shared/_LoginPartial.cshtml b/NETCORE/test/MVCFramework.FunctionalTests/Views/Shared/_LoginPartial.cshtml deleted file mode 100644 index cb60cf4ba6..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/Views/Shared/_LoginPartial.cshtml +++ /dev/null @@ -1,26 +0,0 @@ -@using Microsoft.AspNetCore.Identity -@using MVCFramework45.FunctionalTests.Models - -@inject SignInManager SignInManager -@inject UserManager UserManager - -@if (SignInManager.IsSignedIn(User)) -{ - -} -else -{ - -} diff --git a/NETCORE/test/MVCFramework.FunctionalTests/Views/Shared/_ValidationScriptsPartial.cshtml b/NETCORE/test/MVCFramework.FunctionalTests/Views/Shared/_ValidationScriptsPartial.cshtml deleted file mode 100644 index 88f6303f29..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/Views/Shared/_ValidationScriptsPartial.cshtml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - diff --git a/NETCORE/test/MVCFramework.FunctionalTests/Views/_ViewImports.cshtml b/NETCORE/test/MVCFramework.FunctionalTests/Views/_ViewImports.cshtml deleted file mode 100644 index 4ebe7e8d5d..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/Views/_ViewImports.cshtml +++ /dev/null @@ -1,5 +0,0 @@ -@using MVCFramework45.FunctionalTests -@using MVCFramework45.FunctionalTests.Models -@using MVCFramework45.FunctionalTests.Models.AccountViewModels -@using MVCFramework45.FunctionalTests.Models.ManageViewModels -@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers diff --git a/NETCORE/test/MVCFramework.FunctionalTests/appsettings.json b/NETCORE/test/MVCFramework.FunctionalTests/appsettings.json deleted file mode 100644 index d47927e663..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/appsettings.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "ApplicationInsights": { - "InstrumentationKey": "11111111-2222-3333-4444-555555555555" - }, - "ConnectionStrings": { - "DefaultConnection": "Server=(localdb)\\mssqllocaldb;Database=aspnet-MVCFramework45.FunctionalTests-60cfc765-2dc9-454c-bb34-dc379ed92cd0;Trusted_Connection=True;MultipleActiveResultSets=true" - }, - "Logging": { - "IncludeScopes": false, - "LogLevel": { - "Default": "Debug", - "System": "Information", - "Microsoft": "Information" - } - } -} diff --git a/NETCORE/test/MVCFramework.FunctionalTests/bower.json b/NETCORE/test/MVCFramework.FunctionalTests/bower.json deleted file mode 100644 index 8a0f1a2445..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/bower.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "name": "ASP.NET", - "private": true, - "dependencies": { - "bootstrap": "3.3.6", - "jquery": "2.2.0", - "jquery-validation": "1.14.0", - "jquery-validation-unobtrusive": "3.2.6" - } -} diff --git a/NETCORE/test/MVCFramework.FunctionalTests/gulpfile.js b/NETCORE/test/MVCFramework.FunctionalTests/gulpfile.js deleted file mode 100644 index dba09041f4..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/gulpfile.js +++ /dev/null @@ -1,45 +0,0 @@ -/// -"use strict"; - -var gulp = require("gulp"), - rimraf = require("rimraf"), - concat = require("gulp-concat"), - cssmin = require("gulp-cssmin"), - uglify = require("gulp-uglify"); - -var webroot = "./wwwroot/"; - -var paths = { - js: webroot + "js/**/*.js", - minJs: webroot + "js/**/*.min.js", - css: webroot + "css/**/*.css", - minCss: webroot + "css/**/*.min.css", - concatJsDest: webroot + "js/site.min.js", - concatCssDest: webroot + "css/site.min.css" -}; - -gulp.task("clean:js", function (cb) { - rimraf(paths.concatJsDest, cb); -}); - -gulp.task("clean:css", function (cb) { - rimraf(paths.concatCssDest, cb); -}); - -gulp.task("clean", ["clean:js", "clean:css"]); - -gulp.task("min:js", function () { - return gulp.src([paths.js, "!" + paths.minJs], { base: "." }) - .pipe(concat(paths.concatJsDest)) - .pipe(uglify()) - .pipe(gulp.dest(".")); -}); - -gulp.task("min:css", function () { - return gulp.src([paths.css, "!" + paths.minCss]) - .pipe(concat(paths.concatCssDest)) - .pipe(cssmin()) - .pipe(gulp.dest(".")); -}); - -gulp.task("min", ["min:js", "min:css"]); diff --git a/NETCORE/test/MVCFramework.FunctionalTests/package.json b/NETCORE/test/MVCFramework.FunctionalTests/package.json deleted file mode 100644 index 0843d2d53d..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/package.json +++ /dev/null @@ -1,12 +0,0 @@ -{ - "name": "asp.net", - "version": "0.0.0", - "private": true, - "devDependencies": { - "gulp": "3.8.11", - "gulp-concat": "2.5.2", - "gulp-cssmin": "0.1.7", - "gulp-uglify": "1.2.0", - "rimraf": "2.2.8" - } -} diff --git a/NETCORE/test/MVCFramework.FunctionalTests/web.Debug.config b/NETCORE/test/MVCFramework.FunctionalTests/web.Debug.config deleted file mode 100644 index 86acd886d2..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/web.Debug.config +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/NETCORE/test/MVCFramework.FunctionalTests/web.Release.config b/NETCORE/test/MVCFramework.FunctionalTests/web.Release.config deleted file mode 100644 index f09bbbe3a7..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/web.Release.config +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/NETCORE/test/MVCFramework.FunctionalTests/web.config b/NETCORE/test/MVCFramework.FunctionalTests/web.config deleted file mode 100644 index dc0514fca5..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/web.config +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - - - - - - - diff --git a/NETCORE/test/MVCFramework.FunctionalTests/wwwroot/_references.js b/NETCORE/test/MVCFramework.FunctionalTests/wwwroot/_references.js deleted file mode 100644 index 5f282702bb..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/wwwroot/_references.js +++ /dev/null @@ -1 +0,0 @@ - \ No newline at end of file diff --git a/NETCORE/test/MVCFramework.FunctionalTests/wwwroot/css/site.css b/NETCORE/test/MVCFramework.FunctionalTests/wwwroot/css/site.css deleted file mode 100644 index b64212d5a4..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/wwwroot/css/site.css +++ /dev/null @@ -1,44 +0,0 @@ -body { - padding-top: 50px; - padding-bottom: 20px; -} - -/* Wrapping element */ -/* Set some basic padding to keep content from hitting the edges */ -.body-content { - padding-left: 15px; - padding-right: 15px; -} - -/* Set widths on the form inputs since otherwise they're 100% wide */ -input, -select, -textarea { - max-width: 280px; -} - -/* Carousel */ -.carousel-caption p { - font-size: 20px; - line-height: 1.4; -} - -/* buttons and links extension to use brackets: [ click me ] */ -.btn-bracketed::before { - display:inline-block; - content: "["; - padding-right: 0.5em; -} -.btn-bracketed::after { - display:inline-block; - content: "]"; - padding-left: 0.5em; -} - -/* Hide/rearrange for smaller screens */ -@media screen and (max-width: 767px) { - /* Hide captions */ - .carousel-caption { - display: none - } -} diff --git a/NETCORE/test/MVCFramework.FunctionalTests/wwwroot/js/site.js b/NETCORE/test/MVCFramework.FunctionalTests/wwwroot/js/site.js deleted file mode 100644 index 82ecce7b4a..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/wwwroot/js/site.js +++ /dev/null @@ -1 +0,0 @@ -// Write your Javascript code. diff --git a/NETCORE/test/MVCFramework.FunctionalTests/xunit.runner.json b/NETCORE/test/MVCFramework.FunctionalTests/xunit.runner.json deleted file mode 100644 index 78c070e832..0000000000 --- a/NETCORE/test/MVCFramework.FunctionalTests/xunit.runner.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "shadowCopy": false -} \ No newline at end of file diff --git a/NETCORE/test/Microsoft.ApplicationInsights.AspNetCore.Tests/Extensions/ApplicationInsightsExtensionsTests.cs b/NETCORE/test/Microsoft.ApplicationInsights.AspNetCore.Tests/Extensions/ApplicationInsightsExtensionsTests.cs index 9499fd40c6..236915a5a4 100644 --- a/NETCORE/test/Microsoft.ApplicationInsights.AspNetCore.Tests/Extensions/ApplicationInsightsExtensionsTests.cs +++ b/NETCORE/test/Microsoft.ApplicationInsights.AspNetCore.Tests/Extensions/ApplicationInsightsExtensionsTests.cs @@ -21,7 +21,7 @@ namespace Microsoft.Extensions.DependencyInjection.Test using Microsoft.ApplicationInsights.DataContracts; using Microsoft.ApplicationInsights.DependencyCollector; using Microsoft.ApplicationInsights.Extensibility; -#if NETCOREAPP2_0 +#if NETCOREAPP using Microsoft.ApplicationInsights.Extensibility.EventCounterCollector; #endif using Microsoft.ApplicationInsights.Extensibility.Implementation; @@ -584,7 +584,7 @@ public static void RegistersTelemetryConfigurationFactoryMethodThatPopulatesItWi var modules = serviceProvider.GetServices(); Assert.NotNull(modules); -#if NETCOREAPP2_0 +#if NETCOREAPP Assert.Equal(7, modules.Count()); #else Assert.Equal(6, modules.Count()); @@ -593,7 +593,7 @@ public static void RegistersTelemetryConfigurationFactoryMethodThatPopulatesItWi var perfCounterModule = modules.OfType().Single(); Assert.NotNull(perfCounterModule); -#if NETCOREAPP2_0 +#if NETCOREAPP var eventCounterModule = modules.OfType().Single(); Assert.NotNull(eventCounterModule); #endif @@ -615,7 +615,7 @@ public static void RegistersTelemetryConfigurationFactoryMethodThatPopulatesItWi Assert.NotNull(quickPulseModuleDescriptor); } -#if NETCOREAPP2_0 +#if NETCOREAPP [Fact] public static void RegistersTelemetryConfigurationFactoryMethodThatPopulatesEventCounterCollectorWithDefaultListOfCounters() { @@ -663,7 +663,7 @@ public static void UserCanDisablePerfCollectorModule() // to this test project } -#if NETCOREAPP2_0 +#if NETCOREAPP [Fact] public static void UserCanDisableEventCounterCollectorModule() { @@ -983,7 +983,7 @@ public static void ConfigureRequestTrackingTelemetryDefaultOptions() == typeof(RequestTrackingTelemetryModule)); Assert.True(requestTrackingModule.CollectionOptions.InjectResponseHeaders); -#if NETCOREAPP2_0 || NET461 +#if NETCOREAPP || NET461 Assert.False(requestTrackingModule.CollectionOptions.TrackExceptions); #else Assert.True(requestTrackingModule.CollectionOptions.TrackExceptions); diff --git a/NETCORE/test/Microsoft.ApplicationInsights.AspNetCore.Tests/Microsoft.ApplicationInsights.AspNetCore.Tests.csproj b/NETCORE/test/Microsoft.ApplicationInsights.AspNetCore.Tests/Microsoft.ApplicationInsights.AspNetCore.Tests.csproj index c6065ab442..b75959ff46 100644 --- a/NETCORE/test/Microsoft.ApplicationInsights.AspNetCore.Tests/Microsoft.ApplicationInsights.AspNetCore.Tests.csproj +++ b/NETCORE/test/Microsoft.ApplicationInsights.AspNetCore.Tests/Microsoft.ApplicationInsights.AspNetCore.Tests.csproj @@ -1,11 +1,11 @@  - + 2.0.0 - netcoreapp2.0;net46;net461 - netcoreapp2.0 + netcoreapp2.1;netcoreapp3.1;net46;net461 + netcoreapp2.1;netcoreapp3.1 true true Microsoft.ApplicationInsights.AspNetCore.Tests @@ -39,12 +39,12 @@ - + - + @@ -55,6 +55,17 @@ + + + + + + + + + + + diff --git a/NETCORE/test/Microsoft.ApplicationInsights.WorkerService.Tests/Microsoft.ApplicationInsights.WorkerService.Tests.csproj b/NETCORE/test/Microsoft.ApplicationInsights.WorkerService.Tests/Microsoft.ApplicationInsights.WorkerService.Tests.csproj index 2388bd1700..2b03d67c9c 100644 --- a/NETCORE/test/Microsoft.ApplicationInsights.WorkerService.Tests/Microsoft.ApplicationInsights.WorkerService.Tests.csproj +++ b/NETCORE/test/Microsoft.ApplicationInsights.WorkerService.Tests/Microsoft.ApplicationInsights.WorkerService.Tests.csproj @@ -1,7 +1,7 @@  - netcoreapp2.1 + netcoreapp2.1;netcoreapp3.1 diff --git a/NETCORE/test/TestApp30.Tests/TestApp30.Tests30.csproj b/NETCORE/test/TestApp30.Tests/TestApp30.Tests30.csproj deleted file mode 100644 index b3b695d2ff..0000000000 --- a/NETCORE/test/TestApp30.Tests/TestApp30.Tests30.csproj +++ /dev/null @@ -1,20 +0,0 @@ - - - - netcoreapp3.0 - - - - - - - all - runtime; build; native; contentfiles; analyzers; buildtransitive - - - - - - - - diff --git a/NETCORE/test/TestApp30/TestApp30.csproj b/NETCORE/test/TestApp30/TestApp30.csproj deleted file mode 100644 index 291035343f..0000000000 --- a/NETCORE/test/TestApp30/TestApp30.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - - netcoreapp3.0 - - - - - - - diff --git a/NETCORE/test/TestApp30/Views/_ViewImports.cshtml b/NETCORE/test/TestApp30/Views/_ViewImports.cshtml deleted file mode 100644 index 1c07b23e4f..0000000000 --- a/NETCORE/test/TestApp30/Views/_ViewImports.cshtml +++ /dev/null @@ -1,3 +0,0 @@ -@using TestApp30 -@using TestApp30.Models -@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers diff --git a/NETCORE/test/TestApp30/Views/_ViewStart.cshtml b/NETCORE/test/TestApp30/Views/_ViewStart.cshtml deleted file mode 100644 index a5f10045db..0000000000 --- a/NETCORE/test/TestApp30/Views/_ViewStart.cshtml +++ /dev/null @@ -1,3 +0,0 @@ -@{ - Layout = "_Layout"; -} diff --git a/NETCORE/test/TestApp30/wwwroot/favicon.ico b/NETCORE/test/TestApp30/wwwroot/favicon.ico deleted file mode 100644 index a3a799985c..0000000000 Binary files a/NETCORE/test/TestApp30/wwwroot/favicon.ico and /dev/null differ diff --git a/NETCORE/test/WebApi.FunctionalTests/App.config b/NETCORE/test/WebApi.FunctionalTests/App.config deleted file mode 100644 index 17f9414bab..0000000000 --- a/NETCORE/test/WebApi.FunctionalTests/App.config +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/NETCORE/test/WebApi.FunctionalTests/Controllers/ExceptionController.cs b/NETCORE/test/WebApi.FunctionalTests/Controllers/ExceptionController.cs deleted file mode 100644 index 2abace3244..0000000000 --- a/NETCORE/test/WebApi.FunctionalTests/Controllers/ExceptionController.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; -using System.Collections.Generic; -using Microsoft.AspNetCore.Mvc; - -namespace SampleWebAPIIntegration.Controllers -{ - [Route("api/[controller]")] - public class ExceptionController : Controller - { - // GET: api/exception - [HttpGet] - public IEnumerable Get() - { - throw new InvalidOperationException(); - } - } -} diff --git a/NETCORE/test/WebApi.FunctionalTests/Controllers/ValuesController.cs b/NETCORE/test/WebApi.FunctionalTests/Controllers/ValuesController.cs deleted file mode 100644 index 05e2355e25..0000000000 --- a/NETCORE/test/WebApi.FunctionalTests/Controllers/ValuesController.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; - -namespace SampleWebAPIIntegration.Controllers -{ - [Route("api/[controller]")] - public class ValuesController : Controller - { - // GET: api/values - [HttpGet] - public IEnumerable Get() - { - return new string[] { "value1", "value2" }; - } - - // GET api/values/5 - [HttpGet("{id}")] - public string Get(int id) - { - return "value"; - } - - // POST api/values - [HttpPost] - public void Post([FromBody]string value) - { - } - - // PUT api/values/5 - [HttpPut("{id}")] - public void Put(int id, [FromBody]string value) - { - } - - // DELETE api/values/5 - [HttpDelete("{id}")] - public void Delete(int id) - { - } - } -} diff --git a/NETCORE/test/WebApi.FunctionalTests/FunctionalTest/ExceptionTelemetryWebApiTests.cs b/NETCORE/test/WebApi.FunctionalTests/FunctionalTest/ExceptionTelemetryWebApiTests.cs deleted file mode 100644 index f65853f25d..0000000000 --- a/NETCORE/test/WebApi.FunctionalTests/FunctionalTest/ExceptionTelemetryWebApiTests.cs +++ /dev/null @@ -1,49 +0,0 @@ -namespace WebApi.FunctionalTests.FunctionalTest -{ - using System; - using FunctionalTestUtils; - using Microsoft.ApplicationInsights.DataContracts; - using Xunit; - using Microsoft.ApplicationInsights.Extensibility; - using Xunit.Abstractions; - using System.Reflection; - - public class ExceptionTelemetryWebApiTests : TelemetryTestsBase - { - private readonly string assemblyName; - - public ExceptionTelemetryWebApiTests(ITestOutputHelper output) : base(output) - { - this.assemblyName = this.GetType().GetTypeInfo().Assembly.GetName().Name; - } - - [Fact] - public void TestBasicRequestPropertiesAfterRequestingControllerThatThrows() - { - using (var server = new InProcessServer(assemblyName)) - { - const string RequestPath = "/api/exception"; - - var expectedRequestTelemetry = new RequestTelemetry(); - expectedRequestTelemetry.Name = "GET Exception/Get"; - expectedRequestTelemetry.ResponseCode = "500"; - expectedRequestTelemetry.Success = false; - expectedRequestTelemetry.Url = new System.Uri(server.BaseHost + RequestPath); - - this.ValidateBasicRequest(server, RequestPath, expectedRequestTelemetry); - } - } - - [Fact] - public void TestBasicExceptionPropertiesAfterRequestingControllerThatThrows() - { - using (var server = new InProcessServer(assemblyName)) - { - var expectedExceptionTelemetry = new ExceptionTelemetry(); - expectedExceptionTelemetry.Exception = new InvalidOperationException(); - - this.ValidateBasicException(server, "/api/exception", expectedExceptionTelemetry); - } - } - } -} diff --git a/NETCORE/test/WebApi.FunctionalTests/FunctionalTest/RequestTelemetryWebApiTests.cs b/NETCORE/test/WebApi.FunctionalTests/FunctionalTest/RequestTelemetryWebApiTests.cs deleted file mode 100644 index edaf88a12b..0000000000 --- a/NETCORE/test/WebApi.FunctionalTests/FunctionalTest/RequestTelemetryWebApiTests.cs +++ /dev/null @@ -1,70 +0,0 @@ -namespace WebApi.FunctionalTests.FunctionalTest -{ - using System.Reflection; - using FunctionalTestUtils; - using Microsoft.ApplicationInsights.DataContracts; - using Xunit; - using Xunit.Abstractions; - - public class RequestTelemetryWebApiTests : TelemetryTestsBase - { - private readonly string assemblyName; - - public RequestTelemetryWebApiTests(ITestOutputHelper output) : base (output) - { - this.assemblyName = this.GetType().GetTypeInfo().Assembly.GetName().Name; - } - - [Fact] - public void TestBasicRequestPropertiesAfterRequestingValuesController() - { - using (var server = new InProcessServer(assemblyName)) - { - const string RequestPath = "/api/values"; - - var expectedRequestTelemetry = new RequestTelemetry(); - expectedRequestTelemetry.Name = "GET Values/Get"; - expectedRequestTelemetry.ResponseCode = "200"; - expectedRequestTelemetry.Success = true; - expectedRequestTelemetry.Url = new System.Uri(server.BaseHost + RequestPath); - - this.ValidateBasicRequest(server, RequestPath, expectedRequestTelemetry); - } - } - - [Fact] - public void TestBasicRequestPropertiesAfterRequestingNotExistingController() - { - using (var server = new InProcessServer(assemblyName)) - { - const string RequestPath = "/api/notexistingcontroller"; - - var expectedRequestTelemetry = new RequestTelemetry(); - expectedRequestTelemetry.Name = "GET /api/notexistingcontroller"; - expectedRequestTelemetry.ResponseCode = "404"; - expectedRequestTelemetry.Success = false; - expectedRequestTelemetry.Url = new System.Uri(server.BaseHost + RequestPath); - - this.ValidateBasicRequest(server, RequestPath, expectedRequestTelemetry); - } - } - - [Fact] - public void TestBasicRequestPropertiesAfterRequestingWebApiShimRoute() - { - using (var server = new InProcessServer(assemblyName)) - { - const string RequestPath = "/api/values/1"; - - var expectedRequestTelemetry = new RequestTelemetry(); - expectedRequestTelemetry.Name = "GET Values/Get [id]"; - expectedRequestTelemetry.ResponseCode = "200"; - expectedRequestTelemetry.Success = true; - expectedRequestTelemetry.Url = new System.Uri(server.BaseHost + RequestPath); - - this.ValidateBasicRequest(server, RequestPath, expectedRequestTelemetry); - } - } - } -} - diff --git a/NETCORE/test/WebApi.FunctionalTests/FunctionalTest/TelemetryModuleWorkingWebApiTests.cs b/NETCORE/test/WebApi.FunctionalTests/FunctionalTest/TelemetryModuleWorkingWebApiTests.cs deleted file mode 100644 index 64ac0b50d8..0000000000 --- a/NETCORE/test/WebApi.FunctionalTests/FunctionalTest/TelemetryModuleWorkingWebApiTests.cs +++ /dev/null @@ -1,34 +0,0 @@ -using Xunit; - -[assembly: CollectionBehavior(DisableTestParallelization = true)] -namespace WebApi.FunctionalTests.FunctionalTest -{ - using System.Reflection; - using FunctionalTestUtils; - using Xunit.Abstractions; - - public class TelemetryModuleWorkingWebApiTests : TelemetryTestsBase - { - private readonly string assemblyName; - - public TelemetryModuleWorkingWebApiTests(ITestOutputHelper output) : base (output) - { - this.assemblyName = this.GetType().GetTypeInfo().Assembly.GetName().Name; - } - // The NET451 conditional check is wrapped inside the test to make the tests visible in the test explorer. We can move them to the class level once if the issue is resolved. - - [Fact] - public void TestBasicDependencyPropertiesAfterRequestingBasicPage() - { - this.ValidateBasicDependency(assemblyName, "/api/values"); - } - - [Fact] - public void TestIfPerformanceCountersAreCollected() - { -#if NET451 || NET46 - ValidatePerformanceCountersAreCollected(assemblyName); -#endif - } - } -} diff --git a/NETCORE/test/WebApi.FunctionalTests/Properties/launchSettings.json b/NETCORE/test/WebApi.FunctionalTests/Properties/launchSettings.json deleted file mode 100644 index 9dd7d9d703..0000000000 --- a/NETCORE/test/WebApi.FunctionalTests/Properties/launchSettings.json +++ /dev/null @@ -1,26 +0,0 @@ -{ - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:41846/", - "sslPort": 0 - } - }, - "profiles": { - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "launchUrl": "api/values", - "environmentVariables": { - "ASPNET_ENV": "Development" - } - }, - "web": { - "commandName": "web", - "environmentVariables": { - "Hosting:Environment": "Development" - } - } - } -} \ No newline at end of file diff --git a/NETCORE/test/WebApi.FunctionalTests/Startup.cs b/NETCORE/test/WebApi.FunctionalTests/Startup.cs deleted file mode 100644 index f5bb71c2be..0000000000 --- a/NETCORE/test/WebApi.FunctionalTests/Startup.cs +++ /dev/null @@ -1,48 +0,0 @@ -namespace SampleWebAPIIntegration -{ - using FunctionalTestUtils; - using Microsoft.ApplicationInsights.Channel; - using Microsoft.AspNetCore.Builder; - using Microsoft.AspNetCore.Hosting; - using Microsoft.Extensions.Configuration; - using Microsoft.Extensions.DependencyInjection; - - public class Startup - { - public Startup(IHostingEnvironment env) - { - // Setup configuration sources. - Configuration = new ConfigurationBuilder() - .AddJsonFile("config.json") - .Build(); - } - - public IConfiguration Configuration { get; set; } - - // This method gets called by a runtime. - // Use this method to add services to the container - public void ConfigureServices(IServiceCollection services) - { - services.AddSingleton(new BackTelemetryChannel()); - services.AddApplicationInsightsTelemetry(Configuration); - - // Uncomment the following line to add Web API services which makes it easier to port Web API 2 controllers. - // You will also need to add the Microsoft.AspNet.Mvc.WebApiCompatShim package to the 'dependencies' section of project.json. - services.AddMvc().AddWebApiConventions(); - } - - // Configure is called after ConfigureServices is called. - public void Configure(IApplicationBuilder app, IHostingEnvironment env) - { - // Configure the HTTP request pipeline. - app.UseStaticFiles(); - - // Add MVC to the request pipeline. - app.UseMvc(routes => - { - // Add the following route for porting Web API 2 controllers. - routes.MapWebApiRoute("DefaultApi", "api/{controller}/{id?}"); - }); - } - } -} diff --git a/NETCORE/test/WebApi.FunctionalTests/WebApi.FunctionalTests10.csproj b/NETCORE/test/WebApi.FunctionalTests/WebApi.FunctionalTests10.csproj deleted file mode 100644 index 7ef52edab2..0000000000 --- a/NETCORE/test/WebApi.FunctionalTests/WebApi.FunctionalTests10.csproj +++ /dev/null @@ -1,54 +0,0 @@ - - - - 2.0.0 - net46;netcoreapp1.0 - netcoreapp1.0 - win7-x86 - true - WebApi.FunctionalTests.Tests - WebApi.FunctionalTests - true - $(PackageTargetFallback);portable-net45+win8 - 1.1.5 - pdbonly - true - - - - - SettingsSingleFileGenerator - Always - - - PreserveNewest - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/NETCORE/test/WebApi.FunctionalTests/config.json b/NETCORE/test/WebApi.FunctionalTests/config.json deleted file mode 100644 index c3604e4474..0000000000 --- a/NETCORE/test/WebApi.FunctionalTests/config.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "ApplicationInsights": { - "InstrumentationKey": "11111111-2222-3333-4444-555555555555" - } -} \ No newline at end of file diff --git a/NETCORE/test/WebApi.FunctionalTests/wwwroot/web.config b/NETCORE/test/WebApi.FunctionalTests/wwwroot/web.config deleted file mode 100644 index 43a86c3bf1..0000000000 --- a/NETCORE/test/WebApi.FunctionalTests/wwwroot/web.config +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/NETCORE/test/WebApi.FunctionalTests/xunit.runner.json b/NETCORE/test/WebApi.FunctionalTests/xunit.runner.json deleted file mode 100644 index 253b9806cd..0000000000 --- a/NETCORE/test/WebApi.FunctionalTests/xunit.runner.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "parallelizeAssembly": false, - "parallelizeTestCollections": false -} diff --git a/Readme.md b/Readme.md index c3df6cf5f7..b01e889de2 100644 --- a/Readme.md +++ b/Readme.md @@ -156,9 +156,9 @@ The following is our tentative release schedule for 2020. | March | Early | | 2.14 Beta2 | | | | Mid | | 2.14 Beta3 | | | April | Early | | | 2.14 Stable | -| | Mid | | 2.15 Beta1 | | -| May | Early | | 2.15 Beta2 | | -| | Mid | | 2.15 Beta3 | | +| | Mid | | | | +| May | Early | | 2.15 Beta1 | | +| | Mid | | 2.15 Beta2 | | | June | Early | | | 2.15 Stable | | | Mid | | 2.16 Beta1 | | | **2020H2** | | | | | diff --git a/WEB/Src/DependencyCollector/DependencyCollector.Tests/DependencyCollector.Tests.csproj b/WEB/Src/DependencyCollector/DependencyCollector.Tests/DependencyCollector.Tests.csproj index 76180fcaa3..5c3157b90a 100644 --- a/WEB/Src/DependencyCollector/DependencyCollector.Tests/DependencyCollector.Tests.csproj +++ b/WEB/Src/DependencyCollector/DependencyCollector.Tests/DependencyCollector.Tests.csproj @@ -29,8 +29,8 @@ - - + + diff --git a/WEB/Src/DependencyCollector/DependencyCollector/DependencyCollector.csproj b/WEB/Src/DependencyCollector/DependencyCollector/DependencyCollector.csproj index 9ca5950092..1f24566fb6 100644 --- a/WEB/Src/DependencyCollector/DependencyCollector/DependencyCollector.csproj +++ b/WEB/Src/DependencyCollector/DependencyCollector/DependencyCollector.csproj @@ -8,14 +8,15 @@ Microsoft.AI.DependencyCollector net45;netstandard1.6;netstandard2.0 netstandard1.6;netstandard2.0 - false + false + $(DefineConstants);DEPENDENCY_COLLECTOR;ALLOW_AGGRESSIVE_INLIGNING_ATTRIBUTE; - + $(DefineConstants);NETSTANDARD; - + Microsoft.ApplicationInsights.DependencyCollector @@ -35,6 +36,9 @@ All + + All + @@ -43,12 +47,13 @@ All - + - + + @@ -75,7 +80,11 @@ - - + + + + + + - + \ No newline at end of file diff --git a/WEB/Src/DependencyCollector/Shared/DependencyTrackingTelemetryModule.cs b/WEB/Src/DependencyCollector/DependencyCollector/DependencyTrackingTelemetryModule.cs similarity index 100% rename from WEB/Src/DependencyCollector/Shared/DependencyTrackingTelemetryModule.cs rename to WEB/Src/DependencyCollector/DependencyCollector/DependencyTrackingTelemetryModule.cs diff --git a/WEB/Src/DependencyCollector/Shared/HttpCoreDiagnosticSourceListener.cs b/WEB/Src/DependencyCollector/DependencyCollector/HttpCoreDiagnosticSourceListener.cs similarity index 100% rename from WEB/Src/DependencyCollector/Shared/HttpCoreDiagnosticSourceListener.cs rename to WEB/Src/DependencyCollector/DependencyCollector/HttpCoreDiagnosticSourceListener.cs diff --git a/WEB/Src/DependencyCollector/Shared/HttpDependenciesParsingTelemetryInitializer.cs b/WEB/Src/DependencyCollector/DependencyCollector/HttpDependenciesParsingTelemetryInitializer.cs similarity index 100% rename from WEB/Src/DependencyCollector/Shared/HttpDependenciesParsingTelemetryInitializer.cs rename to WEB/Src/DependencyCollector/DependencyCollector/HttpDependenciesParsingTelemetryInitializer.cs diff --git a/WEB/Src/DependencyCollector/Shared/Implementation/ActiveSubsciptionManager.cs b/WEB/Src/DependencyCollector/DependencyCollector/Implementation/ActiveSubsciptionManager.cs similarity index 100% rename from WEB/Src/DependencyCollector/Shared/Implementation/ActiveSubsciptionManager.cs rename to WEB/Src/DependencyCollector/DependencyCollector/Implementation/ActiveSubsciptionManager.cs diff --git a/WEB/Src/DependencyCollector/Shared/Implementation/AppMapCorrelationEventSource.cs b/WEB/Src/DependencyCollector/DependencyCollector/Implementation/AppMapCorrelationEventSource.cs similarity index 100% rename from WEB/Src/DependencyCollector/Shared/Implementation/AppMapCorrelationEventSource.cs rename to WEB/Src/DependencyCollector/DependencyCollector/Implementation/AppMapCorrelationEventSource.cs diff --git a/WEB/Src/DependencyCollector/Shared/Implementation/ApplicationInsightsUrlFilter.cs b/WEB/Src/DependencyCollector/DependencyCollector/Implementation/ApplicationInsightsUrlFilter.cs similarity index 100% rename from WEB/Src/DependencyCollector/Shared/Implementation/ApplicationInsightsUrlFilter.cs rename to WEB/Src/DependencyCollector/DependencyCollector/Implementation/ApplicationInsightsUrlFilter.cs diff --git a/WEB/Src/DependencyCollector/Shared/Implementation/AzureSdk/AzureSdkDiagnosticListenerSubscriber.cs b/WEB/Src/DependencyCollector/DependencyCollector/Implementation/AzureSdk/AzureSdkDiagnosticListenerSubscriber.cs similarity index 100% rename from WEB/Src/DependencyCollector/Shared/Implementation/AzureSdk/AzureSdkDiagnosticListenerSubscriber.cs rename to WEB/Src/DependencyCollector/DependencyCollector/Implementation/AzureSdk/AzureSdkDiagnosticListenerSubscriber.cs diff --git a/WEB/Src/DependencyCollector/Shared/Implementation/AzureSdk/AzureSdkDiagnosticsEventHandler.cs b/WEB/Src/DependencyCollector/DependencyCollector/Implementation/AzureSdk/AzureSdkDiagnosticsEventHandler.cs similarity index 100% rename from WEB/Src/DependencyCollector/Shared/Implementation/AzureSdk/AzureSdkDiagnosticsEventHandler.cs rename to WEB/Src/DependencyCollector/DependencyCollector/Implementation/AzureSdk/AzureSdkDiagnosticsEventHandler.cs diff --git a/WEB/Src/DependencyCollector/Shared/Implementation/ClientServerDependencyTracker.cs b/WEB/Src/DependencyCollector/DependencyCollector/Implementation/ClientServerDependencyTracker.cs similarity index 99% rename from WEB/Src/DependencyCollector/Shared/Implementation/ClientServerDependencyTracker.cs rename to WEB/Src/DependencyCollector/DependencyCollector/Implementation/ClientServerDependencyTracker.cs index 9cd6774ac1..6ca986195a 100644 --- a/WEB/Src/DependencyCollector/Shared/Implementation/ClientServerDependencyTracker.cs +++ b/WEB/Src/DependencyCollector/DependencyCollector/Implementation/ClientServerDependencyTracker.cs @@ -1,4 +1,5 @@ -namespace Microsoft.ApplicationInsights.DependencyCollector.Implementation +#if NET45 +namespace Microsoft.ApplicationInsights.DependencyCollector.Implementation { using System; using System.Data.SqlClient; @@ -223,3 +224,4 @@ internal static long GetIdForRequestObject(object obj) } } } +#endif \ No newline at end of file diff --git a/WEB/Src/DependencyCollector/Shared/Implementation/DependencyCollectorEventSource.cs b/WEB/Src/DependencyCollector/DependencyCollector/Implementation/DependencyCollectorEventSource.cs similarity index 100% rename from WEB/Src/DependencyCollector/Shared/Implementation/DependencyCollectorEventSource.cs rename to WEB/Src/DependencyCollector/DependencyCollector/Implementation/DependencyCollectorEventSource.cs diff --git a/WEB/Src/DependencyCollector/Shared/Implementation/DependencyTableStore.cs b/WEB/Src/DependencyCollector/DependencyCollector/Implementation/DependencyTableStore.cs similarity index 95% rename from WEB/Src/DependencyCollector/Shared/Implementation/DependencyTableStore.cs rename to WEB/Src/DependencyCollector/DependencyCollector/Implementation/DependencyTableStore.cs index 28a71180d4..2bc5239559 100644 --- a/WEB/Src/DependencyCollector/Shared/Implementation/DependencyTableStore.cs +++ b/WEB/Src/DependencyCollector/DependencyCollector/Implementation/DependencyTableStore.cs @@ -1,4 +1,5 @@ -namespace Microsoft.ApplicationInsights.DependencyCollector.Implementation +#if NET45 +namespace Microsoft.ApplicationInsights.DependencyCollector.Implementation { using System; using Microsoft.ApplicationInsights.DataContracts; @@ -48,3 +49,4 @@ private void Dispose(bool disposing) } } } +#endif \ No newline at end of file diff --git a/WEB/Src/DependencyCollector/Shared/Implementation/DependencyTargetNameHelper.cs b/WEB/Src/DependencyCollector/DependencyCollector/Implementation/DependencyTargetNameHelper.cs similarity index 100% rename from WEB/Src/DependencyCollector/Shared/Implementation/DependencyTargetNameHelper.cs rename to WEB/Src/DependencyCollector/DependencyCollector/Implementation/DependencyTargetNameHelper.cs diff --git a/WEB/Src/DependencyCollector/Shared/Implementation/DesktopDiagnosticSourceHttpProcessing.cs b/WEB/Src/DependencyCollector/DependencyCollector/Implementation/DesktopDiagnosticSourceHttpProcessing.cs similarity index 100% rename from WEB/Src/DependencyCollector/Shared/Implementation/DesktopDiagnosticSourceHttpProcessing.cs rename to WEB/Src/DependencyCollector/DependencyCollector/Implementation/DesktopDiagnosticSourceHttpProcessing.cs diff --git a/WEB/Src/DependencyCollector/Shared/Implementation/DiagnosticSourceListenerBase.cs b/WEB/Src/DependencyCollector/DependencyCollector/Implementation/DiagnosticSourceListenerBase.cs similarity index 100% rename from WEB/Src/DependencyCollector/Shared/Implementation/DiagnosticSourceListenerBase.cs rename to WEB/Src/DependencyCollector/DependencyCollector/Implementation/DiagnosticSourceListenerBase.cs diff --git a/WEB/Src/DependencyCollector/Shared/Implementation/EventHandlers/DiagnosticsEventHandlerBase.cs b/WEB/Src/DependencyCollector/DependencyCollector/Implementation/EventHandlers/DiagnosticsEventHandlerBase.cs similarity index 100% rename from WEB/Src/DependencyCollector/Shared/Implementation/EventHandlers/DiagnosticsEventHandlerBase.cs rename to WEB/Src/DependencyCollector/DependencyCollector/Implementation/EventHandlers/DiagnosticsEventHandlerBase.cs diff --git a/WEB/Src/DependencyCollector/Shared/Implementation/EventHandlers/EventHubsDiagnosticsEventHandler.cs b/WEB/Src/DependencyCollector/DependencyCollector/Implementation/EventHandlers/EventHubsDiagnosticsEventHandler.cs similarity index 100% rename from WEB/Src/DependencyCollector/Shared/Implementation/EventHandlers/EventHubsDiagnosticsEventHandler.cs rename to WEB/Src/DependencyCollector/DependencyCollector/Implementation/EventHandlers/EventHubsDiagnosticsEventHandler.cs diff --git a/WEB/Src/DependencyCollector/Shared/Implementation/EventHandlers/ServiceBusDiagnosticsEventHandler.cs b/WEB/Src/DependencyCollector/DependencyCollector/Implementation/EventHandlers/ServiceBusDiagnosticsEventHandler.cs similarity index 100% rename from WEB/Src/DependencyCollector/Shared/Implementation/EventHandlers/ServiceBusDiagnosticsEventHandler.cs rename to WEB/Src/DependencyCollector/DependencyCollector/Implementation/EventHandlers/ServiceBusDiagnosticsEventHandler.cs diff --git a/WEB/Src/DependencyCollector/Shared/Implementation/FrameworkHttpEventListener.cs b/WEB/Src/DependencyCollector/DependencyCollector/Implementation/FrameworkHttpEventListener.cs similarity index 98% rename from WEB/Src/DependencyCollector/Shared/Implementation/FrameworkHttpEventListener.cs rename to WEB/Src/DependencyCollector/DependencyCollector/Implementation/FrameworkHttpEventListener.cs index 9ba7a68b5f..8b93052e53 100644 --- a/WEB/Src/DependencyCollector/Shared/Implementation/FrameworkHttpEventListener.cs +++ b/WEB/Src/DependencyCollector/DependencyCollector/Implementation/FrameworkHttpEventListener.cs @@ -1,4 +1,5 @@ -namespace Microsoft.ApplicationInsights.DependencyCollector.Implementation +#if NET45 +namespace Microsoft.ApplicationInsights.DependencyCollector.Implementation { using System; using System.Diagnostics.Tracing; @@ -166,4 +167,5 @@ private void OnBeginGetRequestStream(EventWrittenEventArgs eventData) } } } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/WEB/Src/DependencyCollector/Shared/Implementation/FrameworkHttpProcessing.cs b/WEB/Src/DependencyCollector/DependencyCollector/Implementation/FrameworkHttpProcessing.cs similarity index 98% rename from WEB/Src/DependencyCollector/Shared/Implementation/FrameworkHttpProcessing.cs rename to WEB/Src/DependencyCollector/DependencyCollector/Implementation/FrameworkHttpProcessing.cs index ccaed5b1df..3ab579adf0 100644 --- a/WEB/Src/DependencyCollector/Shared/Implementation/FrameworkHttpProcessing.cs +++ b/WEB/Src/DependencyCollector/DependencyCollector/Implementation/FrameworkHttpProcessing.cs @@ -1,4 +1,5 @@ -namespace Microsoft.ApplicationInsights.DependencyCollector.Implementation +#if NET45 +namespace Microsoft.ApplicationInsights.DependencyCollector.Implementation { using System; using System.Collections.Generic; @@ -181,4 +182,5 @@ protected override void RemoveTupleForWebDependencies(WebRequest webRequest) this.TelemetryTable.Remove(ClientServerDependencyTracker.GetIdForRequestObject(webRequest)); } } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/WEB/Src/DependencyCollector/Shared/Implementation/FrameworkSqlEventListener.cs b/WEB/Src/DependencyCollector/DependencyCollector/Implementation/FrameworkSqlEventListener.cs similarity index 98% rename from WEB/Src/DependencyCollector/Shared/Implementation/FrameworkSqlEventListener.cs rename to WEB/Src/DependencyCollector/DependencyCollector/Implementation/FrameworkSqlEventListener.cs index 7959d60ee5..5a734e83c0 100644 --- a/WEB/Src/DependencyCollector/Shared/Implementation/FrameworkSqlEventListener.cs +++ b/WEB/Src/DependencyCollector/DependencyCollector/Implementation/FrameworkSqlEventListener.cs @@ -1,4 +1,5 @@ -namespace Microsoft.ApplicationInsights.DependencyCollector.Implementation +#if NET45 +namespace Microsoft.ApplicationInsights.DependencyCollector.Implementation { using System; using System.Diagnostics.Tracing; @@ -139,4 +140,5 @@ private void OnEndExecute(EventWrittenEventArgs eventData) } } } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/WEB/Src/DependencyCollector/Shared/Implementation/FrameworkSqlProcessing.cs b/WEB/Src/DependencyCollector/DependencyCollector/Implementation/FrameworkSqlProcessing.cs similarity index 98% rename from WEB/Src/DependencyCollector/Shared/Implementation/FrameworkSqlProcessing.cs rename to WEB/Src/DependencyCollector/DependencyCollector/Implementation/FrameworkSqlProcessing.cs index cb96a4de9e..e7b3a50684 100644 --- a/WEB/Src/DependencyCollector/Shared/Implementation/FrameworkSqlProcessing.cs +++ b/WEB/Src/DependencyCollector/DependencyCollector/Implementation/FrameworkSqlProcessing.cs @@ -1,4 +1,5 @@ -namespace Microsoft.ApplicationInsights.DependencyCollector.Implementation +#if NET45 +namespace Microsoft.ApplicationInsights.DependencyCollector.Implementation { using System; using System.Diagnostics; @@ -126,3 +127,4 @@ private static string GetResourceName(string dataSource, string database) } } } +#endif \ No newline at end of file diff --git a/WEB/Src/DependencyCollector/Shared/Implementation/HttpDesktopDiagnosticSourceListener.cs b/WEB/Src/DependencyCollector/DependencyCollector/Implementation/HttpDesktopDiagnosticSourceListener.cs similarity index 100% rename from WEB/Src/DependencyCollector/Shared/Implementation/HttpDesktopDiagnosticSourceListener.cs rename to WEB/Src/DependencyCollector/DependencyCollector/Implementation/HttpDesktopDiagnosticSourceListener.cs diff --git a/WEB/Src/DependencyCollector/Shared/Implementation/HttpDesktopDiagnosticSourceSubscriber.cs b/WEB/Src/DependencyCollector/DependencyCollector/Implementation/HttpDesktopDiagnosticSourceSubscriber.cs similarity index 99% rename from WEB/Src/DependencyCollector/Shared/Implementation/HttpDesktopDiagnosticSourceSubscriber.cs rename to WEB/Src/DependencyCollector/DependencyCollector/Implementation/HttpDesktopDiagnosticSourceSubscriber.cs index 7691d29f88..55213ec848 100644 --- a/WEB/Src/DependencyCollector/Shared/Implementation/HttpDesktopDiagnosticSourceSubscriber.cs +++ b/WEB/Src/DependencyCollector/DependencyCollector/Implementation/HttpDesktopDiagnosticSourceSubscriber.cs @@ -1,3 +1,4 @@ +#if NET45 namespace Microsoft.ApplicationInsights.DependencyCollector.Implementation { using System; @@ -124,4 +125,5 @@ protected virtual void Dispose(bool disposing) } } } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/WEB/Src/DependencyCollector/Shared/HttpHeadersUtilities.cs b/WEB/Src/DependencyCollector/DependencyCollector/Implementation/HttpHeadersUtilities.cs similarity index 100% rename from WEB/Src/DependencyCollector/Shared/HttpHeadersUtilities.cs rename to WEB/Src/DependencyCollector/DependencyCollector/Implementation/HttpHeadersUtilities.cs diff --git a/WEB/Src/DependencyCollector/Shared/Implementation/HttpParsers/AzureBlobHttpParser.cs b/WEB/Src/DependencyCollector/DependencyCollector/Implementation/HttpParsers/AzureBlobHttpParser.cs similarity index 100% rename from WEB/Src/DependencyCollector/Shared/Implementation/HttpParsers/AzureBlobHttpParser.cs rename to WEB/Src/DependencyCollector/DependencyCollector/Implementation/HttpParsers/AzureBlobHttpParser.cs diff --git a/WEB/Src/DependencyCollector/Shared/Implementation/HttpParsers/AzureIotHubHttpParser.cs b/WEB/Src/DependencyCollector/DependencyCollector/Implementation/HttpParsers/AzureIotHubHttpParser.cs similarity index 100% rename from WEB/Src/DependencyCollector/Shared/Implementation/HttpParsers/AzureIotHubHttpParser.cs rename to WEB/Src/DependencyCollector/DependencyCollector/Implementation/HttpParsers/AzureIotHubHttpParser.cs diff --git a/WEB/Src/DependencyCollector/Shared/Implementation/HttpParsers/AzureQueueHttpParser.cs b/WEB/Src/DependencyCollector/DependencyCollector/Implementation/HttpParsers/AzureQueueHttpParser.cs similarity index 100% rename from WEB/Src/DependencyCollector/Shared/Implementation/HttpParsers/AzureQueueHttpParser.cs rename to WEB/Src/DependencyCollector/DependencyCollector/Implementation/HttpParsers/AzureQueueHttpParser.cs diff --git a/WEB/Src/DependencyCollector/Shared/Implementation/HttpParsers/AzureSearchHttpParser.cs b/WEB/Src/DependencyCollector/DependencyCollector/Implementation/HttpParsers/AzureSearchHttpParser.cs similarity index 100% rename from WEB/Src/DependencyCollector/Shared/Implementation/HttpParsers/AzureSearchHttpParser.cs rename to WEB/Src/DependencyCollector/DependencyCollector/Implementation/HttpParsers/AzureSearchHttpParser.cs diff --git a/WEB/Src/DependencyCollector/Shared/Implementation/HttpParsers/AzureServiceBusHttpParser.cs b/WEB/Src/DependencyCollector/DependencyCollector/Implementation/HttpParsers/AzureServiceBusHttpParser.cs similarity index 100% rename from WEB/Src/DependencyCollector/Shared/Implementation/HttpParsers/AzureServiceBusHttpParser.cs rename to WEB/Src/DependencyCollector/DependencyCollector/Implementation/HttpParsers/AzureServiceBusHttpParser.cs diff --git a/WEB/Src/DependencyCollector/Shared/Implementation/HttpParsers/AzureTableHttpParser.cs b/WEB/Src/DependencyCollector/DependencyCollector/Implementation/HttpParsers/AzureTableHttpParser.cs similarity index 100% rename from WEB/Src/DependencyCollector/Shared/Implementation/HttpParsers/AzureTableHttpParser.cs rename to WEB/Src/DependencyCollector/DependencyCollector/Implementation/HttpParsers/AzureTableHttpParser.cs diff --git a/WEB/Src/DependencyCollector/Shared/Implementation/HttpParsers/DocumentDbHttpParser.cs b/WEB/Src/DependencyCollector/DependencyCollector/Implementation/HttpParsers/DocumentDbHttpParser.cs similarity index 100% rename from WEB/Src/DependencyCollector/Shared/Implementation/HttpParsers/DocumentDbHttpParser.cs rename to WEB/Src/DependencyCollector/DependencyCollector/Implementation/HttpParsers/DocumentDbHttpParser.cs diff --git a/WEB/Src/DependencyCollector/Shared/Implementation/HttpParsers/GenericServiceHttpParser.cs b/WEB/Src/DependencyCollector/DependencyCollector/Implementation/HttpParsers/GenericServiceHttpParser.cs similarity index 100% rename from WEB/Src/DependencyCollector/Shared/Implementation/HttpParsers/GenericServiceHttpParser.cs rename to WEB/Src/DependencyCollector/DependencyCollector/Implementation/HttpParsers/GenericServiceHttpParser.cs diff --git a/WEB/Src/DependencyCollector/Shared/Implementation/HttpParsers/HttpParsingHelper.cs b/WEB/Src/DependencyCollector/DependencyCollector/Implementation/HttpParsers/HttpParsingHelper.cs similarity index 100% rename from WEB/Src/DependencyCollector/Shared/Implementation/HttpParsers/HttpParsingHelper.cs rename to WEB/Src/DependencyCollector/DependencyCollector/Implementation/HttpParsers/HttpParsingHelper.cs diff --git a/WEB/Src/DependencyCollector/Shared/Implementation/HttpProcessing.cs b/WEB/Src/DependencyCollector/DependencyCollector/Implementation/HttpProcessing.cs similarity index 99% rename from WEB/Src/DependencyCollector/Shared/Implementation/HttpProcessing.cs rename to WEB/Src/DependencyCollector/DependencyCollector/Implementation/HttpProcessing.cs index 5e6617dbbb..7d1d272b51 100644 --- a/WEB/Src/DependencyCollector/Shared/Implementation/HttpProcessing.cs +++ b/WEB/Src/DependencyCollector/DependencyCollector/Implementation/HttpProcessing.cs @@ -1,3 +1,4 @@ +#if NET45 namespace Microsoft.ApplicationInsights.DependencyCollector.Implementation { using System; @@ -495,4 +496,5 @@ private void SetTarget(DependencyTelemetry telemetry, WebHeaderCollection respon } } } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/WEB/Src/DependencyCollector/Shared/Implementation/IDiagnosticEventHandler.cs b/WEB/Src/DependencyCollector/DependencyCollector/Implementation/IDiagnosticEventHandler.cs similarity index 100% rename from WEB/Src/DependencyCollector/Shared/Implementation/IDiagnosticEventHandler.cs rename to WEB/Src/DependencyCollector/DependencyCollector/Implementation/IDiagnosticEventHandler.cs diff --git a/WEB/Src/DependencyCollector/Shared/Implementation/Operation/CacheBasedOperationHolder.cs b/WEB/Src/DependencyCollector/DependencyCollector/Implementation/Operation/CacheBasedOperationHolder.cs similarity index 95% rename from WEB/Src/DependencyCollector/Shared/Implementation/Operation/CacheBasedOperationHolder.cs rename to WEB/Src/DependencyCollector/DependencyCollector/Implementation/Operation/CacheBasedOperationHolder.cs index cdd2165561..9a59efb18c 100644 --- a/WEB/Src/DependencyCollector/Shared/Implementation/Operation/CacheBasedOperationHolder.cs +++ b/WEB/Src/DependencyCollector/DependencyCollector/Implementation/Operation/CacheBasedOperationHolder.cs @@ -1,4 +1,5 @@ -namespace Microsoft.ApplicationInsights.DependencyCollector.Implementation.Operation +#if NET45 +namespace Microsoft.ApplicationInsights.DependencyCollector.Implementation.Operation { using System; using System.Globalization; @@ -63,3 +64,4 @@ public void Dispose() } } } +#endif \ No newline at end of file diff --git a/WEB/Src/DependencyCollector/Shared/Implementation/Operation/ObjectInstanceBasedOperationHolder.cs b/WEB/Src/DependencyCollector/DependencyCollector/Implementation/Operation/ObjectInstanceBasedOperationHolder.cs similarity index 100% rename from WEB/Src/DependencyCollector/Shared/Implementation/Operation/ObjectInstanceBasedOperationHolder.cs rename to WEB/Src/DependencyCollector/DependencyCollector/Implementation/Operation/ObjectInstanceBasedOperationHolder.cs diff --git a/WEB/Src/DependencyCollector/Shared/Implementation/Operation/OperationWatch.cs b/WEB/Src/DependencyCollector/DependencyCollector/Implementation/Operation/OperationWatch.cs similarity index 100% rename from WEB/Src/DependencyCollector/Shared/Implementation/Operation/OperationWatch.cs rename to WEB/Src/DependencyCollector/DependencyCollector/Implementation/Operation/OperationWatch.cs diff --git a/WEB/Src/DependencyCollector/Shared/Implementation/ProfilerHttpProcessing.cs b/WEB/Src/DependencyCollector/DependencyCollector/Implementation/ProfilerHttpProcessing.cs similarity index 98% rename from WEB/Src/DependencyCollector/Shared/Implementation/ProfilerHttpProcessing.cs rename to WEB/Src/DependencyCollector/DependencyCollector/Implementation/ProfilerHttpProcessing.cs index 53aea0390d..1d1a8363b3 100644 --- a/WEB/Src/DependencyCollector/Shared/Implementation/ProfilerHttpProcessing.cs +++ b/WEB/Src/DependencyCollector/DependencyCollector/Implementation/ProfilerHttpProcessing.cs @@ -1,4 +1,5 @@ -namespace Microsoft.ApplicationInsights.DependencyCollector.Implementation +#if NET45 +namespace Microsoft.ApplicationInsights.DependencyCollector.Implementation { using System; using System.Collections.Generic; @@ -187,4 +188,5 @@ protected override void RemoveTupleForWebDependencies(WebRequest webRequest) this.TelemetryTable.Remove(webRequest); } } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/WEB/Src/DependencyCollector/Shared/Implementation/ProfilerRuntimeInstrumentation.cs b/WEB/Src/DependencyCollector/DependencyCollector/Implementation/ProfilerRuntimeInstrumentation.cs similarity index 99% rename from WEB/Src/DependencyCollector/Shared/Implementation/ProfilerRuntimeInstrumentation.cs rename to WEB/Src/DependencyCollector/DependencyCollector/Implementation/ProfilerRuntimeInstrumentation.cs index 62b4b05e9b..386aaa3acf 100644 --- a/WEB/Src/DependencyCollector/Shared/Implementation/ProfilerRuntimeInstrumentation.cs +++ b/WEB/Src/DependencyCollector/DependencyCollector/Implementation/ProfilerRuntimeInstrumentation.cs @@ -1,4 +1,5 @@ -namespace Microsoft.ApplicationInsights.DependencyCollector.Implementation +#if NET45 +namespace Microsoft.ApplicationInsights.DependencyCollector.Implementation { using Microsoft.Diagnostics.Instrumentation.Extensions.Intercept; @@ -341,3 +342,4 @@ internal static void DecorateProfilerForSqlConnection(ref ProfilerSqlConnectionP } } } +#endif \ No newline at end of file diff --git a/WEB/Src/DependencyCollector/Shared/Implementation/ProfilerSqlCommandProcessing.cs b/WEB/Src/DependencyCollector/DependencyCollector/Implementation/ProfilerSqlCommandProcessing.cs similarity index 97% rename from WEB/Src/DependencyCollector/Shared/Implementation/ProfilerSqlCommandProcessing.cs rename to WEB/Src/DependencyCollector/DependencyCollector/Implementation/ProfilerSqlCommandProcessing.cs index 3e4a279be2..6247cb8dee 100644 --- a/WEB/Src/DependencyCollector/Shared/Implementation/ProfilerSqlCommandProcessing.cs +++ b/WEB/Src/DependencyCollector/DependencyCollector/Implementation/ProfilerSqlCommandProcessing.cs @@ -1,4 +1,5 @@ -namespace Microsoft.ApplicationInsights.DependencyCollector.Implementation +#if NET45 +namespace Microsoft.ApplicationInsights.DependencyCollector.Implementation { using System.Data; using System.Data.SqlClient; @@ -89,4 +90,5 @@ internal override string GetCommandName(object thisObj) return string.Empty; } } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/WEB/Src/DependencyCollector/Shared/Implementation/ProfilerSqlConnectionProcessing.cs b/WEB/Src/DependencyCollector/DependencyCollector/Implementation/ProfilerSqlConnectionProcessing.cs similarity index 96% rename from WEB/Src/DependencyCollector/Shared/Implementation/ProfilerSqlConnectionProcessing.cs rename to WEB/Src/DependencyCollector/DependencyCollector/Implementation/ProfilerSqlConnectionProcessing.cs index 23f5d41e9e..c3eef21d7f 100644 --- a/WEB/Src/DependencyCollector/Shared/Implementation/ProfilerSqlConnectionProcessing.cs +++ b/WEB/Src/DependencyCollector/DependencyCollector/Implementation/ProfilerSqlConnectionProcessing.cs @@ -1,4 +1,5 @@ -namespace Microsoft.ApplicationInsights.DependencyCollector.Implementation +#if NET45 +namespace Microsoft.ApplicationInsights.DependencyCollector.Implementation { using System.Data.SqlClient; using Microsoft.ApplicationInsights.DataContracts; @@ -69,4 +70,5 @@ internal override string GetCommandName(object thisObj) return SqlConnectionCommandText; } } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/WEB/Src/DependencyCollector/Shared/Implementation/ProfilerSqlProcessingBase.cs b/WEB/Src/DependencyCollector/DependencyCollector/Implementation/ProfilerSqlProcessingBase.cs similarity index 99% rename from WEB/Src/DependencyCollector/Shared/Implementation/ProfilerSqlProcessingBase.cs rename to WEB/Src/DependencyCollector/DependencyCollector/Implementation/ProfilerSqlProcessingBase.cs index cb2e99580d..4786b1909b 100644 --- a/WEB/Src/DependencyCollector/Shared/Implementation/ProfilerSqlProcessingBase.cs +++ b/WEB/Src/DependencyCollector/DependencyCollector/Implementation/ProfilerSqlProcessingBase.cs @@ -1,4 +1,5 @@ -namespace Microsoft.ApplicationInsights.DependencyCollector.Implementation +#if NET45 +namespace Microsoft.ApplicationInsights.DependencyCollector.Implementation { using System; using System.Data.SqlClient; @@ -442,4 +443,5 @@ private void OnEndInternal(object exceptionObj, object thisObj, bool sendTelemet } } } -} \ No newline at end of file +} +#endif \ No newline at end of file diff --git a/WEB/Src/DependencyCollector/Shared/Implementation/RDDSource.cs b/WEB/Src/DependencyCollector/DependencyCollector/Implementation/RDDSource.cs similarity index 100% rename from WEB/Src/DependencyCollector/Shared/Implementation/RDDSource.cs rename to WEB/Src/DependencyCollector/DependencyCollector/Implementation/RDDSource.cs diff --git a/WEB/Src/DependencyCollector/Shared/Implementation/RemoteDependencyConstants.cs b/WEB/Src/DependencyCollector/DependencyCollector/Implementation/RemoteDependencyConstants.cs similarity index 100% rename from WEB/Src/DependencyCollector/Shared/Implementation/RemoteDependencyConstants.cs rename to WEB/Src/DependencyCollector/DependencyCollector/Implementation/RemoteDependencyConstants.cs diff --git a/WEB/Src/DependencyCollector/Shared/Implementation/RetryPolicy.cs b/WEB/Src/DependencyCollector/DependencyCollector/Implementation/RetryPolicy.cs similarity index 91% rename from WEB/Src/DependencyCollector/Shared/Implementation/RetryPolicy.cs rename to WEB/Src/DependencyCollector/DependencyCollector/Implementation/RetryPolicy.cs index 3e80d7d68d..3a7e423cfd 100644 --- a/WEB/Src/DependencyCollector/Shared/Implementation/RetryPolicy.cs +++ b/WEB/Src/DependencyCollector/DependencyCollector/Implementation/RetryPolicy.cs @@ -1,4 +1,5 @@ -namespace Microsoft.ApplicationInsights.DependencyCollector.Implementation +#if NET45 +namespace Microsoft.ApplicationInsights.DependencyCollector.Implementation { using System; using System.Threading; @@ -38,3 +39,4 @@ public static TResult Retry( } } } +#endif \ No newline at end of file diff --git a/WEB/Src/DependencyCollector/Shared/Implementation/SqlClientDiagnostics/SqlClientDiagnosticFetcherTypes.cs b/WEB/Src/DependencyCollector/DependencyCollector/Implementation/SqlClientDiagnostics/SqlClientDiagnosticFetcherTypes.cs similarity index 100% rename from WEB/Src/DependencyCollector/Shared/Implementation/SqlClientDiagnostics/SqlClientDiagnosticFetcherTypes.cs rename to WEB/Src/DependencyCollector/DependencyCollector/Implementation/SqlClientDiagnostics/SqlClientDiagnosticFetcherTypes.cs diff --git a/WEB/Src/DependencyCollector/Shared/Implementation/SqlClientDiagnostics/SqlClientDiagnosticSourceListener.cs b/WEB/Src/DependencyCollector/DependencyCollector/Implementation/SqlClientDiagnostics/SqlClientDiagnosticSourceListener.cs similarity index 100% rename from WEB/Src/DependencyCollector/Shared/Implementation/SqlClientDiagnostics/SqlClientDiagnosticSourceListener.cs rename to WEB/Src/DependencyCollector/DependencyCollector/Implementation/SqlClientDiagnostics/SqlClientDiagnosticSourceListener.cs diff --git a/WEB/Src/DependencyCollector/Shared/Properties/AssemblyInfo.cs b/WEB/Src/DependencyCollector/DependencyCollector/Properties/AssemblyInfo.cs similarity index 100% rename from WEB/Src/DependencyCollector/Shared/Properties/AssemblyInfo.cs rename to WEB/Src/DependencyCollector/DependencyCollector/Properties/AssemblyInfo.cs diff --git a/WEB/Src/DependencyCollector/Shared/SanitizedHostList.cs b/WEB/Src/DependencyCollector/DependencyCollector/SanitizedHostList.cs similarity index 100% rename from WEB/Src/DependencyCollector/Shared/SanitizedHostList.cs rename to WEB/Src/DependencyCollector/DependencyCollector/SanitizedHostList.cs diff --git a/WEB/Src/DependencyCollector/Shared/TelemetryDiagnosticSourceListener.cs b/WEB/Src/DependencyCollector/DependencyCollector/TelemetryDiagnosticSourceListener.cs similarity index 100% rename from WEB/Src/DependencyCollector/Shared/TelemetryDiagnosticSourceListener.cs rename to WEB/Src/DependencyCollector/DependencyCollector/TelemetryDiagnosticSourceListener.cs diff --git a/WEB/Src/DependencyCollector/Shared/TelemetryExtensionsForDependencyCollector.cs b/WEB/Src/DependencyCollector/DependencyCollector/TelemetryExtensionsForDependencyCollector.cs similarity index 97% rename from WEB/Src/DependencyCollector/Shared/TelemetryExtensionsForDependencyCollector.cs rename to WEB/Src/DependencyCollector/DependencyCollector/TelemetryExtensionsForDependencyCollector.cs index 218925e121..519a2df694 100644 --- a/WEB/Src/DependencyCollector/Shared/TelemetryExtensionsForDependencyCollector.cs +++ b/WEB/Src/DependencyCollector/DependencyCollector/TelemetryExtensionsForDependencyCollector.cs @@ -1,4 +1,5 @@ -namespace Microsoft.ApplicationInsights.DependencyCollector +#if NET45 +namespace Microsoft.ApplicationInsights.DependencyCollector { using System; using System.Data.SqlClient; @@ -40,3 +41,4 @@ public static DependencyTelemetry AssociateTelemetryWithSqlRequest(this Dependen } } } +#endif \ No newline at end of file diff --git a/WEB/Src/DependencyCollector/Shared/DependencyCollector.Shared.projitems b/WEB/Src/DependencyCollector/Shared/DependencyCollector.Shared.projitems deleted file mode 100644 index 8c2ff17d54..0000000000 --- a/WEB/Src/DependencyCollector/Shared/DependencyCollector.Shared.projitems +++ /dev/null @@ -1,73 +0,0 @@ - - - - {C6425564-9EFE-49B3-B309-4D5FB55A5355} - - - $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - true - 669e7e58-072d-4b0a-a4dd-4eb2ae2ea4d4 - - - Microsoft.ApplicationInsights.DependencyCollector - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/WEB/Src/DependencyCollector/Shared/DependencyCollector.Shared.shproj b/WEB/Src/DependencyCollector/Shared/DependencyCollector.Shared.shproj deleted file mode 100644 index e78e98ae41..0000000000 --- a/WEB/Src/DependencyCollector/Shared/DependencyCollector.Shared.shproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - 669e7e58-072d-4b0a-a4dd-4eb2ae2ea4d4 - - - - - - - - diff --git a/WEB/Src/DependencyCollector/Shared/Implementation/HttpHeadersUtilities.cs b/WEB/Src/DependencyCollector/Shared/Implementation/HttpHeadersUtilities.cs deleted file mode 100644 index 0a8cdc1ed7..0000000000 --- a/WEB/Src/DependencyCollector/Shared/Implementation/HttpHeadersUtilities.cs +++ /dev/null @@ -1,60 +0,0 @@ -namespace Microsoft.ApplicationInsights.DependencyCollector.Implementation -{ - using System; - using System.Collections.Generic; - using System.Linq; - using System.Net.Http.Headers; - using Microsoft.ApplicationInsights.Common; - - internal static class HttpHeadersUtilities - { - internal static IEnumerable GetHeaderValues(HttpHeaders headers, string headerName) - { - IEnumerable result; - if (headers == null || !headers.TryGetValues(headerName, out result)) - { - result = Enumerable.Empty(); - } - - return result; - } - - internal static string GetHeaderKeyValue(HttpHeaders headers, string headerName, string keyName) - { - IEnumerable headerValues = GetHeaderValues(headers, headerName); - return HeadersUtilities.GetHeaderKeyValue(headerValues, keyName); - } - - internal static string GetRequestContextKeyValue(HttpHeaders headers, string keyName) - { - return GetHeaderKeyValue(headers, RequestResponseHeaders.RequestContextHeader, keyName); - } - - internal static bool ContainsHeaderKeyValue(HttpHeaders headers, string headerName, string keyName) - { - return !string.IsNullOrEmpty(GetHeaderKeyValue(headers, headerName, keyName)); - } - - internal static bool ContainsRequestContextKeyValue(HttpHeaders headers, string keyName) - { - return ContainsHeaderKeyValue(headers, RequestResponseHeaders.RequestContextHeader, keyName); - } - - internal static void SetRequestContextKeyValue(HttpHeaders headers, string keyName, string keyValue) - { - SetHeaderKeyValue(headers, RequestResponseHeaders.RequestContextHeader, keyName, keyValue); - } - - internal static void SetHeaderKeyValue(HttpHeaders headers, string headerName, string keyName, string keyValue) - { - if (headers == null) - { - throw new ArgumentNullException(nameof(headers)); - } - - IEnumerable headerValues = GetHeaderValues(headers, headerName); - headers.Remove(headerName); - headers.Add(headerName, HeadersUtilities.UpdateHeaderWithKeyValue(headerValues, keyName, keyValue)); - } - } -} diff --git a/WEB/Src/DependencyCollector/Shared/Implementation/HttpProcessingFramework.cs b/WEB/Src/DependencyCollector/Shared/Implementation/HttpProcessingFramework.cs deleted file mode 100644 index 5885d28a2a..0000000000 --- a/WEB/Src/DependencyCollector/Shared/Implementation/HttpProcessingFramework.cs +++ /dev/null @@ -1,119 +0,0 @@ -namespace Microsoft.ApplicationInsights.Extensibility.DependencyCollector.Implementation -{ - using System; - using System.Globalization; - using Microsoft.ApplicationInsights.Extensibility.Implementation.External; - using Microsoft.ApplicationInsights.Extensibility.Implementation.Tracing; - - internal class HttpProcessingFramework : BaseFrameworkProcessing - { - /// - /// Initializes a new instance of the class. - /// - internal HttpProcessingFramework(TelemetryClient client, TelemetryConfiguration configuration, ISamplingPolicy samplingPolicy = null) - : base(samplingPolicy) - { - if (client == null) - { - throw new ArgumentNullException("client"); - } - - if (configuration == null) - { - throw new ArgumentNullException("configuration"); - } - - this.telemetryClient = client; - this.telemetryConfiguration = configuration; - } - - #region Http callbacks - - /// - /// On begin callback from FX. - /// - /// This object. - /// URI of the web request. - public void OnBeginHttpCallback(long id, string uri) - { - if (!RddUtils.IsApplicationInsightsUrl(uri) && !string.IsNullOrEmpty(uri)) - { - this.OnBegin(id, uri); - } - } - - /// - /// On end callback from FX. - /// - /// The id. - /// The success to indicate if the dependency call completed successfully or not. - /// The synchronous flag to indicate if the dependency call was synchronous or not. - public void OnEndHttpCallback(long id, bool? success, bool? synchronous) - { - this.OnEnd(id, success, synchronous); - } - #endregion - - /// - /// Gets Dependency Kind for Resource. - /// - /// The Dependency Kind. - protected override RemoteDependencyKind GetDependencyKind() - { - return RemoteDependencyKind.Http; - } - - /// - /// Common helper for all Begin Callbacks. - /// - /// This object. - /// URI of the web request. - private void OnBegin(long id, string resourceName) - { - try - { - if (!this.RddCallCache.Contains(id)) - { - DependencyCollectorEventSource.Log.RemoteDependencyModuleVerbose("Http OnBegin id,url:" + id + resourceName); - DependencyCallOperation operation = this.Begin(resourceName, this.GetDependencyKind()); - - // The callback order is undefined. We use set to prevent collision from previous ids, - this.RddCallCache.Set(id, operation); - } - else - { - // Not logging as it will result in logging for every outbound AI calls - } - } -#pragma warning disable 0168 - catch (Exception exception) -#pragma warning restore 0168 - { - DependencyCollectorEventSource.Log.RemoteDependencyModuleError(string.Format(CultureInfo.InvariantCulture, "OnBeginHttp failed with {0}.", exception.ToInvariantString())); - } - } - - /// - /// Common helper for all End Callbacks. - /// - /// The id. - /// The success to indicate if the dependency call completed successfully or not. - /// The synchronous flag to indicate if the dependency call was synchronous or not. - private void OnEnd(long id, bool? success, bool? synchronous) - { - var operation = this.RddCallCache.Get(id); - if (operation != null) - { - operation.Telemetry.Async = !synchronous; - } - - DependencyCollectorEventSource.Log.RemoteDependencyModuleVerbose("Http OnEnd id:" + id); - - // Try to create if sampling this operation - this.TryCreateTelemetryAndSend(operation, success == null || (bool)success); - - // Remove the item from cache. - this.RddCallCache.Remove(id); - } - } -} diff --git a/WEB/Src/DependencyCollector/Shared/Implementation/PropertyFetcher.cs b/WEB/Src/DependencyCollector/Shared/Implementation/PropertyFetcher.cs deleted file mode 100644 index 2fe1ad9a1a..0000000000 --- a/WEB/Src/DependencyCollector/Shared/Implementation/PropertyFetcher.cs +++ /dev/null @@ -1,76 +0,0 @@ -namespace Microsoft.ApplicationInsights.DependencyCollector.Implementation -{ - using System; - using System.Reflection; - - /// - /// Efficient implementation of fetching properties of anonymous types with reflection. - /// - internal class PropertyFetcher - { - private readonly string propertyName; - private PropertyFetch innerFetcher; - - public PropertyFetcher(string propertyName) - { - this.propertyName = propertyName; - } - - public object Fetch(object obj) - { - if (this.innerFetcher == null) - { - this.innerFetcher = PropertyFetch.FetcherForProperty(obj.GetType().GetTypeInfo().GetDeclaredProperty(this.propertyName)); - } - - return this.innerFetcher?.Fetch(obj); - } - - // see https://github.com/dotnet/corefx/blob/master/src/System.Diagnostics.DiagnosticSource/src/System/Diagnostics/DiagnosticSourceEventSource.cs - private class PropertyFetch - { - /// - /// Create a property fetcher from a .NET Reflection PropertyInfo class that - /// represents a property of a particular type. - /// - public static PropertyFetch FetcherForProperty(PropertyInfo propertyInfo) - { - if (propertyInfo == null) - { - // returns null on any fetch. - return new PropertyFetch(); - } - - var typedPropertyFetcher = typeof(TypedFetchProperty<,>); - var instantiatedTypedPropertyFetcher = typedPropertyFetcher.GetTypeInfo().MakeGenericType( - propertyInfo.DeclaringType, propertyInfo.PropertyType); - return (PropertyFetch)Activator.CreateInstance(instantiatedTypedPropertyFetcher, propertyInfo); - } - - /// - /// Given an object, fetch the property that this propertyFetch represents. - /// - public virtual object Fetch(object obj) - { - return null; - } - - private class TypedFetchProperty : PropertyFetch - { - private readonly Func propertyFetch; - - public TypedFetchProperty(PropertyInfo property) - { - this.propertyFetch = - (Func) - property.GetMethod.CreateDelegate(typeof(Func)); - } - - public override object Fetch(object obj) - { - return this.propertyFetch((TObject)obj); - } - } - } - } -} diff --git a/WEB/Src/DependencyCollector/Shared/Implementation/SqlClientDiagnosticSourceListener.cs b/WEB/Src/DependencyCollector/Shared/Implementation/SqlClientDiagnosticSourceListener.cs deleted file mode 100644 index 987b3479a1..0000000000 --- a/WEB/Src/DependencyCollector/Shared/Implementation/SqlClientDiagnosticSourceListener.cs +++ /dev/null @@ -1,565 +0,0 @@ -namespace Microsoft.ApplicationInsights.DependencyCollector.Implementation -{ - using System; - using System.Collections.Generic; - using System.Data; - using System.Data.SqlClient; - using System.Diagnostics; - using System.Globalization; - - using Microsoft.ApplicationInsights.Common; - using Microsoft.ApplicationInsights.DataContracts; - using Microsoft.ApplicationInsights.DependencyCollector.Implementation.Operation; - using Microsoft.ApplicationInsights.Extensibility; - using Microsoft.ApplicationInsights.Extensibility.Implementation; - using Microsoft.ApplicationInsights.Extensibility.Implementation.Tracing; - using Microsoft.ApplicationInsights.Web.Implementation; - - internal class SqlClientDiagnosticSourceListener : IObserver>, IDisposable - { - // Event ids defined at: https://github.com/dotnet/corefx/blob/master/src/System.Data.SqlClient/src/System/Data/SqlClient/SqlClientDiagnosticListenerExtensions.cs - public const string DiagnosticListenerName = "SqlClientDiagnosticListener"; - - public const string SqlBeforeExecuteCommand = SqlClientPrefix + "WriteCommandBefore"; - public const string SqlAfterExecuteCommand = SqlClientPrefix + "WriteCommandAfter"; - public const string SqlErrorExecuteCommand = SqlClientPrefix + "WriteCommandError"; - - public const string SqlBeforeOpenConnection = SqlClientPrefix + "WriteConnectionOpenBefore"; - public const string SqlAfterOpenConnection = SqlClientPrefix + "WriteConnectionOpenAfter"; - public const string SqlErrorOpenConnection = SqlClientPrefix + "WriteConnectionOpenError"; - - public const string SqlBeforeCloseConnection = SqlClientPrefix + "WriteConnectionCloseBefore"; - public const string SqlAfterCloseConnection = SqlClientPrefix + "WriteConnectionCloseAfter"; - public const string SqlErrorCloseConnection = SqlClientPrefix + "WriteConnectionCloseError"; - - public const string SqlBeforeCommitTransaction = SqlClientPrefix + "WriteTransactionCommitBefore"; - public const string SqlAfterCommitTransaction = SqlClientPrefix + "WriteTransactionCommitAfter"; - public const string SqlErrorCommitTransaction = SqlClientPrefix + "WriteTransactionCommitError"; - - public const string SqlBeforeRollbackTransaction = SqlClientPrefix + "WriteTransactionRollbackBefore"; - public const string SqlAfterRollbackTransaction = SqlClientPrefix + "WriteTransactionRollbackAfter"; - public const string SqlErrorRollbackTransaction = SqlClientPrefix + "WriteTransactionRollbackError"; - - private const string SqlClientPrefix = "System.Data.SqlClient."; - - private readonly TelemetryClient client; - private readonly SqlClientDiagnosticSourceSubscriber subscriber; - - private readonly ObjectInstanceBasedOperationHolder operationHolder = new ObjectInstanceBasedOperationHolder(); - - public SqlClientDiagnosticSourceListener(TelemetryConfiguration configuration) - { - this.client = new TelemetryClient(configuration); - this.client.Context.GetInternalContext().SdkVersion = - SdkVersionUtils.GetSdkVersion("rdd" + RddSource.DiagnosticSourceCore + ":"); - - this.subscriber = new SqlClientDiagnosticSourceSubscriber(this); - } - - public void Dispose() - { - if (this.subscriber != null) - { - this.subscriber.Dispose(); - } - } - - void IObserver>.OnCompleted() - { - } - - void IObserver>.OnError(Exception error) - { - } - - void IObserver>.OnNext(KeyValuePair evnt) - { - try - { - switch (evnt.Key) - { - case SqlBeforeExecuteCommand: - { - var operationId = (Guid)CommandBefore.OperationId.Fetch(evnt.Value); - - DependencyCollectorEventSource.Log.SqlClientDiagnosticSubscriberCallbackCalled(operationId, evnt.Key); - - var command = (SqlCommand)CommandBefore.Command.Fetch(evnt.Value); - - if (this.operationHolder.Get(command) == null) - { - var dependencyName = string.Empty; - var target = string.Empty; - - if (command.Connection != null) - { - target = string.Join(" | ", command.Connection.DataSource, command.Connection.Database); - - var commandName = command.CommandType == CommandType.StoredProcedure - ? command.CommandText - : string.Empty; - - dependencyName = string.IsNullOrEmpty(commandName) - ? string.Join(" | ", command.Connection.DataSource, command.Connection.Database) - : string.Join(" | ", command.Connection.DataSource, command.Connection.Database, commandName); - } - - var timestamp = CommandBefore.Timestamp.Fetch(evnt.Value) as long? - ?? Stopwatch.GetTimestamp(); // TODO corefx#20748 - timestamp missing from event data - - var telemetry = new DependencyTelemetry() - { - Id = operationId.ToString("N"), - Name = dependencyName, - Type = RemoteDependencyConstants.SQL, - Target = target, - Data = command.CommandText, - Success = true - }; - - InitializeTelemetry(telemetry, operationId, timestamp); - - this.operationHolder.Store(command, Tuple.Create(telemetry, /* isCustomCreated: */ false)); - } - else - { - DependencyCollectorEventSource.Log.TrackingAnExistingTelemetryItemVerbose(); - } - - break; - } - - case SqlAfterExecuteCommand: - { - var operationId = (Guid)CommandAfter.OperationId.Fetch(evnt.Value); - - DependencyCollectorEventSource.Log.SqlClientDiagnosticSubscriberCallbackCalled(operationId, evnt.Key); - - var command = (SqlCommand)CommandAfter.Command.Fetch(evnt.Value); - var tuple = this.operationHolder.Get(command); - - if (tuple != null) - { - this.operationHolder.Remove(command); - - var telemetry = tuple.Item1; - - var timestamp = (long)CommandAfter.Timestamp.Fetch(evnt.Value); - - telemetry.Stop(timestamp); - - this.client.Track(telemetry); - } - else - { - DependencyCollectorEventSource.Log.EndCallbackWithNoBegin(operationId.ToString("N")); - } - - break; - } - - case SqlErrorExecuteCommand: - { - var operationId = (Guid)CommandError.OperationId.Fetch(evnt.Value); - - DependencyCollectorEventSource.Log.SqlClientDiagnosticSubscriberCallbackCalled(operationId, evnt.Key); - - var command = (SqlCommand)CommandError.Command.Fetch(evnt.Value); - var tuple = this.operationHolder.Get(command); - - if (tuple != null) - { - this.operationHolder.Remove(command); - - var telemetry = tuple.Item1; - - var timestamp = (long)CommandError.Timestamp.Fetch(evnt.Value); - - telemetry.Stop(timestamp); - - var exception = (Exception)CommandError.Exception.Fetch(evnt.Value); - - ConfigureExceptionTelemetry(telemetry, exception); - - this.client.Track(telemetry); - } - else - { - DependencyCollectorEventSource.Log.EndCallbackWithNoBegin(operationId.ToString("N")); - } - - break; - } - - case SqlBeforeOpenConnection: - { - var operationId = (Guid)ConnectionBefore.OperationId.Fetch(evnt.Value); - - DependencyCollectorEventSource.Log.SqlClientDiagnosticSubscriberCallbackCalled(operationId, evnt.Key); - - var connection = (SqlConnection)ConnectionBefore.Connection.Fetch(evnt.Value); - - if (this.operationHolder.Get(connection) == null) - { - var operation = (string)ConnectionBefore.Operation.Fetch(evnt.Value); - var timestamp = (long)ConnectionBefore.Timestamp.Fetch(evnt.Value); - - var telemetry = new DependencyTelemetry() - { - Id = operationId.ToString("N"), - Name = string.Join(" | ", connection.DataSource, connection.Database, operation), - Type = RemoteDependencyConstants.SQL, - Target = string.Join(" | ", connection.DataSource, connection.Database), - Data = operation, - Success = true - }; - - InitializeTelemetry(telemetry, operationId, timestamp); - - this.operationHolder.Store(connection, Tuple.Create(telemetry, /* isCustomCreated: */ false)); - } - else - { - DependencyCollectorEventSource.Log.TrackingAnExistingTelemetryItemVerbose(); - } - - break; - } - - case SqlAfterOpenConnection: - { - var operationId = (Guid)ConnectionAfter.OperationId.Fetch(evnt.Value); - - DependencyCollectorEventSource.Log.SqlClientDiagnosticSubscriberCallbackCalled(operationId, evnt.Key); - - var connection = (SqlConnection)ConnectionAfter.Connection.Fetch(evnt.Value); - var tuple = this.operationHolder.Get(connection); - - if (tuple != null) - { - this.operationHolder.Remove(connection); - } - else - { - DependencyCollectorEventSource.Log.EndCallbackWithNoBegin(operationId.ToString("N")); - } - - break; - } - - case SqlErrorOpenConnection: - { - var operationId = (Guid)ConnectionError.OperationId.Fetch(evnt.Value); - - DependencyCollectorEventSource.Log.SqlClientDiagnosticSubscriberCallbackCalled(operationId, evnt.Key); - - var connection = (SqlConnection)ConnectionError.Connection.Fetch(evnt.Value); - var tuple = this.operationHolder.Get(connection); - - if (tuple != null) - { - this.operationHolder.Remove(connection); - - var telemetry = tuple.Item1; - - var timestamp = (long)ConnectionError.Timestamp.Fetch(evnt.Value); - - telemetry.Stop(timestamp); - - var exception = (Exception)ConnectionError.Exception.Fetch(evnt.Value); - - ConfigureExceptionTelemetry(telemetry, exception); - - this.client.Track(telemetry); - } - else - { - DependencyCollectorEventSource.Log.EndCallbackWithNoBegin(operationId.ToString("N")); - } - - break; - } - - case SqlBeforeCommitTransaction: - case SqlBeforeRollbackTransaction: - { - var operationId = (Guid)TransactionBefore.OperationId.Fetch(evnt.Value); - - DependencyCollectorEventSource.Log.SqlClientDiagnosticSubscriberCallbackCalled(operationId, evnt.Key); - - var connection = (SqlConnection)TransactionBefore.Connection.Fetch(evnt.Value); - - if (this.operationHolder.Get(connection) == null) - { - var operation = (string)TransactionBefore.Operation.Fetch(evnt.Value); - var timestamp = (long)TransactionBefore.Timestamp.Fetch(evnt.Value); - var isolationLevel = (IsolationLevel)TransactionBefore.IsolationLevel.Fetch(evnt.Value); - - var telemetry = new DependencyTelemetry() - { - Id = operationId.ToString("N"), - Name = string.Join(" | ", connection.DataSource, connection.Database, operation, isolationLevel), - Type = RemoteDependencyConstants.SQL, - Target = string.Join(" | ", connection.DataSource, connection.Database), - Data = operation, - Success = true - }; - - InitializeTelemetry(telemetry, operationId, timestamp); - - this.operationHolder.Store(connection, Tuple.Create(telemetry, /* isCustomCreated: */ false)); - } - else - { - DependencyCollectorEventSource.Log.TrackingAnExistingTelemetryItemVerbose(); - } - - break; - } - - case SqlAfterCommitTransaction: - case SqlAfterRollbackTransaction: - { - var operationId = (Guid)TransactionAfter.OperationId.Fetch(evnt.Value); - - DependencyCollectorEventSource.Log.SqlClientDiagnosticSubscriberCallbackCalled(operationId, evnt.Key); - - var connection = (SqlConnection)TransactionAfter.Connection.Fetch(evnt.Value); - var tuple = this.operationHolder.Get(connection); - - if (tuple != null) - { - this.operationHolder.Remove(connection); - - var telemetry = tuple.Item1; - - var timestamp = (long)TransactionAfter.Timestamp.Fetch(evnt.Value); - - telemetry.Stop(timestamp); - - this.client.Track(telemetry); - } - else - { - DependencyCollectorEventSource.Log.EndCallbackWithNoBegin(operationId.ToString("N")); - } - - break; - } - - case SqlErrorCommitTransaction: - case SqlErrorRollbackTransaction: - { - var operationId = (Guid)TransactionError.OperationId.Fetch(evnt.Value); - - DependencyCollectorEventSource.Log.SqlClientDiagnosticSubscriberCallbackCalled(operationId, evnt.Key); - - var connection = (SqlConnection)TransactionError.Connection.Fetch(evnt.Value); - var tuple = this.operationHolder.Get(connection); - - if (tuple != null) - { - this.operationHolder.Remove(connection); - - var telemetry = tuple.Item1; - - var timestamp = (long)TransactionError.Timestamp.Fetch(evnt.Value); - - telemetry.Stop(timestamp); - - var exception = (Exception)TransactionError.Exception.Fetch(evnt.Value); - - ConfigureExceptionTelemetry(telemetry, exception); - - this.client.Track(telemetry); - } - else - { - DependencyCollectorEventSource.Log.EndCallbackWithNoBegin(operationId.ToString("N")); - } - - break; - } - } - } - catch (Exception ex) - { - DependencyCollectorEventSource.Log - .SqlClientDiagnosticSourceListenerOnNextFailed(ExceptionUtilities.GetExceptionDetailString(ex)); - } - } - - private static void InitializeTelemetry(DependencyTelemetry telemetry, Guid operationId, long timestamp) - { - telemetry.Start(timestamp); - - var activity = Activity.Current; - - if (activity != null) - { - telemetry.Context.Operation.Id = activity.RootId; - telemetry.Context.Operation.ParentId = activity.ParentId; - - foreach (var item in activity.Baggage) - { - if (!telemetry.Context.Properties.ContainsKey(item.Key)) - { - telemetry.Context.Properties[item.Key] = item.Value; - } - } - } - else - { - telemetry.Context.Operation.Id = operationId.ToString("N"); - } - } - - private static void ConfigureExceptionTelemetry(DependencyTelemetry telemetry, Exception exception) - { - telemetry.Success = false; - telemetry.Properties["Exception"] = exception.ToInvariantString(); - - var sqlException = exception as SqlException; - - if (sqlException != null) - { - telemetry.ResultCode = sqlException.Number.ToString(CultureInfo.InvariantCulture); - } - } - - #region Fetchers - - // Fetchers for execute command before event - private static class CommandBefore - { - public static readonly PropertyFetcher OperationId = new PropertyFetcher(nameof(OperationId)); - public static readonly PropertyFetcher Command = new PropertyFetcher(nameof(Command)); - public static readonly PropertyFetcher Timestamp = new PropertyFetcher(nameof(Timestamp)); - } - - // Fetchers for execute command after event - private static class CommandAfter - { - public static readonly PropertyFetcher OperationId = new PropertyFetcher(nameof(OperationId)); - public static readonly PropertyFetcher Command = new PropertyFetcher(nameof(Command)); - public static readonly PropertyFetcher Timestamp = new PropertyFetcher(nameof(Timestamp)); - } - - // Fetchers for execute command error event - private static class CommandError - { - public static readonly PropertyFetcher OperationId = new PropertyFetcher(nameof(OperationId)); - public static readonly PropertyFetcher Command = new PropertyFetcher(nameof(Command)); - public static readonly PropertyFetcher Exception = new PropertyFetcher(nameof(Exception)); - public static readonly PropertyFetcher Timestamp = new PropertyFetcher(nameof(Timestamp)); - } - - // Fetchers for connection open/close before events - private static class ConnectionBefore - { - public static readonly PropertyFetcher OperationId = new PropertyFetcher(nameof(OperationId)); - public static readonly PropertyFetcher Operation = new PropertyFetcher(nameof(Operation)); - public static readonly PropertyFetcher Connection = new PropertyFetcher(nameof(Connection)); - public static readonly PropertyFetcher Timestamp = new PropertyFetcher(nameof(Timestamp)); - } - - // Fetchers for connection open/close after events - private static class ConnectionAfter - { - public static readonly PropertyFetcher OperationId = new PropertyFetcher(nameof(OperationId)); - public static readonly PropertyFetcher Connection = new PropertyFetcher(nameof(Connection)); - } - - // Fetchers for connection open/close error events - private static class ConnectionError - { - public static readonly PropertyFetcher OperationId = new PropertyFetcher(nameof(OperationId)); - public static readonly PropertyFetcher Connection = new PropertyFetcher(nameof(Connection)); - public static readonly PropertyFetcher Exception = new PropertyFetcher(nameof(Exception)); - public static readonly PropertyFetcher Timestamp = new PropertyFetcher(nameof(Timestamp)); - } - - // Fetchers for transaction commit/rollback before events - private static class TransactionBefore - { - public static readonly PropertyFetcher OperationId = new PropertyFetcher(nameof(OperationId)); - public static readonly PropertyFetcher Operation = new PropertyFetcher(nameof(Operation)); - public static readonly PropertyFetcher IsolationLevel = new PropertyFetcher(nameof(IsolationLevel)); - public static readonly PropertyFetcher Connection = new PropertyFetcher(nameof(Connection)); - public static readonly PropertyFetcher Timestamp = new PropertyFetcher(nameof(Timestamp)); - } - - // Fetchers for transaction commit/rollback after events - private static class TransactionAfter - { - public static readonly PropertyFetcher OperationId = new PropertyFetcher(nameof(OperationId)); - public static readonly PropertyFetcher Connection = new PropertyFetcher(nameof(Connection)); - public static readonly PropertyFetcher Timestamp = new PropertyFetcher(nameof(Timestamp)); - } - - // Fetchers for transaction commit/rollback error events - private static class TransactionError - { - public static readonly PropertyFetcher OperationId = new PropertyFetcher(nameof(OperationId)); - public static readonly PropertyFetcher Connection = new PropertyFetcher(nameof(Connection)); - public static readonly PropertyFetcher Exception = new PropertyFetcher(nameof(Exception)); - public static readonly PropertyFetcher Timestamp = new PropertyFetcher(nameof(Timestamp)); - } - - #endregion - - private sealed class SqlClientDiagnosticSourceSubscriber : IObserver, IDisposable - { - private readonly SqlClientDiagnosticSourceListener sqlDiagnosticListener; - private readonly IDisposable listenerSubscription; - - private IDisposable eventSubscription; - - internal SqlClientDiagnosticSourceSubscriber(SqlClientDiagnosticSourceListener listener) - { - this.sqlDiagnosticListener = listener; - - try - { - this.listenerSubscription = DiagnosticListener.AllListeners.Subscribe(this); - } - catch (Exception ex) - { - DependencyCollectorEventSource.Log.SqlClientDiagnosticSubscriberFailedToSubscribe(ex.ToInvariantString()); - } - } - - public void OnNext(DiagnosticListener value) - { - if (value != null) - { - if (value.Name == DiagnosticListenerName) - { - this.eventSubscription = value.Subscribe(this.sqlDiagnosticListener); - } - } - } - - public void OnCompleted() - { - } - - public void OnError(Exception error) - { - } - - public void Dispose() - { - if (this.eventSubscription != null) - { - this.eventSubscription.Dispose(); - } - - if (this.listenerSubscription != null) - { - this.listenerSubscription.Dispose(); - } - } - } - } -} \ No newline at end of file diff --git a/WEB/Src/EventCounterCollector/EventCounterCollector.Tests/EventCounterCollector.Tests/EventCounterCollectionModuleTests.cs b/WEB/Src/EventCounterCollector/EventCounterCollector.Tests/EventCounterCollector.Tests/EventCounterCollectionModuleTests.cs index c0a21a74a1..d0654654e0 100644 --- a/WEB/Src/EventCounterCollector/EventCounterCollector.Tests/EventCounterCollector.Tests/EventCounterCollectionModuleTests.cs +++ b/WEB/Src/EventCounterCollector/EventCounterCollector.Tests/EventCounterCollector.Tests/EventCounterCollectionModuleTests.cs @@ -7,6 +7,7 @@ using Microsoft.ApplicationInsights.Extensibility.EventCounterCollector.Implementation; using Microsoft.ApplicationInsights.Extensibility.Implementation; using Microsoft.VisualStudio.TestTools.UnitTesting; +using System; using System.Collections.Concurrent; using System.Collections.Generic; using System.Diagnostics; @@ -69,6 +70,7 @@ public void ValidateSingleEventCounterCollection() const int refreshTimeInSecs = 1; ConcurrentQueue itemsReceived = new ConcurrentQueue(); string expectedName = this.TestEventCounterSourceName + "|" + this.TestEventCounterName1; + string expectedMetricNamespace = String.Empty; double expectedMetricValue = (1000 + 1500 + 1500 + 400) / 4; int expectedMetricCount = 4; @@ -90,7 +92,7 @@ public void ValidateSingleEventCounterCollection() PrintTelemetryItems(itemsReceived); // VALIDATE - ValidateTelemetry(itemsReceived, expectedName, expectedMetricValue, expectedMetricCount); + ValidateTelemetry(itemsReceived, expectedName, expectedMetricNamespace, expectedMetricValue, expectedMetricCount); // Clear the items. Trace.WriteLine("Clearing items received."); @@ -101,11 +103,43 @@ public void ValidateSingleEventCounterCollection() Task.Delay(((int)refreshTimeInSecs * 1000)).Wait(); Assert.IsTrue(itemsReceived.Count >= 1); PrintTelemetryItems(itemsReceived); - ValidateTelemetry(itemsReceived, expectedName, 0.0, 0); + ValidateTelemetry(itemsReceived, expectedName, expectedMetricNamespace, 0.0, 0); } } - private void ValidateTelemetry(ConcurrentQueue metricTelemetries, string expectedName, double expectedSum, double expectedCount) + [TestMethod] + [TestCategory("EventCounter")] + public void ValidateConfiguredNamingOptions() + { + // ARRANGE + const int refreshTimeInSecs = 1; + ConcurrentQueue itemsReceived = new ConcurrentQueue(); + string expectedName = this.TestEventCounterName1; + string expectedMetricNamespace = this.TestEventCounterSourceName; + double expectedMetricValue = 1000; + int expectedMetricCount = 1; + + using (var module = new EventCounterCollectionModule(refreshTimeInSecs)) + { + module.UseEventSourceNameAsMetricsNamespace = true; + module.Counters.Add(new EventCounterCollectionRequest() { EventSourceName = this.TestEventCounterSourceName, EventCounterName = this.TestEventCounterName1 }); + module.Initialize(GetTestTelemetryConfiguration(itemsReceived)); + + // ACT + // Making a call with 1000 + TestEventCounter.Log.SampleCounter1(1000); + + // Wait at least for refresh time. + Task.Delay(((int)refreshTimeInSecs * 1000) + 500).Wait(); + + PrintTelemetryItems(itemsReceived); + + // VALIDATE + ValidateTelemetry(itemsReceived, expectedName, expectedMetricNamespace, expectedMetricValue, expectedMetricCount); + } + } + + private void ValidateTelemetry(ConcurrentQueue metricTelemetries, string expectedName, string expectedMetricNamespace, double expectedSum, double expectedCount) { double sum = 0.0; int count = 0; @@ -118,6 +152,7 @@ private void ValidateTelemetry(ConcurrentQueue metricTelemetries, st Assert.IsTrue(metricTelemetry.Context.GetInternalContext().SdkVersion.StartsWith("evtc")); Assert.AreEqual(expectedName, metricTelemetry.Name); + Assert.AreEqual(expectedMetricNamespace, metricTelemetry.MetricNamespace); Assert.IsFalse((telemetry as ISupportProperties).Properties.ContainsKey("CustomPerfCounter")); } @@ -133,6 +168,7 @@ private void PrintTelemetryItems(ConcurrentQueue telemetry) if (item is MetricTelemetry metric) { Trace.WriteLine("Metric.Name:" + metric.Name); + Trace.WriteLine("Metric.MetricNamespace:" + metric.MetricNamespace); Trace.WriteLine("Metric.Sum:" + metric.Sum); Trace.WriteLine("Metric.Count:" + metric.Count); Trace.WriteLine("Metric.Timestamp:" + metric.Timestamp); diff --git a/WEB/Src/EventCounterCollector/EventCounterCollector.Tests/EventCounterCollector.Tests/EventCounterCollector.Tests.csproj b/WEB/Src/EventCounterCollector/EventCounterCollector.Tests/EventCounterCollector.Tests/EventCounterCollector.Tests.csproj index 2b22c3bfc7..9e6d9e0cb0 100644 --- a/WEB/Src/EventCounterCollector/EventCounterCollector.Tests/EventCounterCollector.Tests/EventCounterCollector.Tests.csproj +++ b/WEB/Src/EventCounterCollector/EventCounterCollector.Tests/EventCounterCollector.Tests/EventCounterCollector.Tests.csproj @@ -5,15 +5,15 @@ - netcoreapp2.1 + netcoreapp2.1;netcoreapp3.1 Microsoft.AI.EventCounterCollector.Tests false - - + + diff --git a/WEB/Src/EventCounterCollector/EventCounterCollector/EventCounterCollectionModule.cs b/WEB/Src/EventCounterCollector/EventCounterCollector/EventCounterCollectionModule.cs index 386e7e5907..03ef3ba7bb 100644 --- a/WEB/Src/EventCounterCollector/EventCounterCollector/EventCounterCollectionModule.cs +++ b/WEB/Src/EventCounterCollector/EventCounterCollector/EventCounterCollectionModule.cs @@ -49,6 +49,11 @@ internal EventCounterCollectionModule(int refreshIntervalInSecs) : this() /// public IList Counters { get; private set; } + /// + /// Gets or sets a value indicating whether the eventsource name and metric name are stored separately. + /// + public bool UseEventSourceNameAsMetricsNamespace { get; set; } + /// /// IDisposable implementation. /// @@ -76,7 +81,7 @@ public void Initialize(TelemetryConfiguration configuration) this.client = new TelemetryClient(configuration); this.client.Context.GetInternalContext().SdkVersion = SdkVersionUtils.GetSdkVersion("evtc:"); - this.eventCounterListener = new EventCounterListener(this.client, this.Counters, this.refreshInternalInSecs); + this.eventCounterListener = new EventCounterListener(this.client, this.Counters, this.refreshInternalInSecs, this.UseEventSourceNameAsMetricsNamespace); this.isInitialized = true; EventCounterCollectorEventSource.Log.ModuleInitializedSuccess(); } diff --git a/WEB/Src/EventCounterCollector/EventCounterCollector/EventCounterCollector.csproj b/WEB/Src/EventCounterCollector/EventCounterCollector/EventCounterCollector.csproj index 1fdd1ab719..41b21c0298 100644 --- a/WEB/Src/EventCounterCollector/EventCounterCollector/EventCounterCollector.csproj +++ b/WEB/Src/EventCounterCollector/EventCounterCollector/EventCounterCollector.csproj @@ -28,6 +28,9 @@ All + + All + @@ -42,6 +45,11 @@ + + + + + - + \ No newline at end of file diff --git a/WEB/Src/EventCounterCollector/EventCounterCollector/EventCounterListener.cs b/WEB/Src/EventCounterCollector/EventCounterCollector/EventCounterListener.cs index ec262e172b..5f89ea4d40 100644 --- a/WEB/Src/EventCounterCollector/EventCounterCollector/EventCounterListener.cs +++ b/WEB/Src/EventCounterCollector/EventCounterCollector/EventCounterListener.cs @@ -18,6 +18,7 @@ internal class EventCounterListener : EventListener private readonly int refreshInternalInSecInt; private readonly EventLevel level = EventLevel.Critical; private bool isInitialized = false; + private bool useEventSourceNameAsMetricsNamespace = false; private TelemetryClient telemetryClient; private Dictionary refreshIntervalDictionary; @@ -29,7 +30,7 @@ internal class EventCounterListener : EventListener // The value will be the corresponding ICollection of counter names. private IDictionary> countersToCollect = new Dictionary>(); - public EventCounterListener(TelemetryClient telemetryClient, IList eventCounterCollectionRequests, int refreshIntervalSecs) + public EventCounterListener(TelemetryClient telemetryClient, IList eventCounterCollectionRequests, int refreshIntervalSecs, bool useEventSourceNameAsMetricsNamespace) { try { @@ -38,6 +39,8 @@ public EventCounterListener(TelemetryClient telemetryClient, IList(); this.refreshIntervalDictionary.Add("EventCounterIntervalSec", this.refreshIntervalInSecs); + this.useEventSourceNameAsMetricsNamespace = useEventSourceNameAsMetricsNamespace; + this.telemetryClient = telemetryClient; foreach (var collectionRequest in eventCounterCollectionRequests) @@ -240,7 +243,16 @@ private void ExtractAndPostMetric(string eventSourceName, IDictionary - - - - - Debug - AnyCPU - {9AB6BDFD-253C-4C97-8BB8-7234ADFCB601} - Library - Properties - Microsoft.ApplicationInsights.HostingStartup.Net45.Tests - Microsoft.ApplicationInsights.HostingStartup.Net45.Tests - v4.5 - 512 - {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 15.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages - False - UnitTest - ..\..\ - - - - $(DefineConstants);NET45 - - - - fakesAssemblyForBuild\Microsoft.QualityTools.Testing.Fakes.dll - - - - - ..\..\..\..\..\packages\System.Buffers.4.5.1\lib\netstandard1.1\System.Buffers.dll - - - ..\..\..\..\..\packages\System.Diagnostics.DiagnosticSource.4.6.0\lib\net45\System.Diagnostics.DiagnosticSource.dll - - - ..\..\..\..\..\packages\System.Memory.4.5.4\lib\netstandard1.1\System.Memory.dll - - - - ..\..\..\..\..\packages\System.Runtime.CompilerServices.Unsafe.4.5.3\lib\netstandard1.0\System.Runtime.CompilerServices.Unsafe.dll - - - - - - - - - Designer - - - - - - - - - - {e3d160e8-7f8c-416f-946f-6fdfc6787461} - Microsoft.ApplicationInsights - - - {80f0481a-66c7-4442-96d3-5fd841132c4b} - HostingStartup - - - - - - - False - - - False - - - False - - - False - - - - - - - \ No newline at end of file diff --git a/WEB/Src/HostingStartup/HostingStartup.Net45.Tests/app.config b/WEB/Src/HostingStartup/HostingStartup.Net45.Tests/app.config deleted file mode 100644 index 249e3239f6..0000000000 --- a/WEB/Src/HostingStartup/HostingStartup.Net45.Tests/app.config +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/WEB/Src/HostingStartup/HostingStartup.Net45.Tests/ClassWithFailingStaticConstructor.cs b/WEB/Src/HostingStartup/HostingStartup.Tests/ClassWithFailingStaticConstructor.cs similarity index 100% rename from WEB/Src/HostingStartup/HostingStartup.Net45.Tests/ClassWithFailingStaticConstructor.cs rename to WEB/Src/HostingStartup/HostingStartup.Tests/ClassWithFailingStaticConstructor.cs diff --git a/WEB/Src/HostingStartup/HostingStartup.Net45.Tests/GlobalSuppressions.cs b/WEB/Src/HostingStartup/HostingStartup.Tests/GlobalSuppressions.cs similarity index 100% rename from WEB/Src/HostingStartup/HostingStartup.Net45.Tests/GlobalSuppressions.cs rename to WEB/Src/HostingStartup/HostingStartup.Tests/GlobalSuppressions.cs diff --git a/WEB/Src/HostingStartup/HostingStartup.Tests/HostingStartup.Tests.csproj b/WEB/Src/HostingStartup/HostingStartup.Tests/HostingStartup.Tests.csproj new file mode 100644 index 0000000000..ebc4191675 --- /dev/null +++ b/WEB/Src/HostingStartup/HostingStartup.Tests/HostingStartup.Tests.csproj @@ -0,0 +1,32 @@ + + + + Microsoft.ApplicationInsights.HostingStartup.Tests + Microsoft.ApplicationInsights.HostingStartup.Tests + net45 + false + false + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/WEB/Src/HostingStartup/HostingStartup.Tests/Properties/AssemblyInfo.cs b/WEB/Src/HostingStartup/HostingStartup.Tests/Properties/AssemblyInfo.cs new file mode 100644 index 0000000000..305bc43c41 --- /dev/null +++ b/WEB/Src/HostingStartup/HostingStartup.Tests/Properties/AssemblyInfo.cs @@ -0,0 +1,43 @@ +// ----------------------------------------------------------------------- +// +// Copyright (c) Microsoft Corporation. +// All rights reserved. 2013 +// +// ----------------------------------------------------------------------- + +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("HostingStartup.Tests")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("HostingStartup.Tests")] +[assembly: AssemblyCopyright("Copyright © 2015")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("8e16d10d-0483-429c-bbf1-3627e8ccc43b")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +// [assembly: AssemblyVersion("1.0.0.0")] +// [assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/WEB/Src/HostingStartup/HostingStartup.Net45.Tests/WebRequestTrackingModuleRegisterTest.cs b/WEB/Src/HostingStartup/HostingStartup.Tests/WebRequestTrackingModuleRegisterTest.cs similarity index 100% rename from WEB/Src/HostingStartup/HostingStartup.Net45.Tests/WebRequestTrackingModuleRegisterTest.cs rename to WEB/Src/HostingStartup/HostingStartup.Tests/WebRequestTrackingModuleRegisterTest.cs diff --git a/WEB/Src/HostingStartup/HostingStartup.Net45.Tests/packages.config b/WEB/Src/HostingStartup/HostingStartup.Tests/packages.config similarity index 100% rename from WEB/Src/HostingStartup/HostingStartup.Net45.Tests/packages.config rename to WEB/Src/HostingStartup/HostingStartup.Tests/packages.config diff --git a/WEB/Src/HostingStartup/HostingStartup/HostingStartup.csproj b/WEB/Src/HostingStartup/HostingStartup/HostingStartup.csproj index fd7aab3f78..899a4ebddc 100644 --- a/WEB/Src/HostingStartup/HostingStartup/HostingStartup.csproj +++ b/WEB/Src/HostingStartup/HostingStartup/HostingStartup.csproj @@ -30,6 +30,9 @@ All + + All + @@ -44,7 +47,8 @@ - + + @@ -58,9 +62,14 @@ - + + + + + + - + \ No newline at end of file diff --git a/WEB/Src/Microsoft.ApplicationInsights.Web.sln b/WEB/Src/Microsoft.ApplicationInsights.Web.sln index 9235a90661..1e27ee195f 100644 --- a/WEB/Src/Microsoft.ApplicationInsights.Web.sln +++ b/WEB/Src/Microsoft.ApplicationInsights.Web.sln @@ -5,8 +5,6 @@ VisualStudioVersion = 16.0.29102.190 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Web", "Web", "{1A75535C-B8E5-4C31-BC6E-50456C8C4052}" EndProject -Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Web.Shared", "Web\Web.Shared.Net\Web.Shared.shproj", "{395E03BB-D061-4C9D-9D47-18676566444D}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "TestFramework", "TestFramework", "{8CA9F9C9-DA39-4159-86F3-C52F1636715E}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DependencyCollector", "DependencyCollector", "{DF56FBAD-8745-404B-94A1-E83BFC4AD7CB}" @@ -16,20 +14,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "DependencyCollector", "Depe EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "WindowsServer", "WindowsServer", "{D87119AF-CD35-46F2-84A6-ED54CC42027E}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WindowsServer.Net45.Tests", "WindowsServer\WindowsServer.Net45.Tests\WindowsServer.Net45.Tests.csproj", "{F05EB480-B209-47DD-90E3-1DDC47EFC579}" -EndProject -Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "WindowsServer.Shared", "WindowsServer\WindowsServer.Shared\WindowsServer.Shared.shproj", "{579F42E8-B711-411E-BE52-4A3FD208507F}" -EndProject -Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "WindowsServer.Shared.Tests", "WindowsServer\WindowsServer.Shared.Tests\WindowsServer.Shared.Tests.shproj", "{7916AE39-AE89-4886-8842-33AC9883905A}" -EndProject -Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "DependencyCollector.Shared", "DependencyCollector\Shared\DependencyCollector.Shared.shproj", "{669E7E58-072D-4B0A-A4DD-4EB2AE2EA4D4}" -EndProject Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "DependencyCollector.Shared.Tests", "DependencyCollector\Shared.Tests\DependencyCollector.Shared.Tests.shproj", "{ACE58393-3419-4FCA-87CC-C33EB756C7E4}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Web.Net45.Tests", "Web\Web.Net45.Tests\Web.Net45.Tests.csproj", "{F71138BB-B3F8-4767-B394-857B0776038E}" -EndProject -Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Web.Shared.Net.Tests", "Web\Web.Shared.Net.Tests\Web.Shared.Net.Tests.shproj", "{AC2E85BB-05F7-43CB-B966-3611CCF47156}" -EndProject Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "TestFramework.Shared.Web", "TestFramework\Shared\TestFramework.Shared.Web.shproj", "{9718F051-147F-4F5F-9FF3-C926430EFCF7}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "PerformanceCollector", "PerformanceCollector", "{A318CC6C-51C8-4BD6-BC85-2B4F35123BE7}" @@ -51,8 +37,6 @@ Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Common.Web", "Common\Common EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "HostingStartup", "HostingStartup", "{701D2D4F-B581-45A2-AF29-4F34EC5F047B}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HostingStartup.Net45.Tests", "HostingStartup\HostingStartup.Net45.Tests\HostingStartup.Net45.Tests.csproj", "{9AB6BDFD-253C-4C97-8BB8-7234ADFCB601}" -EndProject Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Perf.Shared", "PerformanceCollector\Perf.Shared\Perf.Shared.shproj", "{A78F50D4-F518-4DCB-878B-526FD54CCA35}" EndProject Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Filtering.Shared", "PerformanceCollector\Filtering.Shared\Filtering.Shared.shproj", "{568AEB4F-BA4C-47A5-9FA3-68F06CD11FED}" @@ -61,8 +45,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Perf.NetCore.Tests", "Perfo EndProject Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Perf.Shared.Tests", "PerformanceCollector\Perf.Shared.Tests\Perf.Shared.Tests.shproj", "{9B524BD3-682D-4B6F-9251-D4B2911DF0FD}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WindowsServer.NetCore.Tests", "WindowsServer\WindowsServer.NetCore.Tests\WindowsServer.NetCore.Tests.csproj", "{003691E1-D908-4F29-A9AA-8A98C878F951}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HostingStartup", "HostingStartup\HostingStartup\HostingStartup.csproj", "{80F0481A-66C7-4442-96D3-5FD841132C4B}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WindowsServer", "WindowsServer\WindowsServer\WindowsServer.csproj", "{94127FD9-E516-4891-98D4-EF7523117F32}" @@ -99,10 +81,14 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DependencyCollector.Tests", EndProject Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Perf.Shared.NetFull", "PerformanceCollector\Perf.Shared.NetFull\Perf.Shared.NetFull.shproj", "{0196259C-3582-4F4E-A01F-A8F9AE83B0F3}" EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HostingStartup.Tests", "HostingStartup\HostingStartup.Tests\HostingStartup.Tests.csproj", "{7592A20A-1775-4479-B624-7275173E9821}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Web.Tests", "Web\Web.Tests\Web.Tests.csproj", "{1231D63B-E7FA-4BA7-9916-FA7325DB936D}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WindowsServer.Tests", "WindowsServer\WindowsServer.Tests\WindowsServer.Tests.csproj", "{CAF98D8B-9202-4CC3-83EC-C384D8EEA792}" +EndProject Global GlobalSection(SharedMSBuildProjectFiles) = preSolution - TestFramework\Shared\TestFramework.Shared.projitems*{003691e1-d908-4f29-a9aa-8a98c878f951}*SharedItemsImports = 5 - WindowsServer\WindowsServer.Shared.Tests\WindowsServer.Shared.Tests.projitems*{003691e1-d908-4f29-a9aa-8a98c878f951}*SharedItemsImports = 5 Common\Common.projitems*{00bf736c-b562-4251-9836-ef80282956af}*SharedItemsImports = 5 PerformanceCollector\Filtering.Shared\Filtering.Shared.projitems*{00bf736c-b562-4251-9836-ef80282956af}*SharedItemsImports = 5 PerformanceCollector\Perf.Shared.NetFull\Perf.Shared.NetFull.projitems*{00bf736c-b562-4251-9836-ef80282956af}*SharedItemsImports = 5 @@ -110,43 +96,33 @@ Global PerformanceCollector\Perf.Shared\Perf.Shared.projitems*{00bf736c-b562-4251-9836-ef80282956af}*SharedItemsImports = 5 PerformanceCollector\Perf.Shared.NetFull\Perf.Shared.NetFull.projitems*{0196259c-3582-4f4e-a01f-a8f9ae83b0f3}*SharedItemsImports = 13 PerformanceCollector\Perf.Shared.NetStandard20Net45\Perf.Shared.NetStandard20Net45.projitems*{054c25dc-e545-4712-95c4-81f30cf65ce8}*SharedItemsImports = 13 + TestFramework\Shared\TestFramework.Shared.projitems*{1231d63b-e7fa-4ba7-9916-fa7325db936d}*SharedItemsImports = 5 ..\..\BASE\src\Common\Common\Common.projitems*{2bb7f06b-f094-417f-8c1b-7fcca1192e17}*SharedItemsImports = 5 PerformanceCollector\Perf.Shared.NetStandard.Stubs\Perf.Shared.NetStandard.Stubs.projitems*{30a45441-0849-48fe-ad37-5d29d0e3068a}*SharedItemsImports = 13 Common\Common.projitems*{30ae1a5d-775a-4dec-9f87-849d8ae93e3a}*SharedItemsImports = 5 - Web\Web.Shared.Net\Web.Shared.Net.projitems*{395e03bb-d061-4c9d-9d47-18676566444d}*SharedItemsImports = 13 ..\..\BASE\src\Common\Common\Common.projitems*{41301181-f4be-4c36-b78d-a29c55cb0469}*SharedItemsImports = 5 PerformanceCollector\Filtering.Shared\Filtering.Shared.projitems*{568aeb4f-ba4c-47a5-9fa3-68f06cd11fed}*SharedItemsImports = 13 - WindowsServer\WindowsServer.Shared\WindowsServer.Shared.projitems*{579f42e8-b711-411e-be52-4a3fd208507f}*SharedItemsImports = 13 - DependencyCollector\Shared\DependencyCollector.Shared.projitems*{669e7e58-072d-4b0a-a4dd-4eb2ae2ea4d4}*SharedItemsImports = 13 PerformanceCollector\Perf.Shared.NetStandard16.Stubs\Perf.Shared.NetStandard16.Stubs.projitems*{76b21faa-270d-47de-b14b-bec87edc34f1}*SharedItemsImports = 13 - WindowsServer\WindowsServer.Shared.Tests\WindowsServer.Shared.Tests.projitems*{7916ae39-ae89-4886-8842-33ac9883905a}*SharedItemsImports = 13 Common\Common.projitems*{80f0481a-66c7-4442-96d3-5fd841132c4b}*SharedItemsImports = 5 Common\Common.projitems*{94127fd9-e516-4891-98d4-ef7523117f32}*SharedItemsImports = 5 - WindowsServer\WindowsServer.Shared\WindowsServer.Shared.projitems*{94127fd9-e516-4891-98d4-ef7523117f32}*SharedItemsImports = 5 Common\Common.projitems*{95d90911-2909-4914-920e-7710f7bb6c32}*SharedItemsImports = 5 - DependencyCollector\Shared\DependencyCollector.Shared.projitems*{95d90911-2909-4914-920e-7710f7bb6c32}*SharedItemsImports = 5 TestFramework\Shared\TestFramework.Shared.projitems*{9718f051-147f-4f5f-9ff3-c926430efcf7}*SharedItemsImports = 13 DependencyCollector\Shared.Tests\DependencyCollector.Shared.Tests.projitems*{9853a2a5-fd6c-4743-927e-0bfe807ad21c}*SharedItemsImports = 5 TestFramework\Shared\TestFramework.Shared.projitems*{9853a2a5-fd6c-4743-927e-0bfe807ad21c}*SharedItemsImports = 5 PerformanceCollector\Perf.Shared.Tests\Perf.Shared.Tests.projitems*{9b524bd3-682d-4b6f-9251-d4b2911df0fd}*SharedItemsImports = 13 PerformanceCollector\Perf.Shared\Perf.Shared.projitems*{a78f50d4-f518-4dcb-878b-526fd54cca35}*SharedItemsImports = 13 PerformanceCollector\Perf.Shared.NetStandard20\Perf.Shared.NetStandard20.projitems*{a8ba3bd0-19ce-488d-b2bd-0b9b677f4e03}*SharedItemsImports = 13 - Web\Web.Shared.Net.Tests\Web.Shared.Net.Tests.projitems*{ac2e85bb-05f7-43cb-b966-3611ccf47156}*SharedItemsImports = 13 PerformanceCollector\Perf.Shared.Tests\Perf.Shared.Tests.projitems*{ac7d8533-c823-4e93-b008-51b3c4744e2e}*SharedItemsImports = 5 TestFramework\Shared\TestFramework.Shared.projitems*{ac7d8533-c823-4e93-b008-51b3c4744e2e}*SharedItemsImports = 5 DependencyCollector\Shared.Tests\DependencyCollector.Shared.Tests.projitems*{ace58393-3419-4fca-87cc-c33eb756c7e4}*SharedItemsImports = 13 + TestFramework\Shared\TestFramework.Shared.projitems*{caf98d8b-9202-4cc3-83ec-c384d8eea792}*SharedItemsImports = 5 Common\Common.projitems*{ccab7a34-8dc5-4a6f-b637-46ceba93c687}*SharedItemsImports = 13 PerformanceCollector\Perf.Shared.NetStandard\Perf.Shared.NetStandard.projitems*{d13c3ec7-b300-4158-9054-216156b203be}*SharedItemsImports = 13 PerformanceCollector\Perf.Shared.Tests\Perf.Shared.Tests.projitems*{d5efa02a-971e-477c-896b-c3aa93093267}*SharedItemsImports = 5 TestFramework\Shared\TestFramework.Shared.projitems*{d5efa02a-971e-477c-896b-c3aa93093267}*SharedItemsImports = 5 Common\Common.projitems*{e166d200-0687-4e6d-b836-029ae690aeab}*SharedItemsImports = 5 - Web\Web.Shared.Net\Web.Shared.Net.projitems*{e166d200-0687-4e6d-b836-029ae690aeab}*SharedItemsImports = 5 - TestFramework\Shared\TestFramework.Shared.projitems*{f05eb480-b209-47dd-90e3-1ddc47efc579}*SharedItemsImports = 4 - WindowsServer\WindowsServer.Shared.Tests\WindowsServer.Shared.Tests.projitems*{f05eb480-b209-47dd-90e3-1ddc47efc579}*SharedItemsImports = 4 PerformanceCollector\Perf.Shared.Tests\Perf.Shared.Tests.projitems*{f254d4fb-428d-408e-8251-39bca7b4b5ce}*SharedItemsImports = 4 TestFramework\Shared\TestFramework.Shared.projitems*{f254d4fb-428d-408e-8251-39bca7b4b5ce}*SharedItemsImports = 4 - TestFramework\Shared\TestFramework.Shared.projitems*{f71138bb-b3f8-4767-b394-857b0776038e}*SharedItemsImports = 4 - Web\Web.Shared.Net.Tests\Web.Shared.Net.Tests.projitems*{f71138bb-b3f8-4767-b394-857b0776038e}*SharedItemsImports = 4 EndGlobalSection GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -155,22 +131,6 @@ Global Release|Mixed Platforms = Release|Mixed Platforms EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution - {F05EB480-B209-47DD-90E3-1DDC47EFC579}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F05EB480-B209-47DD-90E3-1DDC47EFC579}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F05EB480-B209-47DD-90E3-1DDC47EFC579}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {F05EB480-B209-47DD-90E3-1DDC47EFC579}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {F05EB480-B209-47DD-90E3-1DDC47EFC579}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F05EB480-B209-47DD-90E3-1DDC47EFC579}.Release|Any CPU.Build.0 = Release|Any CPU - {F05EB480-B209-47DD-90E3-1DDC47EFC579}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {F05EB480-B209-47DD-90E3-1DDC47EFC579}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {F71138BB-B3F8-4767-B394-857B0776038E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F71138BB-B3F8-4767-B394-857B0776038E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F71138BB-B3F8-4767-B394-857B0776038E}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {F71138BB-B3F8-4767-B394-857B0776038E}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {F71138BB-B3F8-4767-B394-857B0776038E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F71138BB-B3F8-4767-B394-857B0776038E}.Release|Any CPU.Build.0 = Release|Any CPU - {F71138BB-B3F8-4767-B394-857B0776038E}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {F71138BB-B3F8-4767-B394-857B0776038E}.Release|Mixed Platforms.Build.0 = Release|Any CPU {F254D4FB-428D-408E-8251-39BCA7B4B5CE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {F254D4FB-428D-408E-8251-39BCA7B4B5CE}.Debug|Any CPU.Build.0 = Debug|Any CPU {F254D4FB-428D-408E-8251-39BCA7B4B5CE}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU @@ -187,14 +147,6 @@ Global {C6B569BC-6F19-42C9-A951-DA611BB0F4BE}.Release|Any CPU.Build.0 = Release|Any CPU {C6B569BC-6F19-42C9-A951-DA611BB0F4BE}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {C6B569BC-6F19-42C9-A951-DA611BB0F4BE}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {9AB6BDFD-253C-4C97-8BB8-7234ADFCB601}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9AB6BDFD-253C-4C97-8BB8-7234ADFCB601}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9AB6BDFD-253C-4C97-8BB8-7234ADFCB601}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {9AB6BDFD-253C-4C97-8BB8-7234ADFCB601}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {9AB6BDFD-253C-4C97-8BB8-7234ADFCB601}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9AB6BDFD-253C-4C97-8BB8-7234ADFCB601}.Release|Any CPU.Build.0 = Release|Any CPU - {9AB6BDFD-253C-4C97-8BB8-7234ADFCB601}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {9AB6BDFD-253C-4C97-8BB8-7234ADFCB601}.Release|Mixed Platforms.Build.0 = Release|Any CPU {D5EFA02A-971E-477C-896B-C3AA93093267}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {D5EFA02A-971E-477C-896B-C3AA93093267}.Debug|Any CPU.Build.0 = Debug|Any CPU {D5EFA02A-971E-477C-896B-C3AA93093267}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU @@ -203,14 +155,6 @@ Global {D5EFA02A-971E-477C-896B-C3AA93093267}.Release|Any CPU.Build.0 = Release|Any CPU {D5EFA02A-971E-477C-896B-C3AA93093267}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {D5EFA02A-971E-477C-896B-C3AA93093267}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {003691E1-D908-4F29-A9AA-8A98C878F951}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {003691E1-D908-4F29-A9AA-8A98C878F951}.Debug|Any CPU.Build.0 = Debug|Any CPU - {003691E1-D908-4F29-A9AA-8A98C878F951}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {003691E1-D908-4F29-A9AA-8A98C878F951}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {003691E1-D908-4F29-A9AA-8A98C878F951}.Release|Any CPU.ActiveCfg = Release|Any CPU - {003691E1-D908-4F29-A9AA-8A98C878F951}.Release|Any CPU.Build.0 = Release|Any CPU - {003691E1-D908-4F29-A9AA-8A98C878F951}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {003691E1-D908-4F29-A9AA-8A98C878F951}.Release|Mixed Platforms.Build.0 = Release|Any CPU {80F0481A-66C7-4442-96D3-5FD841132C4B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {80F0481A-66C7-4442-96D3-5FD841132C4B}.Debug|Any CPU.Build.0 = Debug|Any CPU {80F0481A-66C7-4442-96D3-5FD841132C4B}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU @@ -299,28 +243,43 @@ Global {9853A2A5-FD6C-4743-927E-0BFE807AD21C}.Release|Any CPU.Build.0 = Release|Any CPU {9853A2A5-FD6C-4743-927E-0BFE807AD21C}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {9853A2A5-FD6C-4743-927E-0BFE807AD21C}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {7592A20A-1775-4479-B624-7275173E9821}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {7592A20A-1775-4479-B624-7275173E9821}.Debug|Any CPU.Build.0 = Debug|Any CPU + {7592A20A-1775-4479-B624-7275173E9821}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {7592A20A-1775-4479-B624-7275173E9821}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {7592A20A-1775-4479-B624-7275173E9821}.Release|Any CPU.ActiveCfg = Release|Any CPU + {7592A20A-1775-4479-B624-7275173E9821}.Release|Any CPU.Build.0 = Release|Any CPU + {7592A20A-1775-4479-B624-7275173E9821}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {7592A20A-1775-4479-B624-7275173E9821}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {1231D63B-E7FA-4BA7-9916-FA7325DB936D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1231D63B-E7FA-4BA7-9916-FA7325DB936D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1231D63B-E7FA-4BA7-9916-FA7325DB936D}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {1231D63B-E7FA-4BA7-9916-FA7325DB936D}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {1231D63B-E7FA-4BA7-9916-FA7325DB936D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1231D63B-E7FA-4BA7-9916-FA7325DB936D}.Release|Any CPU.Build.0 = Release|Any CPU + {1231D63B-E7FA-4BA7-9916-FA7325DB936D}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {1231D63B-E7FA-4BA7-9916-FA7325DB936D}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {CAF98D8B-9202-4CC3-83EC-C384D8EEA792}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CAF98D8B-9202-4CC3-83EC-C384D8EEA792}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CAF98D8B-9202-4CC3-83EC-C384D8EEA792}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {CAF98D8B-9202-4CC3-83EC-C384D8EEA792}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {CAF98D8B-9202-4CC3-83EC-C384D8EEA792}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CAF98D8B-9202-4CC3-83EC-C384D8EEA792}.Release|Any CPU.Build.0 = Release|Any CPU + {CAF98D8B-9202-4CC3-83EC-C384D8EEA792}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {CAF98D8B-9202-4CC3-83EC-C384D8EEA792}.Release|Mixed Platforms.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution - {395E03BB-D061-4C9D-9D47-18676566444D} = {1A75535C-B8E5-4C31-BC6E-50456C8C4052} - {F05EB480-B209-47DD-90E3-1DDC47EFC579} = {D87119AF-CD35-46F2-84A6-ED54CC42027E} - {579F42E8-B711-411E-BE52-4A3FD208507F} = {D87119AF-CD35-46F2-84A6-ED54CC42027E} - {7916AE39-AE89-4886-8842-33AC9883905A} = {D87119AF-CD35-46F2-84A6-ED54CC42027E} - {669E7E58-072D-4B0A-A4DD-4EB2AE2EA4D4} = {DF56FBAD-8745-404B-94A1-E83BFC4AD7CB} {ACE58393-3419-4FCA-87CC-C33EB756C7E4} = {DF56FBAD-8745-404B-94A1-E83BFC4AD7CB} - {F71138BB-B3F8-4767-B394-857B0776038E} = {1A75535C-B8E5-4C31-BC6E-50456C8C4052} - {AC2E85BB-05F7-43CB-B966-3611CCF47156} = {1A75535C-B8E5-4C31-BC6E-50456C8C4052} {9718F051-147F-4F5F-9FF3-C926430EFCF7} = {8CA9F9C9-DA39-4159-86F3-C52F1636715E} {F254D4FB-428D-408E-8251-39BCA7B4B5CE} = {A318CC6C-51C8-4BD6-BC85-2B4F35123BE7} {C6B569BC-6F19-42C9-A951-DA611BB0F4BE} = {A318CC6C-51C8-4BD6-BC85-2B4F35123BE7} - {9AB6BDFD-253C-4C97-8BB8-7234ADFCB601} = {701D2D4F-B581-45A2-AF29-4F34EC5F047B} {A78F50D4-F518-4DCB-878B-526FD54CCA35} = {A318CC6C-51C8-4BD6-BC85-2B4F35123BE7} {568AEB4F-BA4C-47A5-9FA3-68F06CD11FED} = {A318CC6C-51C8-4BD6-BC85-2B4F35123BE7} {D5EFA02A-971E-477C-896B-C3AA93093267} = {A318CC6C-51C8-4BD6-BC85-2B4F35123BE7} {9B524BD3-682D-4B6F-9251-D4B2911DF0FD} = {A318CC6C-51C8-4BD6-BC85-2B4F35123BE7} - {003691E1-D908-4F29-A9AA-8A98C878F951} = {D87119AF-CD35-46F2-84A6-ED54CC42027E} {80F0481A-66C7-4442-96D3-5FD841132C4B} = {701D2D4F-B581-45A2-AF29-4F34EC5F047B} {94127FD9-E516-4891-98D4-EF7523117F32} = {D87119AF-CD35-46F2-84A6-ED54CC42027E} {E166D200-0687-4E6D-B836-029AE690AEAB} = {1A75535C-B8E5-4C31-BC6E-50456C8C4052} @@ -336,6 +295,9 @@ Global {41301181-F4BE-4C36-B78D-A29C55CB0469} = {85C7566E-98C3-479D-AC4F-0D4B161B7D42} {9853A2A5-FD6C-4743-927E-0BFE807AD21C} = {DF56FBAD-8745-404B-94A1-E83BFC4AD7CB} {0196259C-3582-4F4E-A01F-A8F9AE83B0F3} = {A318CC6C-51C8-4BD6-BC85-2B4F35123BE7} + {7592A20A-1775-4479-B624-7275173E9821} = {701D2D4F-B581-45A2-AF29-4F34EC5F047B} + {1231D63B-E7FA-4BA7-9916-FA7325DB936D} = {1A75535C-B8E5-4C31-BC6E-50456C8C4052} + {CAF98D8B-9202-4CC3-83EC-C384D8EEA792} = {D87119AF-CD35-46F2-84A6-ED54CC42027E} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {F99E0A07-C363-49BF-BFA7-C748391CE38E} diff --git a/WEB/Src/PerformanceCollector/NetCore.Tests/Perf.NetCore.Tests.csproj b/WEB/Src/PerformanceCollector/NetCore.Tests/Perf.NetCore.Tests.csproj index 19f452a812..200a807306 100644 --- a/WEB/Src/PerformanceCollector/NetCore.Tests/Perf.NetCore.Tests.csproj +++ b/WEB/Src/PerformanceCollector/NetCore.Tests/Perf.NetCore.Tests.csproj @@ -25,8 +25,8 @@ - - + + diff --git a/WEB/Src/PerformanceCollector/NetCore20.Tests/Perf-NetCore20.Tests/Perf-NetCore20.Tests.csproj b/WEB/Src/PerformanceCollector/NetCore20.Tests/Perf-NetCore20.Tests/Perf-NetCore20.Tests.csproj index 9f6e846041..d620cbb5eb 100644 --- a/WEB/Src/PerformanceCollector/NetCore20.Tests/Perf-NetCore20.Tests/Perf-NetCore20.Tests.csproj +++ b/WEB/Src/PerformanceCollector/NetCore20.Tests/Perf-NetCore20.Tests/Perf-NetCore20.Tests.csproj @@ -24,8 +24,8 @@ - - + + diff --git a/WEB/Src/PerformanceCollector/PerformanceCollector/Perf.csproj b/WEB/Src/PerformanceCollector/PerformanceCollector/Perf.csproj index 9f96bf582f..09a038402c 100644 --- a/WEB/Src/PerformanceCollector/PerformanceCollector/Perf.csproj +++ b/WEB/Src/PerformanceCollector/PerformanceCollector/Perf.csproj @@ -29,6 +29,9 @@ All + + All + @@ -45,7 +48,8 @@ - + + @@ -57,7 +61,7 @@ - + @@ -72,6 +76,11 @@ + + + + + @@ -81,5 +90,5 @@ - - + + \ No newline at end of file diff --git a/WEB/Src/Web/Web.Net45.Tests/Web.Net45.Tests.csproj b/WEB/Src/Web/Web.Net45.Tests/Web.Net45.Tests.csproj deleted file mode 100644 index dba9bc54b7..0000000000 --- a/WEB/Src/Web/Web.Net45.Tests/Web.Net45.Tests.csproj +++ /dev/null @@ -1,154 +0,0 @@ - - - - - - Debug - AnyCPU - {F71138BB-B3F8-4767-B394-857B0776038E} - Library - Properties - v4.5 - 512 - {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 10.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages - False - UnitTest - ..\..\..\ - $(DefineConstants);NET45 - - false - - - - - - - - ..\..\..\..\..\packages\Castle.Core.4.4.0\lib\net45\Castle.Core.dll - - - ..\..\..\..\..\packages\Microsoft.AspNet.TelemetryCorrelation.1.0.7\lib\net45\Microsoft.AspNet.TelemetryCorrelation.dll - - - ..\..\..\..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll - True - - - False - ..\Web.Shared.Net.Tests\Azure\Emulation\Microsoft.WindowsAzure.ServiceRuntime.dll - - - ..\..\..\..\..\packages\Moq.4.8.2\lib\net45\Moq.dll - - - ..\..\..\..\..\packages\Newtonsoft.Json.6.0.4\lib\net45\Newtonsoft.Json.dll - True - - - - - ..\..\..\..\..\packages\System.Buffers.4.5.1\lib\netstandard1.1\System.Buffers.dll - - - - ..\..\..\..\..\packages\System.Diagnostics.DiagnosticSource.4.6.0\lib\net45\System.Diagnostics.DiagnosticSource.dll - - - - - ..\..\..\..\..\packages\System.Memory.4.5.4\lib\netstandard1.1\System.Memory.dll - - - - - ..\..\..\..\..\packages\Microsoft.AspNet.WebApi.Client.5.2.4\lib\net45\System.Net.Http.Formatting.dll - - - ..\..\..\..\..\packages\System.Runtime.CompilerServices.Unsafe.4.5.3\lib\netstandard1.0\System.Runtime.CompilerServices.Unsafe.dll - - - - - ..\..\..\..\..\packages\System.Threading.Tasks.Extensions.4.3.0\lib\portable-net45+win8+wp8+wpa81\System.Threading.Tasks.Extensions.dll - - - ..\..\..\..\..\packages\System.ValueTuple.4.4.0\lib\netstandard1.0\System.ValueTuple.dll - - - - ..\..\..\..\..\packages\Microsoft.AspNet.WebPages.3.2.4\lib\net45\System.Web.Helpers.dll - - - ..\..\..\..\..\packages\Microsoft.AspNet.WebApi.Core.5.2.4\lib\net45\System.Web.Http.dll - - - ..\..\..\..\..\packages\Microsoft.AspNet.WebApi.WebHost.5.2.4\lib\net45\System.Web.Http.WebHost.dll - - - ..\..\..\..\..\packages\Microsoft.AspNet.Mvc.5.2.4\lib\net45\System.Web.Mvc.dll - - - ..\..\..\..\..\packages\Microsoft.AspNet.Razor.3.2.4\lib\net45\System.Web.Razor.dll - - - ..\..\..\..\..\packages\Microsoft.AspNet.WebPages.3.2.4\lib\net45\System.Web.WebPages.dll - - - ..\..\..\..\..\packages\Microsoft.AspNet.WebPages.3.2.4\lib\net45\System.Web.WebPages.Deployment.dll - - - ..\..\..\..\..\packages\Microsoft.AspNet.WebPages.3.2.4\lib\net45\System.Web.WebPages.Razor.dll - - - - - - ..\..\..\..\..\packages\xunit.abstractions.2.0.0\lib\net35\xunit.abstractions.dll - True - - - ..\..\..\..\..\packages\xunit.assert.2.1.0\lib\dotnet\xunit.assert.dll - True - - - ..\..\..\..\..\packages\xunit.extensibility.core.2.1.0\lib\dotnet\xunit.core.dll - True - - - ..\..\..\..\..\packages\xunit.extensibility.execution.2.1.0\lib\net45\xunit.execution.desktop.dll - True - - - - - - Designer - - - - - - - - - - - - - - {e3d160e8-7f8c-416f-946f-6fdfc6787461} - Microsoft.ApplicationInsights - - - {5a507420-188e-4f28-aecc-9f0877b7391b} - Web - - - - - - - \ No newline at end of file diff --git a/WEB/Src/Web/Web.Net45.Tests/packages.config b/WEB/Src/Web/Web.Net45.Tests/packages.config deleted file mode 100644 index cfda45fcd6..0000000000 --- a/WEB/Src/Web/Web.Net45.Tests/packages.config +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/WEB/Src/Web/Web.Shared.Net.Tests/ApplicationInsightsHttpModuleTests.cs b/WEB/Src/Web/Web.Shared.Net.Tests/ApplicationInsightsHttpModuleTests.cs deleted file mode 100644 index 7fc1475d0c..0000000000 --- a/WEB/Src/Web/Web.Shared.Net.Tests/ApplicationInsightsHttpModuleTests.cs +++ /dev/null @@ -1,36 +0,0 @@ -namespace Microsoft.ApplicationInsights.Web -{ - using System; - using System.Diagnostics.Tracing; - using System.Globalization; - using System.Linq; - using System.Web; - - using Microsoft.ApplicationInsights.Web.Helpers; - using Microsoft.ApplicationInsights.Web.Implementation; - using Microsoft.ApplicationInsights.Web.TestFramework; - using Microsoft.VisualStudio.TestTools.UnitTesting; - - [TestClass] - public class ApplicationInsightsHttpModuleTests - { - private const long AllKeywords = -1; - - private PrivateObject module; - private PrivateObject module2; - - [TestInitialize] - public void Initialize() - { - this.module = HttpModuleHelper.CreateTestModule(); - this.module2 = HttpModuleHelper.CreateTestModule(); - } - - [TestCleanup] - public void Cleanup() - { - ((IHttpModule)this.module.Target).Dispose(); - ((IHttpModule)this.module2.Target).Dispose(); - } - } -} \ No newline at end of file diff --git a/WEB/Src/Web/Web.Shared.Net.Tests/GlobalSuppressions.cs b/WEB/Src/Web/Web.Shared.Net.Tests/GlobalSuppressions.cs deleted file mode 100644 index 494a050060..0000000000 --- a/WEB/Src/Web/Web.Shared.Net.Tests/GlobalSuppressions.cs +++ /dev/null @@ -1,6 +0,0 @@ -// This file is used by Code Analysis to maintain SuppressMessage -// attributes that are applied to this project. -// Project-level suppressions either have no target or are given -// a specific target and scoped to a namespace, type, member, etc. -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1649:File name must match first type name", Justification = "Pre-existing condition")] -[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.DocumentationRules", "SA1652:Enable XML documentation output", Justification = "Pre-existing condition")] diff --git a/WEB/Src/Web/Web.Shared.Net.Tests/Web.Shared.Net.Tests.shproj b/WEB/Src/Web/Web.Shared.Net.Tests/Web.Shared.Net.Tests.shproj deleted file mode 100644 index fc10c00d02..0000000000 --- a/WEB/Src/Web/Web.Shared.Net.Tests/Web.Shared.Net.Tests.shproj +++ /dev/null @@ -1,15 +0,0 @@ - - - - ac2e85bb-05f7-43cb-b966-3611ccf47156 - - - - - - - - - - - diff --git a/WEB/Src/Web/Web.Shared.Net.Tests/web.Shared.Net.Tests.projitems b/WEB/Src/Web/Web.Shared.Net.Tests/web.Shared.Net.Tests.projitems deleted file mode 100644 index dba60f0478..0000000000 --- a/WEB/Src/Web/Web.Shared.Net.Tests/web.Shared.Net.Tests.projitems +++ /dev/null @@ -1,37 +0,0 @@ - - - - $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - true - ac2e85bb-05f7-43cb-b966-3611ccf47156 - - - Microsoft.ApplicationInsights.Web - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/WEB/Src/Web/Web.Shared.Net/Implementation/HttpRequestExtensions.cs b/WEB/Src/Web/Web.Shared.Net/Implementation/HttpRequestExtensions.cs deleted file mode 100644 index 6ee0be1d00..0000000000 --- a/WEB/Src/Web/Web.Shared.Net/Implementation/HttpRequestExtensions.cs +++ /dev/null @@ -1,31 +0,0 @@ -namespace Microsoft.ApplicationInsights.Web.Implementation -{ - using System; - using System.Web; - using Microsoft.ApplicationInsights.Extensibility.Implementation.Tracing; - - /// - /// HttpRequest Extensions. - /// - internal static partial class HttpRequestExtensions - { - public static string GetUserHostAddress(this HttpRequest httpRequest) - { - if (httpRequest == null) - { - return null; - } - - try - { - return httpRequest.UserHostAddress; - } - catch (ArgumentException exp) - { - // System.ArgumentException: Value does not fall within the expected range. Fails in IIS7, WCF OneWay. - WebEventSource.Log.UserHostNotCollectedWarning(exp.ToInvariantString()); - return null; - } - } - } -} diff --git a/WEB/Src/Web/Web.Shared.Net/Web.Shared.Net.projitems b/WEB/Src/Web/Web.Shared.Net/Web.Shared.Net.projitems deleted file mode 100644 index 797332a446..0000000000 --- a/WEB/Src/Web/Web.Shared.Net/Web.Shared.Net.projitems +++ /dev/null @@ -1,45 +0,0 @@ - - - - {9D7715BB-E4D0-499C-B8A3-63466FC8AA5D} - - - $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - true - 395e03bb-d061-4c9d-9d47-18676566444d - - - Microsoft.ApplicationInsights.Web - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/WEB/Src/Web/Web.Shared.Net/Web.Shared.shproj b/WEB/Src/Web/Web.Shared.Net/Web.Shared.shproj deleted file mode 100644 index 4acc9f2d5d..0000000000 --- a/WEB/Src/Web/Web.Shared.Net/Web.Shared.shproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - 395e03bb-d061-4c9d-9d47-18676566444d - - - - - - - - diff --git a/WEB/Src/Web/Web.Shared.Net.Tests/AccountIdTelemetryInitializerTests.cs b/WEB/Src/Web/Web.Tests/AccountIdTelemetryInitializerTests.cs similarity index 100% rename from WEB/Src/Web/Web.Shared.Net.Tests/AccountIdTelemetryInitializerTests.cs rename to WEB/Src/Web/Web.Tests/AccountIdTelemetryInitializerTests.cs diff --git a/WEB/Src/Web/Web.Net45.Tests/AspNetDiagnosticTelemetryModuleTest.cs b/WEB/Src/Web/Web.Tests/AspNetDiagnosticTelemetryModuleTest.cs similarity index 100% rename from WEB/Src/Web/Web.Net45.Tests/AspNetDiagnosticTelemetryModuleTest.cs rename to WEB/Src/Web/Web.Tests/AspNetDiagnosticTelemetryModuleTest.cs diff --git a/WEB/Src/Web/Web.Shared.Net.Tests/AuthenticatedUserIdTelemetryInitializerTests.cs b/WEB/Src/Web/Web.Tests/AuthenticatedUserIdTelemetryInitializerTests.cs similarity index 100% rename from WEB/Src/Web/Web.Shared.Net.Tests/AuthenticatedUserIdTelemetryInitializerTests.cs rename to WEB/Src/Web/Web.Tests/AuthenticatedUserIdTelemetryInitializerTests.cs diff --git a/WEB/Src/Web/Web.Shared.Net.Tests/AzureAppServiceRoleNameFromHostNameHeaderInitializerTest.cs b/WEB/Src/Web/Web.Tests/AzureAppServiceRoleNameFromHostNameHeaderInitializerTest.cs similarity index 100% rename from WEB/Src/Web/Web.Shared.Net.Tests/AzureAppServiceRoleNameFromHostNameHeaderInitializerTest.cs rename to WEB/Src/Web/Web.Tests/AzureAppServiceRoleNameFromHostNameHeaderInitializerTest.cs diff --git a/WEB/Src/Web/Web.Shared.Net.Tests/ClientIpHeaderTelemetryModuleTest.cs b/WEB/Src/Web/Web.Tests/ClientIpHeaderTelemetryModuleTest.cs similarity index 100% rename from WEB/Src/Web/Web.Shared.Net.Tests/ClientIpHeaderTelemetryModuleTest.cs rename to WEB/Src/Web/Web.Tests/ClientIpHeaderTelemetryModuleTest.cs diff --git a/WEB/Src/Web/Web.Shared.Net.Tests/ExceptionTrackingTelemetryModuleTests.cs b/WEB/Src/Web/Web.Tests/ExceptionTrackingTelemetryModuleTests.cs similarity index 100% rename from WEB/Src/Web/Web.Shared.Net.Tests/ExceptionTrackingTelemetryModuleTests.cs rename to WEB/Src/Web/Web.Tests/ExceptionTrackingTelemetryModuleTests.cs diff --git a/WEB/Src/Web/Web.Shared.Net.Tests/Helpers/HttpContextTestExtensions.cs b/WEB/Src/Web/Web.Tests/Helpers/HttpContextTestExtensions.cs similarity index 100% rename from WEB/Src/Web/Web.Shared.Net.Tests/Helpers/HttpContextTestExtensions.cs rename to WEB/Src/Web/Web.Tests/Helpers/HttpContextTestExtensions.cs diff --git a/WEB/Src/Web/Web.Shared.Net.Tests/Helpers/HttpModuleHelper.cs b/WEB/Src/Web/Web.Tests/Helpers/HttpModuleHelper.cs similarity index 100% rename from WEB/Src/Web/Web.Shared.Net.Tests/Helpers/HttpModuleHelper.cs rename to WEB/Src/Web/Web.Tests/Helpers/HttpModuleHelper.cs diff --git a/WEB/Src/Web/Web.Shared.Net.Tests/Helpers/InMemoryCaptureTelemetryChannel.cs b/WEB/Src/Web/Web.Tests/Helpers/InMemoryCaptureTelemetryChannel.cs similarity index 100% rename from WEB/Src/Web/Web.Shared.Net.Tests/Helpers/InMemoryCaptureTelemetryChannel.cs rename to WEB/Src/Web/Web.Tests/Helpers/InMemoryCaptureTelemetryChannel.cs diff --git a/WEB/Src/Web/Web.Shared.Net.Tests/Helpers/RequestStatus.cs b/WEB/Src/Web/Web.Tests/Helpers/RequestStatus.cs similarity index 100% rename from WEB/Src/Web/Web.Shared.Net.Tests/Helpers/RequestStatus.cs rename to WEB/Src/Web/Web.Tests/Helpers/RequestStatus.cs diff --git a/WEB/Src/Web/Web.Shared.Net.Tests/Helpers/SimpleTelemetryProcessorSpy.cs b/WEB/Src/Web/Web.Tests/Helpers/SimpleTelemetryProcessorSpy.cs similarity index 100% rename from WEB/Src/Web/Web.Shared.Net.Tests/Helpers/SimpleTelemetryProcessorSpy.cs rename to WEB/Src/Web/Web.Tests/Helpers/SimpleTelemetryProcessorSpy.cs diff --git a/WEB/Src/Web/Web.Shared.Net.Tests/Helpers/WebTelemetryModuleBaseFake.cs b/WEB/Src/Web/Web.Tests/Helpers/WebTelemetryModuleBaseFake.cs similarity index 100% rename from WEB/Src/Web/Web.Shared.Net.Tests/Helpers/WebTelemetryModuleBaseFake.cs rename to WEB/Src/Web/Web.Tests/Helpers/WebTelemetryModuleBaseFake.cs diff --git a/WEB/Src/Web/Web.Shared.Net.Tests/HttpContextExtensionTest.cs b/WEB/Src/Web/Web.Tests/HttpContextExtensionTest.cs similarity index 100% rename from WEB/Src/Web/Web.Shared.Net.Tests/HttpContextExtensionTest.cs rename to WEB/Src/Web/Web.Tests/HttpContextExtensionTest.cs diff --git a/WEB/Src/Web/Web.Shared.Net.Tests/Implementation/HeadersUtilitiesTest.cs b/WEB/Src/Web/Web.Tests/Implementation/HeadersUtilitiesTest.cs similarity index 100% rename from WEB/Src/Web/Web.Shared.Net.Tests/Implementation/HeadersUtilitiesTest.cs rename to WEB/Src/Web/Web.Tests/Implementation/HeadersUtilitiesTest.cs diff --git a/WEB/Src/Web/Web.Shared.Net.Tests/Implementation/HttpRequestExtensionsTest.cs b/WEB/Src/Web/Web.Tests/Implementation/HttpRequestExtensionsTest.cs similarity index 100% rename from WEB/Src/Web/Web.Shared.Net.Tests/Implementation/HttpRequestExtensionsTest.cs rename to WEB/Src/Web/Web.Tests/Implementation/HttpRequestExtensionsTest.cs diff --git a/WEB/Src/Web/Web.Shared.Net.Tests/Implementation/WebEventSourceTest.cs b/WEB/Src/Web/Web.Tests/Implementation/WebEventSourceTest.cs similarity index 100% rename from WEB/Src/Web/Web.Shared.Net.Tests/Implementation/WebEventSourceTest.cs rename to WEB/Src/Web/Web.Tests/Implementation/WebEventSourceTest.cs diff --git a/WEB/Src/Web/Web.Net45.Tests/MvcExceptionHandlerTests.cs b/WEB/Src/Web/Web.Tests/MvcExceptionHandlerTests.cs similarity index 100% rename from WEB/Src/Web/Web.Net45.Tests/MvcExceptionHandlerTests.cs rename to WEB/Src/Web/Web.Tests/MvcExceptionHandlerTests.cs diff --git a/WEB/Src/Web/Web.Shared.Net.Tests/OperationCorrelationTelemetryInitializerTests.cs b/WEB/Src/Web/Web.Tests/OperationCorrelationTelemetryInitializerTests.cs similarity index 100% rename from WEB/Src/Web/Web.Shared.Net.Tests/OperationCorrelationTelemetryInitializerTests.cs rename to WEB/Src/Web/Web.Tests/OperationCorrelationTelemetryInitializerTests.cs diff --git a/WEB/Src/Web/Web.Shared.Net.Tests/OperationNameTelemetryInitializerTests.cs b/WEB/Src/Web/Web.Tests/OperationNameTelemetryInitializerTests.cs similarity index 100% rename from WEB/Src/Web/Web.Shared.Net.Tests/OperationNameTelemetryInitializerTests.cs rename to WEB/Src/Web/Web.Tests/OperationNameTelemetryInitializerTests.cs diff --git a/WEB/Src/Web/Web.Net45.Tests/RequestTrackingTelemetryModuleTest.Net45.cs b/WEB/Src/Web/Web.Tests/RequestTrackingTelemetryModuleTest.Net45.cs similarity index 100% rename from WEB/Src/Web/Web.Net45.Tests/RequestTrackingTelemetryModuleTest.Net45.cs rename to WEB/Src/Web/Web.Tests/RequestTrackingTelemetryModuleTest.Net45.cs diff --git a/WEB/Src/Web/Web.Shared.Net.Tests/RequestTrackingTelemetryModuleTest.cs b/WEB/Src/Web/Web.Tests/RequestTrackingTelemetryModuleTest.cs similarity index 100% rename from WEB/Src/Web/Web.Shared.Net.Tests/RequestTrackingTelemetryModuleTest.cs rename to WEB/Src/Web/Web.Tests/RequestTrackingTelemetryModuleTest.cs diff --git a/WEB/Src/Web/Web.Net45.Tests/RequestTrackingUtilitiesTest.cs b/WEB/Src/Web/Web.Tests/RequestTrackingUtilitiesTest.cs similarity index 100% rename from WEB/Src/Web/Web.Net45.Tests/RequestTrackingUtilitiesTest.cs rename to WEB/Src/Web/Web.Tests/RequestTrackingUtilitiesTest.cs diff --git a/WEB/Src/Web/Web.Net45.Tests/SdkVersionUtilsTest.cs b/WEB/Src/Web/Web.Tests/SdkVersionUtilsTest.cs similarity index 100% rename from WEB/Src/Web/Web.Net45.Tests/SdkVersionUtilsTest.cs rename to WEB/Src/Web/Web.Tests/SdkVersionUtilsTest.cs diff --git a/WEB/Src/Web/Web.Shared.Net.Tests/SessionTelemetryInitializerTest.cs b/WEB/Src/Web/Web.Tests/SessionTelemetryInitializerTest.cs similarity index 100% rename from WEB/Src/Web/Web.Shared.Net.Tests/SessionTelemetryInitializerTest.cs rename to WEB/Src/Web/Web.Tests/SessionTelemetryInitializerTest.cs diff --git a/WEB/Src/Web/Web.Shared.Net.Tests/SyntheticUserAgentTelemetryInitializerTest.cs b/WEB/Src/Web/Web.Tests/SyntheticUserAgentTelemetryInitializerTest.cs similarity index 100% rename from WEB/Src/Web/Web.Shared.Net.Tests/SyntheticUserAgentTelemetryInitializerTest.cs rename to WEB/Src/Web/Web.Tests/SyntheticUserAgentTelemetryInitializerTest.cs diff --git a/WEB/Src/Web/Web.Shared.Net.Tests/UserTelemetryInitializerTest.cs b/WEB/Src/Web/Web.Tests/UserTelemetryInitializerTest.cs similarity index 100% rename from WEB/Src/Web/Web.Shared.Net.Tests/UserTelemetryInitializerTest.cs rename to WEB/Src/Web/Web.Tests/UserTelemetryInitializerTest.cs diff --git a/WEB/Src/Web/Web.Net45.Tests/W3CUtilitiesTests.cs b/WEB/Src/Web/Web.Tests/W3CUtilitiesTests.cs similarity index 100% rename from WEB/Src/Web/Web.Net45.Tests/W3CUtilitiesTests.cs rename to WEB/Src/Web/Web.Tests/W3CUtilitiesTests.cs diff --git a/WEB/Src/Web/Web.Tests/Web.Tests.csproj b/WEB/Src/Web/Web.Tests/Web.Tests.csproj new file mode 100644 index 0000000000..4b5de85704 --- /dev/null +++ b/WEB/Src/Web/Web.Tests/Web.Tests.csproj @@ -0,0 +1,49 @@ + + + + + + + + Microsoft.ApplicationInsights.Web.Tests + net45 + false + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/WEB/Src/Web/Web.Net45.Tests/WebApiExceptionLoggerTests.cs b/WEB/Src/Web/Web.Tests/WebApiExceptionLoggerTests.cs similarity index 100% rename from WEB/Src/Web/Web.Net45.Tests/WebApiExceptionLoggerTests.cs rename to WEB/Src/Web/Web.Tests/WebApiExceptionLoggerTests.cs diff --git a/WEB/Src/Web/Web.Shared.Net.Tests/WebTestTelemetryInitializerTest.cs b/WEB/Src/Web/Web.Tests/WebTestTelemetryInitializerTest.cs similarity index 100% rename from WEB/Src/Web/Web.Shared.Net.Tests/WebTestTelemetryInitializerTest.cs rename to WEB/Src/Web/Web.Tests/WebTestTelemetryInitializerTest.cs diff --git a/WEB/Src/Web/Web.Net45.Tests/app.config b/WEB/Src/Web/Web.Tests/app.config similarity index 100% rename from WEB/Src/Web/Web.Net45.Tests/app.config rename to WEB/Src/Web/Web.Tests/app.config diff --git a/WEB/Src/Web/Web.Shared.Net/AccountIdTelemetryInitializer.cs b/WEB/Src/Web/Web/AccountIdTelemetryInitializer.cs similarity index 100% rename from WEB/Src/Web/Web.Shared.Net/AccountIdTelemetryInitializer.cs rename to WEB/Src/Web/Web/AccountIdTelemetryInitializer.cs diff --git a/WEB/Src/Web/Web.Shared.Net/ApplicationInsightsHttpModule.cs b/WEB/Src/Web/Web/ApplicationInsightsHttpModule.cs similarity index 100% rename from WEB/Src/Web/Web.Shared.Net/ApplicationInsightsHttpModule.cs rename to WEB/Src/Web/Web/ApplicationInsightsHttpModule.cs diff --git a/WEB/Src/Web/Web.Shared.Net/AuthenticatedUserIdTelemetryInitializer.cs b/WEB/Src/Web/Web/AuthenticatedUserIdTelemetryInitializer.cs similarity index 100% rename from WEB/Src/Web/Web.Shared.Net/AuthenticatedUserIdTelemetryInitializer.cs rename to WEB/Src/Web/Web/AuthenticatedUserIdTelemetryInitializer.cs diff --git a/WEB/Src/Web/Web.Shared.Net/AzureAppServiceRoleNameFromHostNameHeaderInitializer.cs b/WEB/Src/Web/Web/AzureAppServiceRoleNameFromHostNameHeaderInitializer.cs similarity index 100% rename from WEB/Src/Web/Web.Shared.Net/AzureAppServiceRoleNameFromHostNameHeaderInitializer.cs rename to WEB/Src/Web/Web/AzureAppServiceRoleNameFromHostNameHeaderInitializer.cs diff --git a/WEB/Src/Web/Web.Shared.Net/ClientIpHeaderTelemetryInitializer.cs b/WEB/Src/Web/Web/ClientIpHeaderTelemetryInitializer.cs similarity index 100% rename from WEB/Src/Web/Web.Shared.Net/ClientIpHeaderTelemetryInitializer.cs rename to WEB/Src/Web/Web/ClientIpHeaderTelemetryInitializer.cs diff --git a/WEB/Src/Web/Web.Shared.Net/ExceptionTrackingTelemetryModule.cs b/WEB/Src/Web/Web/ExceptionTrackingTelemetryModule.cs similarity index 100% rename from WEB/Src/Web/Web.Shared.Net/ExceptionTrackingTelemetryModule.cs rename to WEB/Src/Web/Web/ExceptionTrackingTelemetryModule.cs diff --git a/WEB/Src/Web/Web.Shared.Net/Extensibility/Implementation/PostSamplingTelemetryProcessor.cs b/WEB/Src/Web/Web/Extensibility/Implementation/PostSamplingTelemetryProcessor.cs similarity index 100% rename from WEB/Src/Web/Web.Shared.Net/Extensibility/Implementation/PostSamplingTelemetryProcessor.cs rename to WEB/Src/Web/Web/Extensibility/Implementation/PostSamplingTelemetryProcessor.cs diff --git a/WEB/Src/Web/Web.Shared.Net/HttpContextBaseExtension.cs b/WEB/Src/Web/Web/HttpContextBaseExtension.cs similarity index 100% rename from WEB/Src/Web/Web.Shared.Net/HttpContextBaseExtension.cs rename to WEB/Src/Web/Web/HttpContextBaseExtension.cs diff --git a/WEB/Src/Web/Web.Shared.Net/HttpContextExtension.cs b/WEB/Src/Web/Web/HttpContextExtension.cs similarity index 100% rename from WEB/Src/Web/Web.Shared.Net/HttpContextExtension.cs rename to WEB/Src/Web/Web/HttpContextExtension.cs diff --git a/WEB/Src/Web/Web.Shared.Net/Implementation/ActivityHelpers.cs b/WEB/Src/Web/Web/Implementation/ActivityHelpers.cs similarity index 100% rename from WEB/Src/Web/Web.Shared.Net/Implementation/ActivityHelpers.cs rename to WEB/Src/Web/Web/Implementation/ActivityHelpers.cs diff --git a/WEB/Src/Web/Web.Shared.Net/Implementation/AppMapCorrelationEventSource.cs b/WEB/Src/Web/Web/Implementation/AppMapCorrelationEventSource.cs similarity index 100% rename from WEB/Src/Web/Web.Shared.Net/Implementation/AppMapCorrelationEventSource.cs rename to WEB/Src/Web/Web/Implementation/AppMapCorrelationEventSource.cs diff --git a/WEB/Src/Web/Web.Shared.Net/Implementation/ExceptionHandlersInjector.cs b/WEB/Src/Web/Web/Implementation/ExceptionHandlersInjector.cs similarity index 100% rename from WEB/Src/Web/Web.Shared.Net/Implementation/ExceptionHandlersInjector.cs rename to WEB/Src/Web/Web/Implementation/ExceptionHandlersInjector.cs diff --git a/WEB/Src/Web/Web.Shared.Net/Implementation/HttpContextExtensions.cs b/WEB/Src/Web/Web/Implementation/HttpContextExtensions.cs similarity index 100% rename from WEB/Src/Web/Web.Shared.Net/Implementation/HttpContextExtensions.cs rename to WEB/Src/Web/Web/Implementation/HttpContextExtensions.cs diff --git a/WEB/Src/Web/Web/Implementation/HttpRequestExtensions.cs b/WEB/Src/Web/Web/Implementation/HttpRequestExtensions.cs index 4839f04387..f0c7a54c0d 100644 --- a/WEB/Src/Web/Web/Implementation/HttpRequestExtensions.cs +++ b/WEB/Src/Web/Web/Implementation/HttpRequestExtensions.cs @@ -4,6 +4,7 @@ using System.Collections.Specialized; using System.Web; using Microsoft.ApplicationInsights.Common; + using Microsoft.ApplicationInsights.Extensibility.Implementation.Tracing; /// /// HttpRequest Extensions. @@ -43,5 +44,24 @@ public static NameValueCollection UnvalidatedGetHeaders(this HttpRequest httpReq { return httpRequest.Unvalidated.Headers; } + + public static string GetUserHostAddress(this HttpRequest httpRequest) + { + if (httpRequest == null) + { + return null; + } + + try + { + return httpRequest.UserHostAddress; + } + catch (ArgumentException exp) + { + // System.ArgumentException: Value does not fall within the expected range. Fails in IIS7, WCF OneWay. + WebEventSource.Log.UserHostNotCollectedWarning(exp.ToInvariantString()); + return null; + } + } } } diff --git a/WEB/Src/Web/Web.Shared.Net/Implementation/RequestTrackingConstants.cs b/WEB/Src/Web/Web/Implementation/RequestTrackingConstants.cs similarity index 100% rename from WEB/Src/Web/Web.Shared.Net/Implementation/RequestTrackingConstants.cs rename to WEB/Src/Web/Web/Implementation/RequestTrackingConstants.cs diff --git a/WEB/Src/Web/Web.Shared.Net/Implementation/RequestTrackingExtensions.cs b/WEB/Src/Web/Web/Implementation/RequestTrackingExtensions.cs similarity index 100% rename from WEB/Src/Web/Web.Shared.Net/Implementation/RequestTrackingExtensions.cs rename to WEB/Src/Web/Web/Implementation/RequestTrackingExtensions.cs diff --git a/WEB/Src/Web/Web.Shared.Net/Implementation/SyntheticUserAgentFilter.cs b/WEB/Src/Web/Web/Implementation/SyntheticUserAgentFilter.cs similarity index 100% rename from WEB/Src/Web/Web.Shared.Net/Implementation/SyntheticUserAgentFilter.cs rename to WEB/Src/Web/Web/Implementation/SyntheticUserAgentFilter.cs diff --git a/WEB/Src/Web/Web.Shared.Net/Implementation/WebEventSource.cs b/WEB/Src/Web/Web/Implementation/WebEventSource.cs similarity index 100% rename from WEB/Src/Web/Web.Shared.Net/Implementation/WebEventSource.cs rename to WEB/Src/Web/Web/Implementation/WebEventSource.cs diff --git a/WEB/Src/Web/Web.Shared.Net/Implementation/WebTelemetryInitializerBase.cs b/WEB/Src/Web/Web/Implementation/WebTelemetryInitializerBase.cs similarity index 100% rename from WEB/Src/Web/Web.Shared.Net/Implementation/WebTelemetryInitializerBase.cs rename to WEB/Src/Web/Web/Implementation/WebTelemetryInitializerBase.cs diff --git a/WEB/Src/Web/Web.Shared.Net/Implementation/WebTelemetryModuleBase.cs b/WEB/Src/Web/Web/Implementation/WebTelemetryModuleBase.cs similarity index 100% rename from WEB/Src/Web/Web.Shared.Net/Implementation/WebTelemetryModuleBase.cs rename to WEB/Src/Web/Web/Implementation/WebTelemetryModuleBase.cs diff --git a/WEB/Src/Web/Web.Shared.Net/OperationCorrelationTelemetryInitializer.cs b/WEB/Src/Web/Web/OperationCorrelationTelemetryInitializer.cs similarity index 100% rename from WEB/Src/Web/Web.Shared.Net/OperationCorrelationTelemetryInitializer.cs rename to WEB/Src/Web/Web/OperationCorrelationTelemetryInitializer.cs diff --git a/WEB/Src/Web/Web.Shared.Net/OperationNameTelemetryInitializer.cs b/WEB/Src/Web/Web/OperationNameTelemetryInitializer.cs similarity index 100% rename from WEB/Src/Web/Web.Shared.Net/OperationNameTelemetryInitializer.cs rename to WEB/Src/Web/Web/OperationNameTelemetryInitializer.cs diff --git a/WEB/Src/Web/Web.Shared.Net/Properties/AssemblyInfo.cs b/WEB/Src/Web/Web/Properties/AssemblyInfo.cs similarity index 97% rename from WEB/Src/Web/Web.Shared.Net/Properties/AssemblyInfo.cs rename to WEB/Src/Web/Web/Properties/AssemblyInfo.cs index a81656d8be..a3ab8df229 100644 --- a/WEB/Src/Web/Web.Shared.Net/Properties/AssemblyInfo.cs +++ b/WEB/Src/Web/Web/Properties/AssemblyInfo.cs @@ -12,7 +12,7 @@ [assembly: ComVisible(false)] -[assembly: InternalsVisibleTo("Microsoft.ApplicationInsights.Web.Net45.Tests, PublicKey=" + AssemblyInfo.PublicKey)] +[assembly: InternalsVisibleTo("Microsoft.ApplicationInsights.Web.Tests, PublicKey=" + AssemblyInfo.PublicKey)] internal static class AssemblyInfo { diff --git a/WEB/Src/Web/Web.Shared.Net/RequestTrackingTelemetryModule.cs b/WEB/Src/Web/Web/RequestTrackingTelemetryModule.cs similarity index 100% rename from WEB/Src/Web/Web.Shared.Net/RequestTrackingTelemetryModule.cs rename to WEB/Src/Web/Web/RequestTrackingTelemetryModule.cs diff --git a/WEB/Src/Web/Web.Shared.Net/RequestTrackingUtilities.cs b/WEB/Src/Web/Web/RequestTrackingUtilities.cs similarity index 100% rename from WEB/Src/Web/Web.Shared.Net/RequestTrackingUtilities.cs rename to WEB/Src/Web/Web/RequestTrackingUtilities.cs diff --git a/WEB/Src/Web/Web.Shared.Net/SessionTelemetryInitializer.cs b/WEB/Src/Web/Web/SessionTelemetryInitializer.cs similarity index 100% rename from WEB/Src/Web/Web.Shared.Net/SessionTelemetryInitializer.cs rename to WEB/Src/Web/Web/SessionTelemetryInitializer.cs diff --git a/WEB/Src/Web/Web.Shared.Net/SyntheticUserAgentTelemetryInitializer.cs b/WEB/Src/Web/Web/SyntheticUserAgentTelemetryInitializer.cs similarity index 100% rename from WEB/Src/Web/Web.Shared.Net/SyntheticUserAgentTelemetryInitializer.cs rename to WEB/Src/Web/Web/SyntheticUserAgentTelemetryInitializer.cs diff --git a/WEB/Src/Web/Web.Shared.Net/UserTelemetryInitializer.cs b/WEB/Src/Web/Web/UserTelemetryInitializer.cs similarity index 100% rename from WEB/Src/Web/Web.Shared.Net/UserTelemetryInitializer.cs rename to WEB/Src/Web/Web/UserTelemetryInitializer.cs diff --git a/WEB/Src/Web/Web/Web.csproj b/WEB/Src/Web/Web/Web.csproj index 3f37e8c4e4..f304f2dc68 100644 --- a/WEB/Src/Web/Web/Web.csproj +++ b/WEB/Src/Web/Web/Web.csproj @@ -30,6 +30,9 @@ All + + All + @@ -62,6 +65,9 @@ - + + + + diff --git a/WEB/Src/Web/Web.Shared.Net/WebTestTelemetryInitializer.cs b/WEB/Src/Web/Web/WebTestTelemetryInitializer.cs similarity index 100% rename from WEB/Src/Web/Web.Shared.Net/WebTestTelemetryInitializer.cs rename to WEB/Src/Web/Web/WebTestTelemetryInitializer.cs diff --git a/WEB/Src/WindowsServer/WindowsServer.Net45.Tests/WindowsServer.Net45.Tests.csproj b/WEB/Src/WindowsServer/WindowsServer.Net45.Tests/WindowsServer.Net45.Tests.csproj deleted file mode 100644 index 9e1ea985f4..0000000000 --- a/WEB/Src/WindowsServer/WindowsServer.Net45.Tests/WindowsServer.Net45.Tests.csproj +++ /dev/null @@ -1,116 +0,0 @@ - - - - - - win - Debug - AnyCPU - {F05EB480-B209-47DD-90E3-1DDC47EFC579} - Library - Properties - Microsoft.ApplicationInsights.WindowsServer - WindowsServer.Net45.Tests - v4.5 - 512 - {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - 10.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages - False - UnitTest - $(DefineConstants);NET45 - - - - - - - - - ..\..\..\..\..\packages\System.Buffers.4.5.1\lib\netstandard1.1\System.Buffers.dll - - - ..\..\..\..\..\packages\System.Diagnostics.DiagnosticSource.4.6.0\lib\net45\System.Diagnostics.DiagnosticSource.dll - - - True - - - ..\..\..\..\..\packages\System.Memory.4.5.4\lib\netstandard1.1\System.Memory.dll - - - - ..\..\..\..\..\packages\System.Runtime.CompilerServices.Unsafe.4.5.3\lib\netstandard1.0\System.Runtime.CompilerServices.Unsafe.dll - - - - - - ..\..\..\..\..\packages\xunit.abstractions.2.0.0\lib\net35\xunit.abstractions.dll - True - - - ..\..\..\..\..\packages\xunit.assert.2.1.0\lib\dotnet\xunit.assert.dll - True - - - ..\..\..\..\..\packages\xunit.extensibility.core.2.1.0\lib\dotnet\xunit.core.dll - True - - - ..\..\..\..\..\packages\xunit.extensibility.execution.2.1.0\lib\net45\xunit.execution.desktop.dll - True - - - - - False - Azure\Emulation\Microsoft.WindowsAzure.ServiceRuntime.dll - - - - - - - - - {e3d160e8-7f8c-416f-946f-6fdfc6787461} - Microsoft.ApplicationInsights - - - {94127fd9-e516-4891-98d4-ef7523117f32} - WindowsServer - - - - - - Designer - - - - - - - - - - - - - - - - - - - - Always - - - - - - - \ No newline at end of file diff --git a/WEB/Src/WindowsServer/WindowsServer.Net45.Tests/app.config b/WEB/Src/WindowsServer/WindowsServer.Net45.Tests/app.config deleted file mode 100644 index 249e3239f6..0000000000 --- a/WEB/Src/WindowsServer/WindowsServer.Net45.Tests/app.config +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/WEB/Src/WindowsServer/WindowsServer.Net45.Tests/packages.config b/WEB/Src/WindowsServer/WindowsServer.Net45.Tests/packages.config deleted file mode 100644 index dfd1ad6b71..0000000000 --- a/WEB/Src/WindowsServer/WindowsServer.Net45.Tests/packages.config +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/WEB/Src/WindowsServer/WindowsServer.Shared.Tests/WindowsServer.Shared.Tests.projitems b/WEB/Src/WindowsServer/WindowsServer.Shared.Tests/WindowsServer.Shared.Tests.projitems deleted file mode 100644 index adba80f665..0000000000 --- a/WEB/Src/WindowsServer/WindowsServer.Shared.Tests/WindowsServer.Shared.Tests.projitems +++ /dev/null @@ -1,26 +0,0 @@ - - - - $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - true - 7916ae39-ae89-4886-8842-33ac9883905a - - - Microsoft.ApplicationInsights.WindowsServer - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/WEB/Src/WindowsServer/WindowsServer.Shared.Tests/WindowsServer.Shared.Tests.shproj b/WEB/Src/WindowsServer/WindowsServer.Shared.Tests/WindowsServer.Shared.Tests.shproj deleted file mode 100644 index 5fa1b5ba38..0000000000 --- a/WEB/Src/WindowsServer/WindowsServer.Shared.Tests/WindowsServer.Shared.Tests.shproj +++ /dev/null @@ -1,15 +0,0 @@ - - - - 7916ae39-ae89-4886-8842-33ac9883905a - - - - - - - - - - - diff --git a/WEB/Src/WindowsServer/WindowsServer.Shared/WindowsServer.Shared.projitems b/WEB/Src/WindowsServer/WindowsServer.Shared/WindowsServer.Shared.projitems deleted file mode 100644 index 0530cba0ed..0000000000 --- a/WEB/Src/WindowsServer/WindowsServer.Shared/WindowsServer.Shared.projitems +++ /dev/null @@ -1,45 +0,0 @@ - - - - $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - true - 579f42e8-b711-411e-be52-4a3fd208507f - - - Microsoft.ApplicationInsights.WindowsServer - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/WEB/Src/WindowsServer/WindowsServer.Shared/WindowsServer.Shared.shproj b/WEB/Src/WindowsServer/WindowsServer.Shared/WindowsServer.Shared.shproj deleted file mode 100644 index 143e8ea7fb..0000000000 --- a/WEB/Src/WindowsServer/WindowsServer.Shared/WindowsServer.Shared.shproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - 579f42e8-b711-411e-be52-4a3fd208507f - - - - - - - - diff --git a/WEB/Src/WindowsServer/WindowsServer.Shared.Tests/AppServicesHeartbeatTelemetryModuleTests.cs b/WEB/Src/WindowsServer/WindowsServer.Tests/AppServicesHeartbeatTelemetryModuleTests.cs similarity index 100% rename from WEB/Src/WindowsServer/WindowsServer.Shared.Tests/AppServicesHeartbeatTelemetryModuleTests.cs rename to WEB/Src/WindowsServer/WindowsServer.Tests/AppServicesHeartbeatTelemetryModuleTests.cs diff --git a/WEB/Src/WindowsServer/WindowsServer.Net45.Tests/Azure/Emulation/Microsoft.WindowsAzure.ServiceRuntime.dll b/WEB/Src/WindowsServer/WindowsServer.Tests/Azure/Emulation/Microsoft.WindowsAzure.ServiceRuntime.dll similarity index 100% rename from WEB/Src/WindowsServer/WindowsServer.Net45.Tests/Azure/Emulation/Microsoft.WindowsAzure.ServiceRuntime.dll rename to WEB/Src/WindowsServer/WindowsServer.Tests/Azure/Emulation/Microsoft.WindowsAzure.ServiceRuntime.dll diff --git a/WEB/Src/WindowsServer/WindowsServer.Net45.Tests/Azure/Emulation/TestAzureServiceRuntimeAssemblyLoader.cs b/WEB/Src/WindowsServer/WindowsServer.Tests/Azure/Emulation/TestAzureServiceRuntimeAssemblyLoader.cs similarity index 96% rename from WEB/Src/WindowsServer/WindowsServer.Net45.Tests/Azure/Emulation/TestAzureServiceRuntimeAssemblyLoader.cs rename to WEB/Src/WindowsServer/WindowsServer.Tests/Azure/Emulation/TestAzureServiceRuntimeAssemblyLoader.cs index e128dad952..9471f49e00 100644 --- a/WEB/Src/WindowsServer/WindowsServer.Net45.Tests/Azure/Emulation/TestAzureServiceRuntimeAssemblyLoader.cs +++ b/WEB/Src/WindowsServer/WindowsServer.Tests/Azure/Emulation/TestAzureServiceRuntimeAssemblyLoader.cs @@ -1,4 +1,5 @@ -namespace Microsoft.ApplicationInsights.WindowsServer.Azure.Emulation +#if NET45 +namespace Microsoft.ApplicationInsights.WindowsServer.Azure.Emulation { using System; using System.Globalization; @@ -47,3 +48,4 @@ public override bool ReadAndPopulateContextInformation(out string roleName, out } } } +#endif \ No newline at end of file diff --git a/WEB/Src/WindowsServer/WindowsServer.Net45.Tests/Azure/Emulation/TestRole.cs b/WEB/Src/WindowsServer/WindowsServer.Tests/Azure/Emulation/TestRole.cs similarity index 89% rename from WEB/Src/WindowsServer/WindowsServer.Net45.Tests/Azure/Emulation/TestRole.cs rename to WEB/Src/WindowsServer/WindowsServer.Tests/Azure/Emulation/TestRole.cs index 39fad212f6..76627456d0 100644 --- a/WEB/Src/WindowsServer/WindowsServer.Net45.Tests/Azure/Emulation/TestRole.cs +++ b/WEB/Src/WindowsServer/WindowsServer.Tests/Azure/Emulation/TestRole.cs @@ -1,4 +1,5 @@ -namespace Microsoft.ApplicationInsights.WindowsServer.Azure.Emulation +#if NET45 +namespace Microsoft.ApplicationInsights.WindowsServer.Azure.Emulation { using System; @@ -31,3 +32,4 @@ public override string Name } } } +#endif \ No newline at end of file diff --git a/WEB/Src/WindowsServer/WindowsServer.Net45.Tests/Azure/Emulation/TestRoleInstance.cs b/WEB/Src/WindowsServer/WindowsServer.Tests/Azure/Emulation/TestRoleInstance.cs similarity index 94% rename from WEB/Src/WindowsServer/WindowsServer.Net45.Tests/Azure/Emulation/TestRoleInstance.cs rename to WEB/Src/WindowsServer/WindowsServer.Tests/Azure/Emulation/TestRoleInstance.cs index f329e64e46..ec9ca4b36e 100644 --- a/WEB/Src/WindowsServer/WindowsServer.Net45.Tests/Azure/Emulation/TestRoleInstance.cs +++ b/WEB/Src/WindowsServer/WindowsServer.Tests/Azure/Emulation/TestRoleInstance.cs @@ -1,4 +1,5 @@ -namespace Microsoft.ApplicationInsights.WindowsServer.Azure.Emulation +#if NET45 +namespace Microsoft.ApplicationInsights.WindowsServer.Azure.Emulation { using System; using System.Globalization; @@ -52,3 +53,4 @@ public override Azure.Role Role } } } +#endif \ No newline at end of file diff --git a/WEB/Src/WindowsServer/WindowsServer.Net45.Tests/Azure/ServiceRuntimeHelper.cs b/WEB/Src/WindowsServer/WindowsServer.Tests/Azure/ServiceRuntimeHelper.cs similarity index 97% rename from WEB/Src/WindowsServer/WindowsServer.Net45.Tests/Azure/ServiceRuntimeHelper.cs rename to WEB/Src/WindowsServer/WindowsServer.Tests/Azure/ServiceRuntimeHelper.cs index 63bebd5fab..82374b7956 100644 --- a/WEB/Src/WindowsServer/WindowsServer.Net45.Tests/Azure/ServiceRuntimeHelper.cs +++ b/WEB/Src/WindowsServer/WindowsServer.Tests/Azure/ServiceRuntimeHelper.cs @@ -1,4 +1,5 @@ -namespace Microsoft.ApplicationInsights.WindowsServer.Azure +#if NET45 +namespace Microsoft.ApplicationInsights.WindowsServer.Azure { using System; using System.IO; @@ -57,3 +58,4 @@ static ServiceRuntimeHelper() public static string TestWithServiceRuntimePath { get; set; } } } +#endif \ No newline at end of file diff --git a/WEB/Src/WindowsServer/WindowsServer.Shared.Tests/AzureInstanceMetadataEndToEndTests.cs b/WEB/Src/WindowsServer/WindowsServer.Tests/AzureInstanceMetadataEndToEndTests.cs similarity index 99% rename from WEB/Src/WindowsServer/WindowsServer.Shared.Tests/AzureInstanceMetadataEndToEndTests.cs rename to WEB/Src/WindowsServer/WindowsServer.Tests/AzureInstanceMetadataEndToEndTests.cs index c98bb662fa..a2350c4113 100644 --- a/WEB/Src/WindowsServer/WindowsServer.Shared.Tests/AzureInstanceMetadataEndToEndTests.cs +++ b/WEB/Src/WindowsServer/WindowsServer.Tests/AzureInstanceMetadataEndToEndTests.cs @@ -9,7 +9,7 @@ namespace Microsoft.ApplicationInsights.WindowsServer using Microsoft.ApplicationInsights.WindowsServer.Implementation; using Microsoft.ApplicationInsights.WindowsServer.Implementation.DataContracts; using Microsoft.ApplicationInsights.WindowsServer.Mock; -#if NETCORE +#if NETCOREAPP using Microsoft.AspNetCore.Http; #endif using Microsoft.VisualStudio.TestTools.UnitTesting; diff --git a/WEB/Src/WindowsServer/WindowsServer.Shared.Tests/AzureInstanceMetadataTests.cs b/WEB/Src/WindowsServer/WindowsServer.Tests/AzureInstanceMetadataTests.cs similarity index 100% rename from WEB/Src/WindowsServer/WindowsServer.Shared.Tests/AzureInstanceMetadataTests.cs rename to WEB/Src/WindowsServer/WindowsServer.Tests/AzureInstanceMetadataTests.cs diff --git a/WEB/Src/WindowsServer/WindowsServer.Net45.Tests/AzureRoleEnvironmentTelemetryInitializerTest.cs b/WEB/Src/WindowsServer/WindowsServer.Tests/AzureRoleEnvironmentTelemetryInitializerTest.cs similarity index 94% rename from WEB/Src/WindowsServer/WindowsServer.Net45.Tests/AzureRoleEnvironmentTelemetryInitializerTest.cs rename to WEB/Src/WindowsServer/WindowsServer.Tests/AzureRoleEnvironmentTelemetryInitializerTest.cs index c045607dbc..4986f15b6d 100644 --- a/WEB/Src/WindowsServer/WindowsServer.Net45.Tests/AzureRoleEnvironmentTelemetryInitializerTest.cs +++ b/WEB/Src/WindowsServer/WindowsServer.Tests/AzureRoleEnvironmentTelemetryInitializerTest.cs @@ -1,10 +1,11 @@ -namespace Microsoft.ApplicationInsights.WindowsServer -{ +#if NET45 +namespace Microsoft.ApplicationInsights.WindowsServer +{ using System; using System.Diagnostics.Tracing; using System.Globalization; using System.IO; - using System.Linq; + using System.Linq; using Microsoft.ApplicationInsights.DataContracts; using Microsoft.ApplicationInsights.Extensibility.Implementation; using Microsoft.ApplicationInsights.WindowsServer.Azure; @@ -16,7 +17,7 @@ [TestClass] public class AzureRoleEnvironmentTelemetryInitializerTest - { + { [TestMethod] public void AzureRoleEnvironmentTelemetryInitializerDoesNotOverrideRoleName() { @@ -32,7 +33,7 @@ public void AzureRoleEnvironmentTelemetryInitializerDoesNotOverrideRoleName() [TestMethod] public void AzureRoleEnvironmentTelemetryInitializerDoesNotOverrideRoleInstance() { - var telemetryItem = new EventTelemetry(); + var telemetryItem = new EventTelemetry(); AzureRoleEnvironmentTelemetryInitializer initializer = new AzureRoleEnvironmentTelemetryInitializer(); telemetryItem.Context.Cloud.RoleInstance = "Test"; initializer.Initialize(telemetryItem); @@ -54,7 +55,7 @@ public void AzureRoleEnvironmentTelemetryInitializerDoesNotOverrideNodeName() [TestMethod] public void AzureRoleEnvironmentTelemetryInitializerSetsTelemetryContextPropertiesToNullWhenNotRunningInsideAzureCloudService() - { + { // This test asssumes that it is not running inside a cloud service. // Its Ok even if Azure ServiceRunTime dlls are in the GAC, as IsAvailable() will return false, and hence // no context will be further attempted to be read. @@ -62,7 +63,7 @@ public void AzureRoleEnvironmentTelemetryInitializerSetsTelemetryContextProperti AzureRoleEnvironmentContextReader.Instance = null; AzureRoleEnvironmentContextReader.AssemblyLoaderType = null; AzureRoleEnvironmentTelemetryInitializer initializer = new AzureRoleEnvironmentTelemetryInitializer(); - initializer.Initialize(telemetryItem); + initializer.Initialize(telemetryItem); Assert.Null(telemetryItem.Context.Cloud.RoleName); Assert.Null(telemetryItem.Context.Cloud.RoleInstance); @@ -93,13 +94,15 @@ public void AzureRoleEnvironmentTelemetryInitializerDoNotPopulateContextIfRunnin } } - [TestMethod] + [TestMethod] [Description("Validates that requested DLL was loaded into separate AppDomain and not to the current domain. This test will fail if not run with admin privileges.")] public void AzureRoleEnvironmentTelemetryInitializerLoadDllToSeparateAppDomain() { // A random dll which is not already loaded to the current AppDomain but dropped into bin folder. string dllPath = Path.Combine(AppDomain.CurrentDomain.SetupInformation.ApplicationBase, "Microsoft.ApplicationInsights.Log4NetAppender.dll"); - + + Assert.True(File.Exists(dllPath)); + try { // Publish the dll to GAC to give a chance for AzureRoleEnvironmentTelemetryInitializer to load it to a new AppDomain @@ -108,7 +111,7 @@ public void AzureRoleEnvironmentTelemetryInitializerLoadDllToSeparateAppDomain() // Validate that the dll is not loaded to test AppDomaion to begin with. var retrievedAssembly = AppDomain.CurrentDomain.GetAssemblies().FirstOrDefault(item => string.Equals(item.GetName().Name, "Microsoft.ApplicationInsights.Log4NetAppender", StringComparison.OrdinalIgnoreCase)); Assert.Null(retrievedAssembly); - + // TestAssemblyLoader will load a random assembly (Microsoft.ApplicationInsights.Log4NetAppender.dll) and populate TestRoleName, TestRoleInstanceId into the fields. AzureRoleEnvironmentContextReader.AssemblyLoaderType = typeof(TestAzureServiceRuntimeAssemblyLoader); AzureRoleEnvironmentContextReader.Instance = null; @@ -124,7 +127,7 @@ public void AzureRoleEnvironmentTelemetryInitializerLoadDllToSeparateAppDomain() var telemetryItem = new EventTelemetry(); initializer.Initialize(telemetryItem); Assert.Equal("TestRoleName", telemetryItem.Context.Cloud.RoleName); - Assert.Equal("TestRoleInstanceId", telemetryItem.Context.Cloud.RoleInstance); + Assert.Equal("TestRoleInstanceId", telemetryItem.Context.Cloud.RoleInstance); } finally { @@ -133,3 +136,4 @@ public void AzureRoleEnvironmentTelemetryInitializerLoadDllToSeparateAppDomain() } } } +#endif \ No newline at end of file diff --git a/WEB/Src/WindowsServer/WindowsServer.Shared.Tests/AzureWebAppRoleEnvironmentTelemetryInitializerTest.cs b/WEB/Src/WindowsServer/WindowsServer.Tests/AzureWebAppRoleEnvironmentTelemetryInitializerTest.cs similarity index 94% rename from WEB/Src/WindowsServer/WindowsServer.Shared.Tests/AzureWebAppRoleEnvironmentTelemetryInitializerTest.cs rename to WEB/Src/WindowsServer/WindowsServer.Tests/AzureWebAppRoleEnvironmentTelemetryInitializerTest.cs index cdfc7f7cc3..ca56f722b0 100644 --- a/WEB/Src/WindowsServer/WindowsServer.Shared.Tests/AzureWebAppRoleEnvironmentTelemetryInitializerTest.cs +++ b/WEB/Src/WindowsServer/WindowsServer.Tests/AzureWebAppRoleEnvironmentTelemetryInitializerTest.cs @@ -1,18 +1,12 @@ namespace Microsoft.ApplicationInsights.WindowsServer { using System; - using System.Globalization; using Microsoft.ApplicationInsights.DataContracts; using Microsoft.ApplicationInsights.Extensibility.Implementation; -#if !NETCORE - using Microsoft.ApplicationInsights.WindowsServer.Azure; - using Microsoft.ApplicationInsights.WindowsServer.Azure.Emulation; -#endif - using Microsoft.ApplicationInsights.WindowsServer.Implementation; using Microsoft.VisualStudio.TestTools.UnitTesting; using Assert = Xunit.Assert; - + [TestClass] public class AzureWebAppRoleEnvironmentTelemetryInitializerTest { diff --git a/WEB/Src/WindowsServer/WindowsServer.Shared.Tests/BuildInfoConfigComponentVersionTelemetryInitializerTest.cs b/WEB/Src/WindowsServer/WindowsServer.Tests/BuildInfoConfigComponentVersionTelemetryInitializerTest.cs similarity index 100% rename from WEB/Src/WindowsServer/WindowsServer.Shared.Tests/BuildInfoConfigComponentVersionTelemetryInitializerTest.cs rename to WEB/Src/WindowsServer/WindowsServer.Tests/BuildInfoConfigComponentVersionTelemetryInitializerTest.cs diff --git a/WEB/Src/WindowsServer/WindowsServer.Shared.Tests/DeveloperModeWithDebuggerAttachedTelemetryModuleTest.cs b/WEB/Src/WindowsServer/WindowsServer.Tests/DeveloperModeWithDebuggerAttachedTelemetryModuleTest.cs similarity index 100% rename from WEB/Src/WindowsServer/WindowsServer.Shared.Tests/DeveloperModeWithDebuggerAttachedTelemetryModuleTest.cs rename to WEB/Src/WindowsServer/WindowsServer.Tests/DeveloperModeWithDebuggerAttachedTelemetryModuleTest.cs diff --git a/WEB/Src/WindowsServer/WindowsServer.Net45.Tests/DeviceTelemetryInitializerTest.cs b/WEB/Src/WindowsServer/WindowsServer.Tests/DeviceTelemetryInitializerTest.cs similarity index 94% rename from WEB/Src/WindowsServer/WindowsServer.Net45.Tests/DeviceTelemetryInitializerTest.cs rename to WEB/Src/WindowsServer/WindowsServer.Tests/DeviceTelemetryInitializerTest.cs index 863b54160e..2e86922858 100644 --- a/WEB/Src/WindowsServer/WindowsServer.Net45.Tests/DeviceTelemetryInitializerTest.cs +++ b/WEB/Src/WindowsServer/WindowsServer.Tests/DeviceTelemetryInitializerTest.cs @@ -1,4 +1,5 @@ -namespace Microsoft.ApplicationInsights.WindowsServer +#if NET45 +namespace Microsoft.ApplicationInsights.WindowsServer { using System; using System.Globalization; @@ -35,3 +36,4 @@ public void ReadingDeviceUniqueIdYieldsCorrectValue() } } } +#endif \ No newline at end of file diff --git a/WEB/Src/WindowsServer/WindowsServer.Shared.Tests/EnvironmentVariableMonitorTests.cs b/WEB/Src/WindowsServer/WindowsServer.Tests/EnvironmentVariableMonitorTests.cs similarity index 100% rename from WEB/Src/WindowsServer/WindowsServer.Shared.Tests/EnvironmentVariableMonitorTests.cs rename to WEB/Src/WindowsServer/WindowsServer.Tests/EnvironmentVariableMonitorTests.cs diff --git a/WEB/Src/WindowsServer/WindowsServer.Net45.Tests/FirstChanceExceptionStatisticsTelemetryModuleTest.cs b/WEB/Src/WindowsServer/WindowsServer.Tests/FirstChanceExceptionStatisticsTelemetryModuleTest.cs similarity index 99% rename from WEB/Src/WindowsServer/WindowsServer.Net45.Tests/FirstChanceExceptionStatisticsTelemetryModuleTest.cs rename to WEB/Src/WindowsServer/WindowsServer.Tests/FirstChanceExceptionStatisticsTelemetryModuleTest.cs index 16199088b7..065414f1ca 100644 --- a/WEB/Src/WindowsServer/WindowsServer.Net45.Tests/FirstChanceExceptionStatisticsTelemetryModuleTest.cs +++ b/WEB/Src/WindowsServer/WindowsServer.Tests/FirstChanceExceptionStatisticsTelemetryModuleTest.cs @@ -1,4 +1,5 @@ -namespace Microsoft.ApplicationInsights.WindowsServer +#if NET45 +namespace Microsoft.ApplicationInsights.WindowsServer { using System; using System.Collections.Concurrent; @@ -850,3 +851,4 @@ public void Track(Metric metric, double value) } } } +#endif \ No newline at end of file diff --git a/WEB/Src/WindowsServer/WindowsServer.Net45.Tests/Implementation/ServiceRuntimeTests.cs b/WEB/Src/WindowsServer/WindowsServer.Tests/Implementation/ServiceRuntimeTests.cs similarity index 98% rename from WEB/Src/WindowsServer/WindowsServer.Net45.Tests/Implementation/ServiceRuntimeTests.cs rename to WEB/Src/WindowsServer/WindowsServer.Tests/Implementation/ServiceRuntimeTests.cs index 9bd0e43149..bbcb266a32 100644 --- a/WEB/Src/WindowsServer/WindowsServer.Net45.Tests/Implementation/ServiceRuntimeTests.cs +++ b/WEB/Src/WindowsServer/WindowsServer.Tests/Implementation/ServiceRuntimeTests.cs @@ -1,4 +1,5 @@ -namespace Microsoft.ApplicationInsights.WindowsServer.Implementation +#if NET45 +namespace Microsoft.ApplicationInsights.WindowsServer.Implementation { using System; using System.Globalization; @@ -147,3 +148,4 @@ public void RoleReturnsCorrectName() } } } +#endif \ No newline at end of file diff --git a/WEB/Src/WindowsServer/WindowsServer.Net45.Tests/Implementation/WindowsServerEventSourceTests.cs b/WEB/Src/WindowsServer/WindowsServer.Tests/Implementation/WindowsServerEventSourceTests.cs similarity index 82% rename from WEB/Src/WindowsServer/WindowsServer.Net45.Tests/Implementation/WindowsServerEventSourceTests.cs rename to WEB/Src/WindowsServer/WindowsServer.Tests/Implementation/WindowsServerEventSourceTests.cs index 9134307bf5..a600243fa9 100644 --- a/WEB/Src/WindowsServer/WindowsServer.Net45.Tests/Implementation/WindowsServerEventSourceTests.cs +++ b/WEB/Src/WindowsServer/WindowsServer.Tests/Implementation/WindowsServerEventSourceTests.cs @@ -1,4 +1,5 @@ -namespace Microsoft.ApplicationInsights.WindowsServer.Implementation +#if NET45 +namespace Microsoft.ApplicationInsights.WindowsServer.Implementation { using Microsoft.ApplicationInsights.Web.TestFramework; using Microsoft.VisualStudio.TestTools.UnitTesting; @@ -13,3 +14,4 @@ public void MethodsAreImplementedConsistentlyWithTheirAttributes() } } } +#endif \ No newline at end of file diff --git a/WEB/Src/WindowsServer/WindowsServer.Net45.Tests/Microsoft.ApplicationInsights.Log4NetAppender.dll b/WEB/Src/WindowsServer/WindowsServer.Tests/Microsoft.ApplicationInsights.Log4NetAppender.dll similarity index 100% rename from WEB/Src/WindowsServer/WindowsServer.Net45.Tests/Microsoft.ApplicationInsights.Log4NetAppender.dll rename to WEB/Src/WindowsServer/WindowsServer.Tests/Microsoft.ApplicationInsights.Log4NetAppender.dll diff --git a/WEB/Src/WindowsServer/WindowsServer.Shared.Tests/Mock/AzureInstanceMetadataRequestMock.cs b/WEB/Src/WindowsServer/WindowsServer.Tests/Mock/AzureInstanceMetadataRequestMock.cs similarity index 100% rename from WEB/Src/WindowsServer/WindowsServer.Shared.Tests/Mock/AzureInstanceMetadataRequestMock.cs rename to WEB/Src/WindowsServer/WindowsServer.Tests/Mock/AzureInstanceMetadataRequestMock.cs diff --git a/WEB/Src/WindowsServer/WindowsServer.Shared.Tests/Mock/AzureInstanceMetadataServiceMock.cs b/WEB/Src/WindowsServer/WindowsServer.Tests/Mock/AzureInstanceMetadataServiceMock.cs similarity index 97% rename from WEB/Src/WindowsServer/WindowsServer.Shared.Tests/Mock/AzureInstanceMetadataServiceMock.cs rename to WEB/Src/WindowsServer/WindowsServer.Tests/Mock/AzureInstanceMetadataServiceMock.cs index c46afa886c..4c10eed169 100644 --- a/WEB/Src/WindowsServer/WindowsServer.Shared.Tests/Mock/AzureInstanceMetadataServiceMock.cs +++ b/WEB/Src/WindowsServer/WindowsServer.Tests/Mock/AzureInstanceMetadataServiceMock.cs @@ -4,7 +4,7 @@ using System.Net; using System.Threading; using System.Threading.Tasks; -#if NETCORE +#if NETCOREAPP using System.Collections.Generic; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; @@ -13,14 +13,14 @@ internal class AzureInstanceMetadataServiceMock : IDisposable { -#if NETCORE +#if NETCOREAPP private readonly IWebHost host; #else private readonly HttpListener listener; #endif private readonly CancellationTokenSource cts; -#if NETCORE +#if NETCOREAPP internal AzureInstanceMetadataServiceMock(string baseUrl, string testName, Action onRequest = null) { @@ -72,7 +72,7 @@ internal AzureInstanceMetadataServiceMock(string url, string testName, Action internal static class NetPlatformHttpResponseTypesExtension { -#if NETCORE +#if NETCOREAPP public static void SetContentLength(this HttpResponse resp, long len) { @@ -44,8 +44,6 @@ public static void SetContentEncoding(this HttpListenerResponse resp, Encoding e { resp.ContentEncoding = enc; } -#else -#error Unkown framework #endif } } diff --git a/WEB/Src/WindowsServer/WindowsServer.Net45.Tests/UnhandledExceptionTelemetryModuleTest.cs b/WEB/Src/WindowsServer/WindowsServer.Tests/UnhandledExceptionTelemetryModuleTest.cs similarity index 98% rename from WEB/Src/WindowsServer/WindowsServer.Net45.Tests/UnhandledExceptionTelemetryModuleTest.cs rename to WEB/Src/WindowsServer/WindowsServer.Tests/UnhandledExceptionTelemetryModuleTest.cs index a5652c45bc..5223826da0 100644 --- a/WEB/Src/WindowsServer/WindowsServer.Net45.Tests/UnhandledExceptionTelemetryModuleTest.cs +++ b/WEB/Src/WindowsServer/WindowsServer.Tests/UnhandledExceptionTelemetryModuleTest.cs @@ -1,4 +1,5 @@ -namespace Microsoft.ApplicationInsights.WindowsServer +#if NET45 +namespace Microsoft.ApplicationInsights.WindowsServer { using System; using System.Collections.Generic; @@ -13,10 +14,7 @@ using Microsoft.ApplicationInsights.Web.TestFramework; using Microsoft.VisualStudio.TestTools.UnitTesting; using Assert = Xunit.Assert; - -#if NET45 using TaskEx = System.Threading.Tasks.Task; -#endif [TestClass] public class UnhandledExceptionTelemetryModuleTest @@ -193,3 +191,4 @@ public void FlushIsCalledToBeSureDataIsSent() } } } +#endif \ No newline at end of file diff --git a/WEB/Src/WindowsServer/WindowsServer.Shared.Tests/UnobservedExceptionTelemetryModuleTest.cs b/WEB/Src/WindowsServer/WindowsServer.Tests/UnobservedExceptionTelemetryModuleTest.cs similarity index 100% rename from WEB/Src/WindowsServer/WindowsServer.Shared.Tests/UnobservedExceptionTelemetryModuleTest.cs rename to WEB/Src/WindowsServer/WindowsServer.Tests/UnobservedExceptionTelemetryModuleTest.cs diff --git a/WEB/Src/WindowsServer/WindowsServer.NetCore.Tests/WindowsServer.NetCore.Tests.csproj b/WEB/Src/WindowsServer/WindowsServer.Tests/WindowsServer.Tests.csproj similarity index 51% rename from WEB/Src/WindowsServer/WindowsServer.NetCore.Tests/WindowsServer.NetCore.Tests.csproj rename to WEB/Src/WindowsServer/WindowsServer.Tests/WindowsServer.Tests.csproj index 6bf8b6af55..75b953f5c0 100644 --- a/WEB/Src/WindowsServer/WindowsServer.NetCore.Tests/WindowsServer.NetCore.Tests.csproj +++ b/WEB/Src/WindowsServer/WindowsServer.Tests/WindowsServer.Tests.csproj @@ -3,35 +3,24 @@ - + - Microsoft.AI.WindowsServer.NetCore.Tests - Microsoft.AI.WindowsServer.NetCore.Tests + Microsoft.AI.WindowsServer.Tests + Microsoft.AI.WindowsServer.Tests true true true Microsoft.ApplicationInsights.Tests - netcoreapp2.1 - - - - 1701;1702;1705;1591 - TRACE;RELEASE;NETCORE;NETCOREAPP1_0 + net45;netcoreapp2.1;netcoreapp3.1 - - 1701;1702;1705;1591 - TRACE;DEBUG;NETCORE;NETCOREAPP1_0 - + + - - - - - - + + @@ -39,16 +28,43 @@ - - + + + + True + + + + + + + + Azure\Emulation\Microsoft.WindowsAzure.ServiceRuntime.dll + + + + + + + + + + + + + - + + + Always + + - + diff --git a/WEB/Src/WindowsServer/WindowsServer.Shared/AppServicesHeartbeatTelemetryModule.cs b/WEB/Src/WindowsServer/WindowsServer/AppServicesHeartbeatTelemetryModule.cs similarity index 100% rename from WEB/Src/WindowsServer/WindowsServer.Shared/AppServicesHeartbeatTelemetryModule.cs rename to WEB/Src/WindowsServer/WindowsServer/AppServicesHeartbeatTelemetryModule.cs diff --git a/WEB/Src/WindowsServer/WindowsServer.Shared/AssemblyInfo.cs b/WEB/Src/WindowsServer/WindowsServer/AssemblyInfo.cs similarity index 86% rename from WEB/Src/WindowsServer/WindowsServer.Shared/AssemblyInfo.cs rename to WEB/Src/WindowsServer/WindowsServer/AssemblyInfo.cs index cbf495db29..8af7f281e9 100644 --- a/WEB/Src/WindowsServer/WindowsServer.Shared/AssemblyInfo.cs +++ b/WEB/Src/WindowsServer/WindowsServer/AssemblyInfo.cs @@ -1,8 +1,7 @@ using System.Reflection; using System.Runtime.CompilerServices; -[assembly: InternalsVisibleTo("WindowsServer.Net45.Tests, PublicKey=" + AssemblyInfo.PublicKey)] -[assembly: InternalsVisibleTo("Microsoft.AI.WindowsServer.NetCore.Tests, PublicKey=" + AssemblyInfo.PublicKey)] +[assembly: InternalsVisibleTo("Microsoft.AI.WindowsServer.Tests, PublicKey=" + AssemblyInfo.PublicKey)] internal static class AssemblyInfo { diff --git a/WEB/Src/WindowsServer/WindowsServer.Shared/AzureInstanceMetadataTelemetryModule.cs b/WEB/Src/WindowsServer/WindowsServer/AzureInstanceMetadataTelemetryModule.cs similarity index 100% rename from WEB/Src/WindowsServer/WindowsServer.Shared/AzureInstanceMetadataTelemetryModule.cs rename to WEB/Src/WindowsServer/WindowsServer/AzureInstanceMetadataTelemetryModule.cs diff --git a/WEB/Src/WindowsServer/WindowsServer.Shared/AzureRoleEnvironmentTelemetryInitializer.cs b/WEB/Src/WindowsServer/WindowsServer/AzureRoleEnvironmentTelemetryInitializer.cs similarity index 98% rename from WEB/Src/WindowsServer/WindowsServer.Shared/AzureRoleEnvironmentTelemetryInitializer.cs rename to WEB/Src/WindowsServer/WindowsServer/AzureRoleEnvironmentTelemetryInitializer.cs index 6d603be4c9..fafbfe806d 100644 --- a/WEB/Src/WindowsServer/WindowsServer.Shared/AzureRoleEnvironmentTelemetryInitializer.cs +++ b/WEB/Src/WindowsServer/WindowsServer/AzureRoleEnvironmentTelemetryInitializer.cs @@ -1,4 +1,5 @@ -namespace Microsoft.ApplicationInsights.WindowsServer +#if NET45 +namespace Microsoft.ApplicationInsights.WindowsServer { using System; using Microsoft.ApplicationInsights.Channel; @@ -91,3 +92,4 @@ private bool IsAppRunningInAzureWebApp() } } } +#endif \ No newline at end of file diff --git a/WEB/Src/WindowsServer/WindowsServer.Shared/AzureWebAppRoleEnvironmentTelemetryInitializer.cs b/WEB/Src/WindowsServer/WindowsServer/AzureWebAppRoleEnvironmentTelemetryInitializer.cs similarity index 100% rename from WEB/Src/WindowsServer/WindowsServer.Shared/AzureWebAppRoleEnvironmentTelemetryInitializer.cs rename to WEB/Src/WindowsServer/WindowsServer/AzureWebAppRoleEnvironmentTelemetryInitializer.cs diff --git a/WEB/Src/WindowsServer/WindowsServer.Shared/BuildInfoConfigComponentVersionTelemetryInitializer.cs b/WEB/Src/WindowsServer/WindowsServer/BuildInfoConfigComponentVersionTelemetryInitializer.cs similarity index 100% rename from WEB/Src/WindowsServer/WindowsServer.Shared/BuildInfoConfigComponentVersionTelemetryInitializer.cs rename to WEB/Src/WindowsServer/WindowsServer/BuildInfoConfigComponentVersionTelemetryInitializer.cs diff --git a/WEB/Src/WindowsServer/WindowsServer.Shared/DeveloperModeWithDebuggerAttachedTelemetryModule.cs b/WEB/Src/WindowsServer/WindowsServer/DeveloperModeWithDebuggerAttachedTelemetryModule.cs similarity index 100% rename from WEB/Src/WindowsServer/WindowsServer.Shared/DeveloperModeWithDebuggerAttachedTelemetryModule.cs rename to WEB/Src/WindowsServer/WindowsServer/DeveloperModeWithDebuggerAttachedTelemetryModule.cs diff --git a/WEB/Src/WindowsServer/WindowsServer.Shared/DeviceTelemetryInitializer.cs b/WEB/Src/WindowsServer/WindowsServer/DeviceTelemetryInitializer.cs similarity index 94% rename from WEB/Src/WindowsServer/WindowsServer.Shared/DeviceTelemetryInitializer.cs rename to WEB/Src/WindowsServer/WindowsServer/DeviceTelemetryInitializer.cs index 4a88514184..e1f0766043 100644 --- a/WEB/Src/WindowsServer/WindowsServer.Shared/DeviceTelemetryInitializer.cs +++ b/WEB/Src/WindowsServer/WindowsServer/DeviceTelemetryInitializer.cs @@ -1,4 +1,5 @@ -namespace Microsoft.ApplicationInsights.WindowsServer +#if NET45 +namespace Microsoft.ApplicationInsights.WindowsServer { using System; using Microsoft.ApplicationInsights.Channel; @@ -31,3 +32,4 @@ public void Initialize(ITelemetry telemetry) } } } +#endif \ No newline at end of file diff --git a/WEB/Src/WindowsServer/WindowsServer.Shared/DomainNameRoleInstanceTelemetryInitializer.cs b/WEB/Src/WindowsServer/WindowsServer/DomainNameRoleInstanceTelemetryInitializer.cs similarity index 100% rename from WEB/Src/WindowsServer/WindowsServer.Shared/DomainNameRoleInstanceTelemetryInitializer.cs rename to WEB/Src/WindowsServer/WindowsServer/DomainNameRoleInstanceTelemetryInitializer.cs diff --git a/WEB/Src/WindowsServer/WindowsServer.Shared/FirstChanceExceptionStatisticsTelemetryModule.cs b/WEB/Src/WindowsServer/WindowsServer/FirstChanceExceptionStatisticsTelemetryModule.cs similarity index 99% rename from WEB/Src/WindowsServer/WindowsServer.Shared/FirstChanceExceptionStatisticsTelemetryModule.cs rename to WEB/Src/WindowsServer/WindowsServer/FirstChanceExceptionStatisticsTelemetryModule.cs index 730fed55f5..d8a827e835 100644 --- a/WEB/Src/WindowsServer/WindowsServer.Shared/FirstChanceExceptionStatisticsTelemetryModule.cs +++ b/WEB/Src/WindowsServer/WindowsServer/FirstChanceExceptionStatisticsTelemetryModule.cs @@ -1,4 +1,5 @@ -namespace Microsoft.ApplicationInsights.WindowsServer +#if NET45 +namespace Microsoft.ApplicationInsights.WindowsServer { using System; using System.Collections.Generic; @@ -508,3 +509,4 @@ protected virtual void Dispose(bool disposing) } } } +#endif \ No newline at end of file diff --git a/WEB/Src/WindowsServer/WindowsServer.Shared/GlobalSuppressions.cs b/WEB/Src/WindowsServer/WindowsServer/GlobalSuppressions.cs similarity index 100% rename from WEB/Src/WindowsServer/WindowsServer.Shared/GlobalSuppressions.cs rename to WEB/Src/WindowsServer/WindowsServer/GlobalSuppressions.cs diff --git a/WEB/Src/WindowsServer/WindowsServer.Shared/Implementation/AppServiceEnvironmentVariableMonitor.cs b/WEB/Src/WindowsServer/WindowsServer/Implementation/AppServiceEnvironmentVariableMonitor.cs similarity index 100% rename from WEB/Src/WindowsServer/WindowsServer.Shared/Implementation/AppServiceEnvironmentVariableMonitor.cs rename to WEB/Src/WindowsServer/WindowsServer/Implementation/AppServiceEnvironmentVariableMonitor.cs diff --git a/WEB/Src/WindowsServer/WindowsServer.Shared/Implementation/AzureComputeMetadataHeartbeatPropertyProvider.cs b/WEB/Src/WindowsServer/WindowsServer/Implementation/AzureComputeMetadataHeartbeatPropertyProvider.cs similarity index 100% rename from WEB/Src/WindowsServer/WindowsServer.Shared/Implementation/AzureComputeMetadataHeartbeatPropertyProvider.cs rename to WEB/Src/WindowsServer/WindowsServer/Implementation/AzureComputeMetadataHeartbeatPropertyProvider.cs diff --git a/WEB/Src/WindowsServer/WindowsServer.Shared/Implementation/AzureMetadataRequestor.cs b/WEB/Src/WindowsServer/WindowsServer/Implementation/AzureMetadataRequestor.cs similarity index 100% rename from WEB/Src/WindowsServer/WindowsServer.Shared/Implementation/AzureMetadataRequestor.cs rename to WEB/Src/WindowsServer/WindowsServer/Implementation/AzureMetadataRequestor.cs diff --git a/WEB/Src/WindowsServer/WindowsServer.Shared/Implementation/AzureRoleEnvironmentContextReader.cs b/WEB/Src/WindowsServer/WindowsServer/Implementation/AzureRoleEnvironmentContextReader.cs similarity index 98% rename from WEB/Src/WindowsServer/WindowsServer.Shared/Implementation/AzureRoleEnvironmentContextReader.cs rename to WEB/Src/WindowsServer/WindowsServer/Implementation/AzureRoleEnvironmentContextReader.cs index f6c3a77895..46741b5138 100644 --- a/WEB/Src/WindowsServer/WindowsServer.Shared/Implementation/AzureRoleEnvironmentContextReader.cs +++ b/WEB/Src/WindowsServer/WindowsServer/Implementation/AzureRoleEnvironmentContextReader.cs @@ -1,4 +1,5 @@ -namespace Microsoft.ApplicationInsights.WindowsServer.Implementation +#if NET45 +namespace Microsoft.ApplicationInsights.WindowsServer.Implementation { using System; using System.Diagnostics; @@ -144,3 +145,4 @@ public string GetRoleInstanceName() } } } +#endif \ No newline at end of file diff --git a/WEB/Src/WindowsServer/WindowsServer.Shared/Implementation/AzureServiceRuntimeAssemblyLoader.cs b/WEB/Src/WindowsServer/WindowsServer/Implementation/AzureServiceRuntimeAssemblyLoader.cs similarity index 97% rename from WEB/Src/WindowsServer/WindowsServer.Shared/Implementation/AzureServiceRuntimeAssemblyLoader.cs rename to WEB/Src/WindowsServer/WindowsServer/Implementation/AzureServiceRuntimeAssemblyLoader.cs index 3568564f27..d8ca06688b 100644 --- a/WEB/Src/WindowsServer/WindowsServer.Shared/Implementation/AzureServiceRuntimeAssemblyLoader.cs +++ b/WEB/Src/WindowsServer/WindowsServer/Implementation/AzureServiceRuntimeAssemblyLoader.cs @@ -1,4 +1,5 @@ -namespace Microsoft.ApplicationInsights.WindowsServer.Implementation +#if NET45 +namespace Microsoft.ApplicationInsights.WindowsServer.Implementation { using System; using System.Globalization; @@ -86,3 +87,4 @@ protected static Assembly AttemptToLoadAssembly(AssemblyName assemblyNameToLoad, } } } +#endif \ No newline at end of file diff --git a/WEB/Src/WindowsServer/WindowsServer.Shared/Implementation/DataContracts/AzureInstanceComputeMetadata.cs b/WEB/Src/WindowsServer/WindowsServer/Implementation/DataContracts/AzureInstanceComputeMetadata.cs similarity index 100% rename from WEB/Src/WindowsServer/WindowsServer.Shared/Implementation/DataContracts/AzureInstanceComputeMetadata.cs rename to WEB/Src/WindowsServer/WindowsServer/Implementation/DataContracts/AzureInstanceComputeMetadata.cs diff --git a/WEB/Src/WindowsServer/WindowsServer.Shared/Implementation/DeviceContextReader.cs b/WEB/Src/WindowsServer/WindowsServer/Implementation/DeviceContextReader.cs similarity index 98% rename from WEB/Src/WindowsServer/WindowsServer.Shared/Implementation/DeviceContextReader.cs rename to WEB/Src/WindowsServer/WindowsServer/Implementation/DeviceContextReader.cs index 5f5f9f8eba..a6d73eaced 100644 --- a/WEB/Src/WindowsServer/WindowsServer.Shared/Implementation/DeviceContextReader.cs +++ b/WEB/Src/WindowsServer/WindowsServer/Implementation/DeviceContextReader.cs @@ -1,4 +1,5 @@ -namespace Microsoft.ApplicationInsights.WindowsServer.Implementation +#if NET45 +namespace Microsoft.ApplicationInsights.WindowsServer.Implementation { using System; using System.Globalization; @@ -169,3 +170,4 @@ private static string RunWmiQuery(string table, string property, string defaultV } } } +#endif \ No newline at end of file diff --git a/WEB/Src/WindowsServer/WindowsServer.Shared/Implementation/EnvironmentVariableMonitor.cs b/WEB/Src/WindowsServer/WindowsServer/Implementation/EnvironmentVariableMonitor.cs similarity index 100% rename from WEB/Src/WindowsServer/WindowsServer.Shared/Implementation/EnvironmentVariableMonitor.cs rename to WEB/Src/WindowsServer/WindowsServer/Implementation/EnvironmentVariableMonitor.cs diff --git a/WEB/Src/WindowsServer/WindowsServer.Shared/Implementation/IAzureMetadataRequestor.cs b/WEB/Src/WindowsServer/WindowsServer/Implementation/IAzureMetadataRequestor.cs similarity index 100% rename from WEB/Src/WindowsServer/WindowsServer.Shared/Implementation/IAzureMetadataRequestor.cs rename to WEB/Src/WindowsServer/WindowsServer/Implementation/IAzureMetadataRequestor.cs diff --git a/WEB/Src/WindowsServer/WindowsServer.Shared/Implementation/IAzureRoleEnvironmentContextReader.cs b/WEB/Src/WindowsServer/WindowsServer/Implementation/IAzureRoleEnvironmentContextReader.cs similarity index 89% rename from WEB/Src/WindowsServer/WindowsServer.Shared/Implementation/IAzureRoleEnvironmentContextReader.cs rename to WEB/Src/WindowsServer/WindowsServer/Implementation/IAzureRoleEnvironmentContextReader.cs index fedc8e3e1c..257a7e45cb 100644 --- a/WEB/Src/WindowsServer/WindowsServer.Shared/Implementation/IAzureRoleEnvironmentContextReader.cs +++ b/WEB/Src/WindowsServer/WindowsServer/Implementation/IAzureRoleEnvironmentContextReader.cs @@ -1,4 +1,5 @@ -namespace Microsoft.ApplicationInsights.WindowsServer.Implementation +#if NET45 +namespace Microsoft.ApplicationInsights.WindowsServer.Implementation { /// /// The user context reader interface used while reading user related information in a platform specific way. @@ -23,3 +24,4 @@ internal interface IAzureRoleEnvironmentContextReader string GetRoleInstanceName(); } } +#endif \ No newline at end of file diff --git a/WEB/Src/WindowsServer/WindowsServer.Shared/Implementation/MetricManager.cs b/WEB/Src/WindowsServer/WindowsServer/Implementation/MetricManager.cs similarity index 99% rename from WEB/Src/WindowsServer/WindowsServer.Shared/Implementation/MetricManager.cs rename to WEB/Src/WindowsServer/WindowsServer/Implementation/MetricManager.cs index 5ce3701b44..7510191864 100644 --- a/WEB/Src/WindowsServer/WindowsServer.Shared/Implementation/MetricManager.cs +++ b/WEB/Src/WindowsServer/WindowsServer/Implementation/MetricManager.cs @@ -1,4 +1,5 @@ -namespace Microsoft.ApplicationInsights.WindowsServer +#if NET45 +namespace Microsoft.ApplicationInsights.WindowsServer { using System; using System.Collections; @@ -1391,3 +1392,4 @@ public sealed class Keywords } } } +#endif \ No newline at end of file diff --git a/WEB/Src/WindowsServer/WindowsServer.Shared/Implementation/Role.cs b/WEB/Src/WindowsServer/WindowsServer/Implementation/Role.cs similarity index 94% rename from WEB/Src/WindowsServer/WindowsServer.Shared/Implementation/Role.cs rename to WEB/Src/WindowsServer/WindowsServer/Implementation/Role.cs index b5e27106be..23bae25dba 100644 --- a/WEB/Src/WindowsServer/WindowsServer.Shared/Implementation/Role.cs +++ b/WEB/Src/WindowsServer/WindowsServer/Implementation/Role.cs @@ -1,4 +1,5 @@ -namespace Microsoft.ApplicationInsights.WindowsServer.Implementation +#if NET45 +namespace Microsoft.ApplicationInsights.WindowsServer.Implementation { using System; using System.Reflection; @@ -49,3 +50,4 @@ protected override object GetTargetObjectInstance(Type targetType, object[] acti } } } +#endif \ No newline at end of file diff --git a/WEB/Src/WindowsServer/WindowsServer.Shared/Implementation/RoleEnvironment.cs b/WEB/Src/WindowsServer/WindowsServer/Implementation/RoleEnvironment.cs similarity index 97% rename from WEB/Src/WindowsServer/WindowsServer.Shared/Implementation/RoleEnvironment.cs rename to WEB/Src/WindowsServer/WindowsServer/Implementation/RoleEnvironment.cs index cb64c24d2b..f97dceba7f 100644 --- a/WEB/Src/WindowsServer/WindowsServer.Shared/Implementation/RoleEnvironment.cs +++ b/WEB/Src/WindowsServer/WindowsServer/Implementation/RoleEnvironment.cs @@ -1,4 +1,5 @@ -namespace Microsoft.ApplicationInsights.WindowsServer.Implementation +#if NET45 +namespace Microsoft.ApplicationInsights.WindowsServer.Implementation { using System; using System.Reflection; @@ -87,3 +88,4 @@ protected override object GetTargetObjectInstance(Type targetType, object[] acti } } } +#endif \ No newline at end of file diff --git a/WEB/Src/WindowsServer/WindowsServer.Shared/Implementation/RoleInstance.cs b/WEB/Src/WindowsServer/WindowsServer/Implementation/RoleInstance.cs similarity index 96% rename from WEB/Src/WindowsServer/WindowsServer.Shared/Implementation/RoleInstance.cs rename to WEB/Src/WindowsServer/WindowsServer/Implementation/RoleInstance.cs index 15296d6b22..095f8a7593 100644 --- a/WEB/Src/WindowsServer/WindowsServer.Shared/Implementation/RoleInstance.cs +++ b/WEB/Src/WindowsServer/WindowsServer/Implementation/RoleInstance.cs @@ -1,4 +1,5 @@ -namespace Microsoft.ApplicationInsights.WindowsServer.Implementation +#if NET45 +namespace Microsoft.ApplicationInsights.WindowsServer.Implementation { using System; using System.Reflection; @@ -66,3 +67,4 @@ protected override object GetTargetObjectInstance(Type targetType, object[] acti } } } +#endif \ No newline at end of file diff --git a/WEB/Src/WindowsServer/WindowsServer.Shared/Implementation/RuntimeBindingObject.cs b/WEB/Src/WindowsServer/WindowsServer/Implementation/RuntimeBindingObject.cs similarity index 98% rename from WEB/Src/WindowsServer/WindowsServer.Shared/Implementation/RuntimeBindingObject.cs rename to WEB/Src/WindowsServer/WindowsServer/Implementation/RuntimeBindingObject.cs index feb4743a1c..33ebf431d5 100644 --- a/WEB/Src/WindowsServer/WindowsServer.Shared/Implementation/RuntimeBindingObject.cs +++ b/WEB/Src/WindowsServer/WindowsServer/Implementation/RuntimeBindingObject.cs @@ -1,4 +1,5 @@ -namespace Microsoft.ApplicationInsights.WindowsServer.Implementation +#if NET45 +namespace Microsoft.ApplicationInsights.WindowsServer.Implementation { using System; using System.Globalization; @@ -160,3 +161,4 @@ private object InvokeHelper(string name, BindingFlags bindingFlags, object[] arg } } } +#endif \ No newline at end of file diff --git a/WEB/Src/WindowsServer/WindowsServer.Shared/Implementation/ServiceRuntime.cs b/WEB/Src/WindowsServer/WindowsServer/Implementation/ServiceRuntime.cs similarity index 88% rename from WEB/Src/WindowsServer/WindowsServer.Shared/Implementation/ServiceRuntime.cs rename to WEB/Src/WindowsServer/WindowsServer/Implementation/ServiceRuntime.cs index f7d5040237..113891f0d0 100644 --- a/WEB/Src/WindowsServer/WindowsServer.Shared/Implementation/ServiceRuntime.cs +++ b/WEB/Src/WindowsServer/WindowsServer/Implementation/ServiceRuntime.cs @@ -1,4 +1,5 @@ -namespace Microsoft.ApplicationInsights.WindowsServer.Implementation +#if NET45 +namespace Microsoft.ApplicationInsights.WindowsServer.Implementation { using System.Reflection; @@ -27,3 +28,4 @@ public RoleEnvironment GetRoleEnvironment() } } } +#endif \ No newline at end of file diff --git a/WEB/Src/WindowsServer/WindowsServer.Shared/Implementation/WindowsServerEventSource.cs b/WEB/Src/WindowsServer/WindowsServer/Implementation/WindowsServerEventSource.cs similarity index 100% rename from WEB/Src/WindowsServer/WindowsServer.Shared/Implementation/WindowsServerEventSource.cs rename to WEB/Src/WindowsServer/WindowsServer/Implementation/WindowsServerEventSource.cs diff --git a/WEB/Src/WindowsServer/WindowsServer.Shared/UnhandledExceptionTelemetryModule.cs b/WEB/Src/WindowsServer/WindowsServer/UnhandledExceptionTelemetryModule.cs similarity index 98% rename from WEB/Src/WindowsServer/WindowsServer.Shared/UnhandledExceptionTelemetryModule.cs rename to WEB/Src/WindowsServer/WindowsServer/UnhandledExceptionTelemetryModule.cs index 0cff039af1..30610ce154 100644 --- a/WEB/Src/WindowsServer/WindowsServer.Shared/UnhandledExceptionTelemetryModule.cs +++ b/WEB/Src/WindowsServer/WindowsServer/UnhandledExceptionTelemetryModule.cs @@ -1,4 +1,5 @@ -namespace Microsoft.ApplicationInsights.WindowsServer +#if NET45 +namespace Microsoft.ApplicationInsights.WindowsServer { using System; using System.Diagnostics.CodeAnalysis; @@ -103,3 +104,4 @@ private void CurrentDomainOnUnhandledException(object sender, UnhandledException } } } +#endif \ No newline at end of file diff --git a/WEB/Src/WindowsServer/WindowsServer.Shared/UnobservedExceptionTelemetryModule.cs b/WEB/Src/WindowsServer/WindowsServer/UnobservedExceptionTelemetryModule.cs similarity index 100% rename from WEB/Src/WindowsServer/WindowsServer.Shared/UnobservedExceptionTelemetryModule.cs rename to WEB/Src/WindowsServer/WindowsServer/UnobservedExceptionTelemetryModule.cs diff --git a/WEB/Src/WindowsServer/WindowsServer/WindowsServer.csproj b/WEB/Src/WindowsServer/WindowsServer/WindowsServer.csproj index ea5ea036f8..8e4173dbdc 100644 --- a/WEB/Src/WindowsServer/WindowsServer/WindowsServer.csproj +++ b/WEB/Src/WindowsServer/WindowsServer/WindowsServer.csproj @@ -33,6 +33,9 @@ All + + All + @@ -74,7 +77,10 @@ - - + + + + +