As you say, adding links to all your end products is not the way to go. I would say that this is a problem that is very easy to solve using Injection Dependency.
Define the interface that gives this information (in the general assembly):
public enum DeploymentType { WinForms, WinServices, Azure } public interface IWhatDeploymentAmIUsing { DeploymentType DeploymentType { get; } }
And create a class that implements this interface.
WinForms (in your winforms project):
public class WinFormDeploymentType : IWhatDeploymentAmIUsing { public DeploymentType DeploymentType { get { return DeploymentType.WinForms; } } }
WinServices (in your Windows service project):
public class WinServicesDeploymentType : IWhatDeploymentAmIUsing { public DeploymentType DeploymentType { get { return DeploymentType.WinServices; } } }
Azure (in the azure project):
public class AzureDeploymentType : IWhatDeploymentAmIUsing { public DeploymentType DeploymentType { get { return DeploymentType.Azure; } } }
Now plug it in using your favorite DI tool.
source share