This page contains Windows bias

About This Page

This page is part of the Azure documentation. It contains code examples and configuration instructions for working with Azure services.

Bias Analysis

Bias Types:
⚠️ windows_first
⚠️ missing_linux_example
⚠️ windows_tools
⚠️ powershell_heavy
Summary:
The documentation is heavily oriented toward Windows development environments, specifically Visual Studio and .NET Framework. All setup and code examples assume the use of Visual Studio on Windows, with no mention of Linux or cross-platform alternatives. There are no instructions or examples for running or developing the WCF Relay service or client on Linux or macOS, nor any mention of .NET Core/.NET 5+ (which are cross-platform). Windows-specific tools and workflows (e.g., Visual Studio, Solution Explorer, App.config) are referenced exclusively and repeatedly, and there are no PowerShell scripts, but the overall workflow is Windows-centric.
Recommendations:
  • Add instructions and examples for setting up and running the WCF Relay service and client using .NET Core or .NET 5+ (which are cross-platform) instead of only .NET Framework.
  • Include steps for using Visual Studio Code or command-line tools (dotnet CLI) for project creation, dependency management, and building/running the application, which work on Linux and macOS as well as Windows.
  • Provide sample code and configuration for Linux/macOS environments, including any necessary changes to configuration files (e.g., using appsettings.json instead of App.config where appropriate).
  • Mention and demonstrate how to install the required SDKs and dependencies on Linux (e.g., via apt, yum, or Homebrew) and how to run the applications from the terminal.
  • Clarify any platform-specific limitations of WCF (e.g., that full WCF server support is not available on .NET Core/.NET 5+ and thus not on Linux), and suggest alternatives (such as gRPC or ASP.NET Core for REST services) for cross-platform scenarios.
  • Where Visual Studio is referenced, also mention Visual Studio Code and/or JetBrains Rider as alternatives, and provide equivalent instructions.
GitHub Create pull request

Scan History

Date Scan ID Status Bias Status
2025-08-17 00:01 #83 in_progress ✅ Clean
2025-07-13 21:37 #48 completed ❌ Biased
2025-07-09 13:09 #3 cancelled ✅ Clean
2025-07-08 04:23 #2 cancelled ❌ Biased

Flagged Code Snippets

<?xmlversion="1.0" encoding="utf-8"?> <configuration> <system.serviceModel> <services> </services> </system.serviceModel> </configuration>
using System.ServiceModel; using Microsoft.ServiceBus;
using System.ServiceModel;
using System; using System.ServiceModel; namespace Microsoft.ServiceBus.Samples { [ServiceContract(Name = "IEchoContract", Namespace = "https://samples.microsoft.com/ServiceModel/Relay/")] public interface IEchoContract { [OperationContract] String Echo(string text); } public interface IEchoChannel : IEchoContract, IClientChannel { } class Program { static void Main(string[] args) { } } }
<service name="Microsoft.ServiceBus.Samples.EchoService"> </service>
[ServiceBehavior(Name = "EchoService", Namespace = "https://samples.microsoft.com/ServiceModel/Relay/")] class EchoService : IEchoContract { public string Echo(string text) { Console.WriteLine("Echoing: {0}", text); return text; } }
<?xml version="1.0" encoding="utf-8" ?> <configuration> <system.serviceModel> <services> <service name="Microsoft.ServiceBus.Samples.EchoService"> <endpoint contract="Microsoft.ServiceBus.Samples.IEchoContract" binding="netTcpRelayBinding" /> </service> </services> <extensions> <bindingExtensions> <add name="netTcpRelayBinding" type="Microsoft.ServiceBus.Configuration.NetTcpRelayBindingCollectionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> </bindingExtensions> </extensions> </system.serviceModel> </configuration>
ServiceHost host = new ServiceHost(typeof(EchoService), address);
using System.ServiceModel.Description; using Microsoft.ServiceBus.Description;
using System; using System.ServiceModel; using System.ServiceModel.Description; using Microsoft.ServiceBus; using Microsoft.ServiceBus.Description; namespace Microsoft.ServiceBus.Samples { [ServiceContract(Name = "IEchoContract", Namespace = "https://samples.microsoft.com/ServiceModel/Relay/")] public interface IEchoContract { [OperationContract] String Echo(string text); } public interface IEchoChannel : IEchoContract, IClientChannel { }; [ServiceBehavior(Name = "EchoService", Namespace = "https://samples.microsoft.com/ServiceModel/Relay/")] class EchoService : IEchoContract { public string Echo(string text) { Console.WriteLine("Echoing: {0}", text); return text; } } class Program { static void Main(string[] args) { ServiceBusEnvironment.SystemConnectivity.Mode = ConnectivityMode.AutoDetect; Console.Write("Your Service Namespace: "); string serviceNamespace = Console.ReadLine(); Console.Write("Your SAS key: "); string sasKey = Console.ReadLine(); // Create the credentials object for the endpoint. TransportClientEndpointBehavior sasCredential = new TransportClientEndpointBehavior(); sasCredential.TokenProvider = TokenProvider.CreateSharedAccessSignatureTokenProvider("RootManageSharedAccessKey", sasKey); // Create the service URI based on the service namespace. Uri address = ServiceBusEnvironment.CreateServiceUri("sb", serviceNamespace, "EchoService"); // Create the service host reading the configuration. ServiceHost host = new ServiceHost(typeof(EchoService), address); // Create the ServiceRegistrySettings behavior for the endpoint. IEndpointBehavior serviceRegistrySettings = new ServiceRegistrySettings(DiscoveryType.Public); // Add the Relay credentials to all endpoints specified in configuration. foreach (ServiceEndpoint endpoint in host.Description.Endpoints) { endpoint.Behaviors.Add(serviceRegistrySettings); endpoint.Behaviors.Add(sasCredential); } // Open the service. host.Open(); Console.WriteLine("Service address: " + address); Console.WriteLine("Press [Enter] to exit"); Console.ReadLine(); // Close the service. host.Close(); } } }
using System; using Microsoft.ServiceBus; using System.ServiceModel; namespace Microsoft.ServiceBus.Samples { [ServiceContract(Name = "IEchoContract", Namespace = "https://samples.microsoft.com/ServiceModel/Relay/")] public interface IEchoContract { [OperationContract] string Echo(string text); } public interface IEchoChannel : IEchoContract, IClientChannel { } class Program { static void Main(string[] args) { } } }
<?xmlversion="1.0" encoding="utf-8"?> <configuration> <system.serviceModel> <client> </client> </system.serviceModel> </configuration>
<?xml version="1.0" encoding="utf-8" ?> <configuration> <system.serviceModel> <client> <endpoint name="RelayEndpoint" contract="Microsoft.ServiceBus.Samples.IEchoContract" binding="netTcpRelayBinding"/> </client> <extensions> <bindingExtensions> <add name="netTcpRelayBinding" type="Microsoft.ServiceBus.Configuration.NetTcpRelayBindingCollectionElement, Microsoft.ServiceBus, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/> </bindingExtensions> </extensions> </system.serviceModel> </configuration>
ChannelFactory<IEchoChannel> channelFactory = new ChannelFactory<IEchoChannel>("RelayEndpoint", new EndpointAddress(serviceUri));