diff --git a/ArchiSteamFarm/GlobalConfig.cs b/ArchiSteamFarm/GlobalConfig.cs index 4cbbb3f4b..ae589eeea 100644 --- a/ArchiSteamFarm/GlobalConfig.cs +++ b/ArchiSteamFarm/GlobalConfig.cs @@ -105,7 +105,7 @@ namespace ArchiSteamFarm { [JsonProperty(Required = Required.DisallowNull)] internal readonly ushort WCFPort = DefaultWCFPort; - [JsonProperty(Required = Required.DisallowNull)] + [JsonProperty(Required = Required.DisallowNull)] internal readonly bool Statistics = true; [JsonProperty(Required = Required.DisallowNull)] diff --git a/ArchiSteamFarm/WCF.cs b/ArchiSteamFarm/WCF.cs index 6dfd570f9..59c755d85 100644 --- a/ArchiSteamFarm/WCF.cs +++ b/ArchiSteamFarm/WCF.cs @@ -88,21 +88,18 @@ namespace ArchiSteamFarm { } Logging.LogGenericInfo("Starting WCF server..."); - ServiceHost = new ServiceHost(typeof(WCF), new Uri(URL)); - ServiceHost.Description.Behaviors.Add(new ServiceMetadataBehavior - { - HttpGetEnabled = true - }); - ServiceHost.AddServiceEndpoint(ServiceMetadataBehavior.MexContractName, - MetadataExchangeBindings.CreateMexHttpBinding(), "mex"); - ServiceHost.AddServiceEndpoint(typeof(IWCF), new BasicHttpBinding(), string.Empty); try { + ServiceHost = new ServiceHost(typeof(WCF), new Uri(URL)); + + ServiceHost.Description.Behaviors.Add(new ServiceMetadataBehavior { + HttpGetEnabled = true + }); + + ServiceHost.AddServiceEndpoint(ServiceMetadataBehavior.MexContractName, MetadataExchangeBindings.CreateMexHttpBinding(), "mex"); + ServiceHost.AddServiceEndpoint(typeof(IWCF), new BasicHttpBinding(), string.Empty); + ServiceHost.Open(); - } catch (AddressAccessDeniedException) { - Logging.LogGenericWarning("WCF service could not be started because of AddressAccessDeniedException"); - Logging.LogGenericWarning("If you want to use WCF service provided by ASF, consider starting ASF as administrator, or giving proper permissions"); - return; } catch (Exception e) { Logging.LogGenericException(e); return;