diff --git a/OpenTelemetry.AutoInstrumentation.sln b/OpenTelemetry.AutoInstrumentation.sln index 3a25de776..b98e2bb10 100644 --- a/OpenTelemetry.AutoInstrumentation.sln +++ b/OpenTelemetry.AutoInstrumentation.sln @@ -189,6 +189,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "OpenTelemetry.AutoInstrumen EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TestApplication.AssemblyRedirection.NetFramework", "test\test-applications\integrations\TestApplication.AssemblyRedirection.NetFramework\TestApplication.AssemblyRedirection.NetFramework.csproj", "{66FB648E-7FAF-418B-B2F6-B7CB9EE579CA}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestApplication.Wcf.Server.IIS.NetFramework", "test\test-applications\integrations\TestApplication.Wcf.Server.IIS.NetFramework\TestApplication.Wcf.Server.IIS.NetFramework.csproj", "{65619BD1-4517-400C-8071-C1409A7D255E}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -865,6 +867,18 @@ Global {66FB648E-7FAF-418B-B2F6-B7CB9EE579CA}.Release|x64.Build.0 = Release|x64 {66FB648E-7FAF-418B-B2F6-B7CB9EE579CA}.Release|x86.ActiveCfg = Release|x86 {66FB648E-7FAF-418B-B2F6-B7CB9EE579CA}.Release|x86.Build.0 = Release|x86 + {65619BD1-4517-400C-8071-C1409A7D255E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {65619BD1-4517-400C-8071-C1409A7D255E}.Debug|Any CPU.Build.0 = Debug|Any CPU + {65619BD1-4517-400C-8071-C1409A7D255E}.Debug|x64.ActiveCfg = Debug|Any CPU + {65619BD1-4517-400C-8071-C1409A7D255E}.Debug|x64.Build.0 = Debug|Any CPU + {65619BD1-4517-400C-8071-C1409A7D255E}.Debug|x86.ActiveCfg = Debug|Any CPU + {65619BD1-4517-400C-8071-C1409A7D255E}.Debug|x86.Build.0 = Debug|Any CPU + {65619BD1-4517-400C-8071-C1409A7D255E}.Release|Any CPU.ActiveCfg = Release|Any CPU + {65619BD1-4517-400C-8071-C1409A7D255E}.Release|Any CPU.Build.0 = Release|Any CPU + {65619BD1-4517-400C-8071-C1409A7D255E}.Release|x64.ActiveCfg = Release|Any CPU + {65619BD1-4517-400C-8071-C1409A7D255E}.Release|x64.Build.0 = Release|Any CPU + {65619BD1-4517-400C-8071-C1409A7D255E}.Release|x86.ActiveCfg = Release|Any CPU + {65619BD1-4517-400C-8071-C1409A7D255E}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -931,6 +945,7 @@ Global {1D7E11AA-27B6-4863-B5EC-1F0ECC6979B2} = {E409ADD3-9574-465C-AB09-4324D205CC7C} {0077F121-DC2B-425E-A2F4-DEAC2A566E14} = {5C915382-C886-457D-8641-9E766D8E5A17} {66FB648E-7FAF-418B-B2F6-B7CB9EE579CA} = {E409ADD3-9574-465C-AB09-4324D205CC7C} + {65619BD1-4517-400C-8071-C1409A7D255E} = {E409ADD3-9574-465C-AB09-4324D205CC7C} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {160A1D00-1F5B-40F8-A155-621B4459D78F} diff --git a/build/Build.Steps.Windows.cs b/build/Build.Steps.Windows.cs index 2c8e0f987..fe9362ce4 100644 --- a/build/Build.Steps.Windows.cs +++ b/build/Build.Steps.Windows.cs @@ -106,28 +106,37 @@ partial class Build { var aspNetProject = Solution.GetProjectByName(Projects.Tests.Applications.AspNet); - MSBuild(x => x - .SetConfiguration(BuildConfiguration) - .SetTargetPlatform(Platform) - .SetProperty("DeployOnBuild", true) - .SetMaxCpuCount(null) - .SetProperty("PublishProfile", aspNetProject.Directory / "Properties" / "PublishProfiles" / $"FolderProfile.{BuildConfiguration}.pubxml") - .SetTargetPath(aspNetProject)); - var localCopyTracerHome = aspNetProject.Directory / "bin" / "tracer-home"; CopyDirectoryRecursively(TracerHomeDirectory, localCopyTracerHome); - DockerBuild(x => x - .SetPath(".") - .SetBuildArg($"configuration={BuildConfiguration}", $"windowscontainer_version={WindowsContainerVersion}") - .SetRm(true) - .SetTag(Path.GetFileNameWithoutExtension(aspNetProject).Replace(".", "-").ToLowerInvariant()) - .SetProcessWorkingDirectory(aspNetProject.Directory) - ); + BuildDockerImage(aspNetProject); Directory.Delete(localCopyTracerHome, true); + + var wcfProject = Solution.GetProjectByName(Projects.Tests.Applications.Wcf); + BuildDockerImage(wcfProject); }); + void BuildDockerImage(Project project) + { + MSBuild(x => x + .SetConfiguration(BuildConfiguration) + .SetTargetPlatform(Platform) + .SetProperty("DeployOnBuild", true) + .SetMaxCpuCount(null) + .SetProperty("PublishProfile", + project.Directory / "Properties" / "PublishProfiles" / $"FolderProfile.{BuildConfiguration}.pubxml") + .SetTargetPath(project)); + + DockerBuild(x => x + .SetPath(".") + .SetBuildArg($"configuration={BuildConfiguration}", $"windowscontainer_version={WindowsContainerVersion}") + .EnableRm() + .SetTag(Path.GetFileNameWithoutExtension(project).Replace(".", "-").ToLowerInvariant()) + .SetProcessWorkingDirectory(project.Directory) + ); + } + Target GenerateNetFxTransientDependencies => _ => _ .Unlisted() .After(Restore) diff --git a/build/Build.Steps.cs b/build/Build.Steps.cs index c62a1d3fa..5d6185d6d 100644 --- a/build/Build.Steps.cs +++ b/build/Build.Steps.cs @@ -99,7 +99,8 @@ partial class Build { // Projects using `packages.config` can't be restored via "dotnet restore", use a NuGet Task to restore these projects. var legacyRestoreProjects = Solution.GetNativeProjects() - .Concat(new[] { Solution.GetProjectByName(Projects.Tests.Applications.AspNet) }); + .Concat(new[] { Solution.GetProjectByName(Projects.Tests.Applications.AspNet) }) + .Concat(new[] { Solution.GetProjectByName(Projects.Tests.Applications.Wcf) }); foreach (var project in legacyRestoreProjects) { diff --git a/build/Projects.cs b/build/Projects.cs index 6d81e304c..fd4303a37 100644 --- a/build/Projects.cs +++ b/build/Projects.cs @@ -23,6 +23,7 @@ public static class Projects public static class Applications { public const string AspNet = "TestApplication.AspNet.NetFramework"; + public const string Wcf = "TestApplication.Wcf.Server.IIS.NetFramework"; } } diff --git a/test/IntegrationTests/AspNetTests.cs b/test/IntegrationTests/AspNetTests.cs index 5952e5ee8..ed080b9a6 100644 --- a/test/IntegrationTests/AspNetTests.cs +++ b/test/IntegrationTests/AspNetTests.cs @@ -53,7 +53,6 @@ public class AspNetTests collector.Expect("OpenTelemetry.Instrumentation.AspNet.Telemetry"); // Expect WebApi span string collectorUrl = $"http://{DockerNetworkHelper.IntegrationTestsGateway}:{collector.Port}"; - _environmentVariables["OTEL_TRACES_EXPORTER"] = "otlp"; _environmentVariables["OTEL_EXPORTER_OTLP_ENDPOINT"] = collectorUrl; var webPort = TcpPortProvider.GetOpenPort(); await using var container = await StartContainerAsync(webPort); diff --git a/test/IntegrationTests/WcfIISTests.cs b/test/IntegrationTests/WcfIISTests.cs new file mode 100644 index 000000000..53e3878e4 --- /dev/null +++ b/test/IntegrationTests/WcfIISTests.cs @@ -0,0 +1,122 @@ +// +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +#if NETFRAMEWORK +using System; +using System.Collections.Generic; +using System.IO; +using System.Threading.Tasks; +using DotNet.Testcontainers.Builders; +using DotNet.Testcontainers.Containers; +using FluentAssertions; +using IntegrationTests.Helpers; +using OpenTelemetry.Proto.Trace.V1; +using Xunit; +using Xunit.Abstractions; + +namespace IntegrationTests; + +public class WcfIISTests : TestHelper +{ + private readonly Dictionary _environmentVariables = new(); + + public WcfIISTests(ITestOutputHelper output) + : base("Wcf.Client.NetFramework", output) + { + } + + [Fact] + [Trait("Category", "EndToEnd")] + [Trait("Containers", "Windows")] + public async Task SubmitsTraces() + { + Assert.True(EnvironmentTools.IsWindowsAdministrator(), "This test requires Windows Administrator privileges."); + + // Using "*" as host requires Administrator. This is needed to make the mock collector endpoint + // accessible to the Windows docker container where the test application is executed by binding + // the endpoint to all network interfaces. In order to do that it is necessary to open the port + // on the firewall. + using var collector = new MockSpansCollector(Output, host: "*"); + SetExporter(collector); + using var fwPort = FirewallHelper.OpenWinPort(collector.Port, Output); + + collector.Expect("OpenTelemetry.Instrumentation.Wcf", span => span.Kind == Span.Types.SpanKind.Server, "Server1"); + collector.Expect("OpenTelemetry.Instrumentation.Wcf", span => span.Kind == Span.Types.SpanKind.Client, "Client1"); + collector.Expect("OpenTelemetry.Instrumentation.Wcf", span => span.Kind == Span.Types.SpanKind.Server, "Server2"); + collector.Expect("OpenTelemetry.Instrumentation.Wcf", span => span.Kind == Span.Types.SpanKind.Client, "Client2"); + + var collectorUrl = $"http://{DockerNetworkHelper.IntegrationTestsGateway}:{collector.Port}"; + _environmentVariables["OTEL_EXPORTER_OTLP_ENDPOINT"] = collectorUrl; + + var netTcpPort = TcpPortProvider.GetOpenPort(); + var httpPort = TcpPortProvider.GetOpenPort(); + + await using var container = await StartContainerAsync(netTcpPort, httpPort); + + RunTestApplication(new TestSettings + { + Arguments = $"{netTcpPort} {httpPort}" + }); + + collector.AssertExpectations(); + } + + private async Task StartContainerAsync(int netTcpPort, int httpPort) + { + const string imageName = "testapplication-wcf-server-iis-netframework"; + + var networkId = await DockerNetworkHelper.SetupIntegrationTestsNetworkAsync(); + + var logPath = EnvironmentHelper.IsRunningOnCI() + ? Path.Combine(Environment.GetEnvironmentVariable("GITHUB_WORKSPACE"), "build_data", "profiler-logs") + : Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), @"OpenTelemetry .NET AutoInstrumentation", "logs"); + + Directory.CreateDirectory(logPath); + Output.WriteLine("Collecting docker logs to: " + logPath); + + var builder = new ContainerBuilder() + .WithImage(imageName) + .WithCleanUp(cleanUp: true) + .WithOutputConsumer(Consume.RedirectStdoutAndStderrToConsole()) + .WithName($"{imageName}") + .WithNetwork(networkId, DockerNetworkHelper.IntegrationTestsNetworkName) + .WithPortBinding(netTcpPort, 808) + .WithPortBinding(httpPort, 80) + .WithBindMount(logPath, "c:/inetpub/wwwroot/logs") + .WithBindMount(EnvironmentHelper.GetNukeBuildOutput(), "c:/opentelemetry"); + + foreach (var env in _environmentVariables) + { + builder = builder.WithEnvironment(env.Key, env.Value); + } + + var container = builder.Build(); + try + { + var wasStarted = container.StartAsync().Wait(TimeSpan.FromMinutes(5)); + wasStarted.Should().BeTrue($"Container based on {imageName} has to be operational for the test."); + Output.WriteLine("Container was started successfully."); + } + catch + { + await container.DisposeAsync(); + throw; + } + + return container; + } +} +#endif diff --git a/test/test-applications/integrations/TestApplication.Wcf.Client.DotNet/StatusRequest.cs b/test/test-applications/integrations/TestApplication.Wcf.Client.DotNet/StatusRequest.cs index 6650fbb14..83c3a9262 100644 --- a/test/test-applications/integrations/TestApplication.Wcf.Client.DotNet/StatusRequest.cs +++ b/test/test-applications/integrations/TestApplication.Wcf.Client.DotNet/StatusRequest.cs @@ -18,7 +18,7 @@ using System.Runtime.Serialization; namespace TestApplication.Wcf.Client.DotNet; -[DataContract] +[DataContract(Namespace = "http://opentelemetry.io/")] public class StatusRequest { [DataMember] diff --git a/test/test-applications/integrations/TestApplication.Wcf.Client.DotNet/StatusResponse.cs b/test/test-applications/integrations/TestApplication.Wcf.Client.DotNet/StatusResponse.cs index afb2fe54f..c1e6a2363 100644 --- a/test/test-applications/integrations/TestApplication.Wcf.Client.DotNet/StatusResponse.cs +++ b/test/test-applications/integrations/TestApplication.Wcf.Client.DotNet/StatusResponse.cs @@ -18,7 +18,7 @@ using System.Runtime.Serialization; namespace TestApplication.Wcf.Client.DotNet; -[DataContract] +[DataContract(Namespace = "http://opentelemetry.io/")] public class StatusResponse { [DataMember] diff --git a/test/test-applications/integrations/TestApplication.Wcf.Client.NetFramework/App.config b/test/test-applications/integrations/TestApplication.Wcf.Client.NetFramework/App.config deleted file mode 100644 index a3f7070ec..000000000 --- a/test/test-applications/integrations/TestApplication.Wcf.Client.NetFramework/App.config +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/test-applications/integrations/TestApplication.Wcf.Client.NetFramework/Program.cs b/test/test-applications/integrations/TestApplication.Wcf.Client.NetFramework/Program.cs index b79c57cd7..7cb0e662b 100644 --- a/test/test-applications/integrations/TestApplication.Wcf.Client.NetFramework/Program.cs +++ b/test/test-applications/integrations/TestApplication.Wcf.Client.NetFramework/Program.cs @@ -15,23 +15,44 @@ // using System.ServiceModel; +using System.ServiceModel.Channels; +using static System.Net.WebRequestMethods; namespace TestApplication.Wcf.Client.NetFramework; internal static class Program { - public static async Task Main() + public static async Task Main(string[] args) { - await CallService("StatusService_Tcp").ConfigureAwait(false); - await CallService("StatusService_Http").ConfigureAwait(false); + string netTcpAddress; + string httpAddress; + if (args.Length == 0) + { + // Self-hosted service addresses + netTcpAddress = "net.tcp://127.0.0.1:9090/Telemetry"; + httpAddress = "http://127.0.0.1:9009/Telemetry"; + } + else if (args.Length == 2) + { + // Addresses of a service hosted in IIS inside container + netTcpAddress = $"net.tcp://localhost:{args[0]}/StatusService.svc"; + httpAddress = $"http://localhost:{args[1]}/StatusService.svc"; + } + else + { + throw new Exception("TestApplication.Wcf.Client.NetFramework application requires either 0 or exactly 2 arguments."); + } + + await CallService(netTcpAddress, new NetTcpBinding(SecurityMode.None)).ConfigureAwait(false); + await CallService(httpAddress, new BasicHttpBinding()).ConfigureAwait(false); } - private static async Task CallService(string name) + private static async Task CallService(string address, Binding binding) { // Note: Best practice is to re-use your client/channel instances. // This code is not meant to illustrate best practices, only the // instrumentation. - var client = new StatusServiceClient(name); + var client = new StatusServiceClient(binding, new EndpointAddress(new Uri(address))); try { await client.OpenAsync().ConfigureAwait(false); diff --git a/test/test-applications/integrations/TestApplication.Wcf.Client.NetFramework/StatusRequest.cs b/test/test-applications/integrations/TestApplication.Wcf.Client.NetFramework/StatusRequest.cs index fb6cbd245..be93e0054 100644 --- a/test/test-applications/integrations/TestApplication.Wcf.Client.NetFramework/StatusRequest.cs +++ b/test/test-applications/integrations/TestApplication.Wcf.Client.NetFramework/StatusRequest.cs @@ -18,7 +18,7 @@ using System.Runtime.Serialization; namespace TestApplication.Wcf.Client.NetFramework; -[DataContract] +[DataContract(Namespace = "http://opentelemetry.io/")] public class StatusRequest { [DataMember] diff --git a/test/test-applications/integrations/TestApplication.Wcf.Client.NetFramework/StatusResponse.cs b/test/test-applications/integrations/TestApplication.Wcf.Client.NetFramework/StatusResponse.cs index 42a4be76e..0088b0424 100644 --- a/test/test-applications/integrations/TestApplication.Wcf.Client.NetFramework/StatusResponse.cs +++ b/test/test-applications/integrations/TestApplication.Wcf.Client.NetFramework/StatusResponse.cs @@ -18,7 +18,7 @@ using System.Runtime.Serialization; namespace TestApplication.Wcf.Client.NetFramework; -[DataContract] +[DataContract(Namespace = "http://opentelemetry.io/")] public class StatusResponse { [DataMember] diff --git a/test/test-applications/integrations/TestApplication.Wcf.Client.NetFramework/StatusServiceClient.cs b/test/test-applications/integrations/TestApplication.Wcf.Client.NetFramework/StatusServiceClient.cs index c10291758..4e3264ef9 100644 --- a/test/test-applications/integrations/TestApplication.Wcf.Client.NetFramework/StatusServiceClient.cs +++ b/test/test-applications/integrations/TestApplication.Wcf.Client.NetFramework/StatusServiceClient.cs @@ -15,14 +15,15 @@ // using System.ServiceModel; +using System.ServiceModel.Channels; using System.Threading.Tasks; namespace TestApplication.Wcf.Client.NetFramework; public class StatusServiceClient : ClientBase, IStatusServiceContract { - public StatusServiceClient(string name) - : base(name) + public StatusServiceClient(Binding binding, EndpointAddress remoteAddress) + : base(binding, remoteAddress) { } diff --git a/test/test-applications/integrations/TestApplication.Wcf.Server.IIS.NetFramework/Directory.Build.props b/test/test-applications/integrations/TestApplication.Wcf.Server.IIS.NetFramework/Directory.Build.props new file mode 100644 index 000000000..96d9a3199 --- /dev/null +++ b/test/test-applications/integrations/TestApplication.Wcf.Server.IIS.NetFramework/Directory.Build.props @@ -0,0 +1,3 @@ + + + diff --git a/test/test-applications/integrations/TestApplication.Wcf.Server.IIS.NetFramework/Dockerfile b/test/test-applications/integrations/TestApplication.Wcf.Server.IIS.NetFramework/Dockerfile new file mode 100644 index 000000000..c8bd25090 --- /dev/null +++ b/test/test-applications/integrations/TestApplication.Wcf.Server.IIS.NetFramework/Dockerfile @@ -0,0 +1,15 @@ +# escape=` + +ARG windowscontainer_version=ltsc2022 +FROM mcr.microsoft.com/dotnet/framework/wcf:4.8-windowsservercore-${windowscontainer_version} +ARG configuration=Debug +ARG platform=x64 +ENV COR_ENABLE_PROFILING=1 ` + COR_PROFILER={918728DD-259F-4A6A-AC2B-B85E1B658318} ` + COR_PROFILER_PATH=C:\opentelemetry\win-${platform}\OpenTelemetry.AutoInstrumentation.Native.dll ` + OTEL_DOTNET_AUTO_HOME=C:\opentelemetry\ ` + OTEL_DOTNET_AUTO_TRACES_ADDITIONAL_SOURCES=TestApplication.* ` + OTEL_LOG_LEVEL=debug ` + OTEL_DOTNET_AUTO_LOG_DIRECTORY=C:\inetpub\wwwroot\logs +WORKDIR /inetpub/wwwroot +COPY bin/${configuration}/app.publish . \ No newline at end of file diff --git a/test/test-applications/integrations/TestApplication.Wcf.Server.IIS.NetFramework/IStatusServiceContract.cs b/test/test-applications/integrations/TestApplication.Wcf.Server.IIS.NetFramework/IStatusServiceContract.cs new file mode 100644 index 000000000..14dd1f6c5 --- /dev/null +++ b/test/test-applications/integrations/TestApplication.Wcf.Server.IIS.NetFramework/IStatusServiceContract.cs @@ -0,0 +1,27 @@ +// +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +using System.ServiceModel; +using System.Threading.Tasks; + +namespace TestApplication.Wcf.Server.IIS.NetFramework; + +[ServiceContract(Namespace = "http://opentelemetry.io/", Name = "StatusService", SessionMode = SessionMode.Allowed)] +public interface IStatusServiceContract +{ + [OperationContract] + Task PingAsync(StatusRequest request); +} diff --git a/test/test-applications/integrations/TestApplication.Wcf.Server.IIS.NetFramework/Properties/AssemblyInfo.cs b/test/test-applications/integrations/TestApplication.Wcf.Server.IIS.NetFramework/Properties/AssemblyInfo.cs new file mode 100644 index 000000000..e15fb2af7 --- /dev/null +++ b/test/test-applications/integrations/TestApplication.Wcf.Server.IIS.NetFramework/Properties/AssemblyInfo.cs @@ -0,0 +1,52 @@ +// +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +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("TestApplication.Wcf.Server.IIS.NetFramework")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("TestApplication.Wcf.Server.IIS.NetFramework")] +[assembly: AssemblyCopyright("Copyright © 2023")] +[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("65619bd1-4517-400c-8071-c1409a7d255e")] + +// 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 Revision and Build 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/test/test-applications/integrations/TestApplication.Wcf.Server.IIS.NetFramework/Properties/PublishProfiles/FolderProfile.Debug.pubxml b/test/test-applications/integrations/TestApplication.Wcf.Server.IIS.NetFramework/Properties/PublishProfiles/FolderProfile.Debug.pubxml new file mode 100644 index 000000000..30cb0feff --- /dev/null +++ b/test/test-applications/integrations/TestApplication.Wcf.Server.IIS.NetFramework/Properties/PublishProfiles/FolderProfile.Debug.pubxml @@ -0,0 +1,17 @@ + + + + + True + False + True + Debug + x64 + FileSystem + bin\Debug\app.publish\ + FileSystem + + + \ No newline at end of file diff --git a/test/test-applications/integrations/TestApplication.Wcf.Server.IIS.NetFramework/Properties/PublishProfiles/FolderProfile.Release.pubxml b/test/test-applications/integrations/TestApplication.Wcf.Server.IIS.NetFramework/Properties/PublishProfiles/FolderProfile.Release.pubxml new file mode 100644 index 000000000..70f177f1c --- /dev/null +++ b/test/test-applications/integrations/TestApplication.Wcf.Server.IIS.NetFramework/Properties/PublishProfiles/FolderProfile.Release.pubxml @@ -0,0 +1,17 @@ + + + + + True + False + True + Release + x64 + FileSystem + bin\Release\app.publish\ + FileSystem + + + \ No newline at end of file diff --git a/test/test-applications/integrations/TestApplication.Wcf.Server.IIS.NetFramework/StatusRequest.cs b/test/test-applications/integrations/TestApplication.Wcf.Server.IIS.NetFramework/StatusRequest.cs new file mode 100644 index 000000000..122be7bdd --- /dev/null +++ b/test/test-applications/integrations/TestApplication.Wcf.Server.IIS.NetFramework/StatusRequest.cs @@ -0,0 +1,26 @@ +// +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +using System.Runtime.Serialization; + +namespace TestApplication.Wcf.Server.IIS.NetFramework; + +[DataContract(Namespace = "http://opentelemetry.io/")] +public class StatusRequest +{ + [DataMember] + public string Status { get; set; } = string.Empty; +} diff --git a/test/test-applications/integrations/TestApplication.Wcf.Server.IIS.NetFramework/StatusResponse.cs b/test/test-applications/integrations/TestApplication.Wcf.Server.IIS.NetFramework/StatusResponse.cs new file mode 100644 index 000000000..ae3d8f89d --- /dev/null +++ b/test/test-applications/integrations/TestApplication.Wcf.Server.IIS.NetFramework/StatusResponse.cs @@ -0,0 +1,27 @@ +// +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +using System; +using System.Runtime.Serialization; + +namespace TestApplication.Wcf.Server.IIS.NetFramework; + +[DataContract(Namespace = "http://opentelemetry.io/")] +public class StatusResponse +{ + [DataMember] + public DateTimeOffset ServerTime { get; set; } +} diff --git a/test/test-applications/integrations/TestApplication.Wcf.Server.IIS.NetFramework/StatusService.cs b/test/test-applications/integrations/TestApplication.Wcf.Server.IIS.NetFramework/StatusService.cs new file mode 100644 index 000000000..debc3ea69 --- /dev/null +++ b/test/test-applications/integrations/TestApplication.Wcf.Server.IIS.NetFramework/StatusService.cs @@ -0,0 +1,36 @@ +// +// Copyright The OpenTelemetry Authors +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +using System; +using System.ServiceModel; +using System.Threading.Tasks; + +namespace TestApplication.Wcf.Server.IIS.NetFramework; + +[ServiceBehavior( + Namespace = "http://opentelemetry.io/", + ConcurrencyMode = ConcurrencyMode.Multiple, + InstanceContextMode = InstanceContextMode.Single, + UseSynchronizationContext = false, + Name = "StatusService")] +public class StatusService : IStatusServiceContract +{ + public Task PingAsync(StatusRequest request) + { + return Task.FromResult( + new StatusResponse { ServerTime = DateTimeOffset.UtcNow }); + } +} diff --git a/test/test-applications/integrations/TestApplication.Wcf.Server.IIS.NetFramework/StatusService.svc b/test/test-applications/integrations/TestApplication.Wcf.Server.IIS.NetFramework/StatusService.svc new file mode 100644 index 000000000..3294e2780 --- /dev/null +++ b/test/test-applications/integrations/TestApplication.Wcf.Server.IIS.NetFramework/StatusService.svc @@ -0,0 +1 @@ +<%@ ServiceHost Language="C#" Debug="true" Service="TestApplication.Wcf.Server.IIS.NetFramework.StatusService" CodeBehind="StatusService.cs" %> \ No newline at end of file diff --git a/test/test-applications/integrations/TestApplication.Wcf.Server.IIS.NetFramework/TestApplication.Wcf.Server.IIS.NetFramework.csproj b/test/test-applications/integrations/TestApplication.Wcf.Server.IIS.NetFramework/TestApplication.Wcf.Server.IIS.NetFramework.csproj new file mode 100644 index 000000000..d2ca48ddb --- /dev/null +++ b/test/test-applications/integrations/TestApplication.Wcf.Server.IIS.NetFramework/TestApplication.Wcf.Server.IIS.NetFramework.csproj @@ -0,0 +1,119 @@ + + + + + Debug + AnyCPU + + + 2.0 + {65619BD1-4517-400C-8071-C1409A7D255E} + {349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc} + Library + Properties + TestApplication.Wcf.Server.IIS.NetFramework + TestApplication.Wcf.Server.IIS.NetFramework + v4.6.2 + True + true + true + + + + + + + + + true + full + false + bin\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\ + TRACE + prompt + 4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Web.config + + + Web.config + + + + 10.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + + + + + + + + + True + True + 62503 + / + http://localhost:62503/ + False + False + + + False + + + + + + \ No newline at end of file diff --git a/test/test-applications/integrations/TestApplication.Wcf.Server.IIS.NetFramework/Web.Debug.config b/test/test-applications/integrations/TestApplication.Wcf.Server.IIS.NetFramework/Web.Debug.config new file mode 100644 index 000000000..fae9cfefa --- /dev/null +++ b/test/test-applications/integrations/TestApplication.Wcf.Server.IIS.NetFramework/Web.Debug.config @@ -0,0 +1,30 @@ + + + + + + + + + + \ No newline at end of file diff --git a/test/test-applications/integrations/TestApplication.Wcf.Server.IIS.NetFramework/Web.Release.config b/test/test-applications/integrations/TestApplication.Wcf.Server.IIS.NetFramework/Web.Release.config new file mode 100644 index 000000000..da6e960b8 --- /dev/null +++ b/test/test-applications/integrations/TestApplication.Wcf.Server.IIS.NetFramework/Web.Release.config @@ -0,0 +1,31 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/test/test-applications/integrations/TestApplication.Wcf.Server.IIS.NetFramework/Web.config b/test/test-applications/integrations/TestApplication.Wcf.Server.IIS.NetFramework/Web.config new file mode 100644 index 000000000..18ad8d91a --- /dev/null +++ b/test/test-applications/integrations/TestApplication.Wcf.Server.IIS.NetFramework/Web.config @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/test/test-applications/integrations/TestApplication.Wcf.Server.NetFramework/StatusRequest.cs b/test/test-applications/integrations/TestApplication.Wcf.Server.NetFramework/StatusRequest.cs index 6990026ec..117a5e0fe 100644 --- a/test/test-applications/integrations/TestApplication.Wcf.Server.NetFramework/StatusRequest.cs +++ b/test/test-applications/integrations/TestApplication.Wcf.Server.NetFramework/StatusRequest.cs @@ -18,7 +18,7 @@ using System.Runtime.Serialization; namespace TestApplication.Wcf.Server.NetFramework; -[DataContract] +[DataContract(Namespace = "http://opentelemetry.io/")] public class StatusRequest { [DataMember] diff --git a/test/test-applications/integrations/TestApplication.Wcf.Server.NetFramework/StatusResponse.cs b/test/test-applications/integrations/TestApplication.Wcf.Server.NetFramework/StatusResponse.cs index 01a617399..73021ca4d 100644 --- a/test/test-applications/integrations/TestApplication.Wcf.Server.NetFramework/StatusResponse.cs +++ b/test/test-applications/integrations/TestApplication.Wcf.Server.NetFramework/StatusResponse.cs @@ -18,7 +18,7 @@ using System.Runtime.Serialization; namespace TestApplication.Wcf.Server.NetFramework; -[DataContract] +[DataContract(Namespace = "http://opentelemetry.io/")] public class StatusResponse { [DataMember]