From 7b2e3ef0c46e48a070b151e0cc66313b48af8291 Mon Sep 17 00:00:00 2001 From: Keivan Beigi Date: Fri, 3 Oct 2014 10:39:06 -0700 Subject: [PATCH] added ExceptronIgnoreOnMono and ExceptronIgnore extention methods. --- src/Exceptron.Client/Exceptron.Client.csproj | 89 ------------------- src/Exceptron.Client/Exceptron.Client.nuspec | 20 ----- .../NuGet/web.config.transform | 7 -- .../Properties/AssemblyInfo.cs | 30 ------- .../Configuration/ExceptronConfiguration.cs | 4 +- .../Exceptron}/ExceptionData.cs | 11 +-- .../Exceptron}/ExceptionSeverity.cs | 2 +- .../Exceptron}/ExceptronApiException.cs | 2 +- .../Exceptron}/ExceptronClient.cs | 71 +++++++-------- .../Exceptron}/IExceptronClient.cs | 9 +- .../Exceptron}/IRestClient.cs | 2 +- .../Exceptron}/Message/ExceptionReport.cs | 2 +- .../Exceptron}/Message/ExceptionResponse.cs | 4 +- .../Exceptron}/Message/Frame.cs | 2 +- .../Exceptron}/RestClient.cs | 4 +- .../Exceptron}/fastJSON/Getters.cs | 2 +- .../Exceptron}/fastJSON/JSON.cs | 2 +- .../Exceptron}/fastJSON/JsonParser.cs | 2 +- .../Exceptron}/fastJSON/JsonSerializer.cs | 2 +- .../Exceptron}/fastJSON/SafeDictionary.cs | 2 +- .../Exceptron}/fastJSON/license.txt | 0 .../Instrumentation/ExceptronTarget.cs | 9 +- src/NzbDrone.Common/NzbDrone.Common.csproj | 25 ++++-- src/NzbDrone.Console/ConsoleApp.cs | 7 +- src/NzbDrone.Host/Bootstrap.cs | 4 +- src/NzbDrone.sln | 29 ++---- 26 files changed, 90 insertions(+), 253 deletions(-) delete mode 100644 src/Exceptron.Client/Exceptron.Client.csproj delete mode 100644 src/Exceptron.Client/Exceptron.Client.nuspec delete mode 100644 src/Exceptron.Client/NuGet/web.config.transform delete mode 100644 src/Exceptron.Client/Properties/AssemblyInfo.cs rename src/{Exceptron.Client => NzbDrone.Common/Exceptron}/Configuration/ExceptronConfiguration.cs (96%) rename src/{Exceptron.Client => NzbDrone.Common/Exceptron}/ExceptionData.cs (79%) rename src/{Exceptron.Client => NzbDrone.Common/Exceptron}/ExceptionSeverity.cs (94%) rename src/{Exceptron.Client => NzbDrone.Common/Exceptron}/ExceptronApiException.cs (91%) rename src/{Exceptron.Client => NzbDrone.Common/Exceptron}/ExceptronClient.cs (87%) rename src/{Exceptron.Client => NzbDrone.Common/Exceptron}/IExceptronClient.cs (91%) rename src/{Exceptron.Client => NzbDrone.Common/Exceptron}/IRestClient.cs (79%) rename src/{Exceptron.Client => NzbDrone.Common/Exceptron}/Message/ExceptionReport.cs (98%) rename src/{Exceptron.Client => NzbDrone.Common/Exceptron}/Message/ExceptionResponse.cs (91%) rename src/{Exceptron.Client => NzbDrone.Common/Exceptron}/Message/Frame.cs (93%) rename src/{Exceptron.Client => NzbDrone.Common/Exceptron}/RestClient.cs (96%) rename src/{Exceptron.Client => NzbDrone.Common/Exceptron}/fastJSON/Getters.cs (90%) rename src/{Exceptron.Client => NzbDrone.Common/Exceptron}/fastJSON/JSON.cs (99%) rename src/{Exceptron.Client => NzbDrone.Common/Exceptron}/fastJSON/JsonParser.cs (99%) rename src/{Exceptron.Client => NzbDrone.Common/Exceptron}/fastJSON/JsonSerializer.cs (99%) rename src/{Exceptron.Client => NzbDrone.Common/Exceptron}/fastJSON/SafeDictionary.cs (94%) rename src/{Exceptron.Client => NzbDrone.Common/Exceptron}/fastJSON/license.txt (100%) diff --git a/src/Exceptron.Client/Exceptron.Client.csproj b/src/Exceptron.Client/Exceptron.Client.csproj deleted file mode 100644 index 5cbe3f6bc..000000000 --- a/src/Exceptron.Client/Exceptron.Client.csproj +++ /dev/null @@ -1,89 +0,0 @@ - - - - Debug - x86 - 8.0.30703 - 2.0 - {B1784698-592E-4132-BDFA-9817409E3A96} - Library - Properties - Exceptron.Client - Exceptron.Client - v4.0 - 512 - ..\ - true - - - - false - - - true - ..\..\_output\ - DEBUG;TRACE - full - x86 - prompt - MinimumRecommendedRules.ruleset - 4 - false - - - ..\..\_output\ - TRACE - true - pdbonly - x86 - prompt - MinimumRecommendedRules.ruleset - 4 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - PreserveNewest - Designer - - - Designer - - - - - - - - \ No newline at end of file diff --git a/src/Exceptron.Client/Exceptron.Client.nuspec b/src/Exceptron.Client/Exceptron.Client.nuspec deleted file mode 100644 index 163ba4cef..000000000 --- a/src/Exceptron.Client/Exceptron.Client.nuspec +++ /dev/null @@ -1,20 +0,0 @@ - - - - $id$ - $version$ - $id$ - $author$ - $author$ - https://github.com/Exceptron/Exceptron.Net - https://www.exceptron.com/logos/Exceptron128.png - false - Exceptron.Client is a .NET wrapper for exceptron's REST API. exceptron help you report your application error to a central location for review, reporting and analytics. - en-US - Copyright © 2012 - Exception Logging Analytics Reporting Exceptron - - - - - \ No newline at end of file diff --git a/src/Exceptron.Client/NuGet/web.config.transform b/src/Exceptron.Client/NuGet/web.config.transform deleted file mode 100644 index b3a77b15f..000000000 --- a/src/Exceptron.Client/NuGet/web.config.transform +++ /dev/null @@ -1,7 +0,0 @@ - - - -
- - - \ No newline at end of file diff --git a/src/Exceptron.Client/Properties/AssemblyInfo.cs b/src/Exceptron.Client/Properties/AssemblyInfo.cs deleted file mode 100644 index 915d4e52d..000000000 --- a/src/Exceptron.Client/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,30 +0,0 @@ -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("Exceptron.Client")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyDescription(".NET client for exceptron API. In-cloud exception aggregation and analytics.")] -[assembly: AssemblyCompany("Exceptron Solutions Inc.")] -[assembly: AssemblyProduct("Exceptron.Client")] -[assembly: AssemblyCopyright("Copyright © 2012")] -[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("a463887e-594f-4733-b227-a79f4ffb2158")] - -[assembly: AssemblyVersion("10.0.0.*")] - -[assembly: InternalsVisibleTo("Exceptron.Client.Tests")] -[assembly: InternalsVisibleTo("Exceptron.Api.v1.Tests")] -[assembly: InternalsVisibleTo("Exceptron.Rush")] -[assembly: InternalsVisibleTo("DynamicProxyGenAssembly2")] diff --git a/src/Exceptron.Client/Configuration/ExceptronConfiguration.cs b/src/NzbDrone.Common/Exceptron/Configuration/ExceptronConfiguration.cs similarity index 96% rename from src/Exceptron.Client/Configuration/ExceptronConfiguration.cs rename to src/NzbDrone.Common/Exceptron/Configuration/ExceptronConfiguration.cs index 695710699..101eb7ed4 100644 --- a/src/Exceptron.Client/Configuration/ExceptronConfiguration.cs +++ b/src/NzbDrone.Common/Exceptron/Configuration/ExceptronConfiguration.cs @@ -1,8 +1,8 @@ using System.ComponentModel; using System.Configuration; -using Exceptron.Client.Message; +using NzbDrone.Common.Exceptron.Message; -namespace Exceptron.Client.Configuration +namespace NzbDrone.Common.Exceptron.Configuration { public class ExceptronConfiguration : ConfigurationSection diff --git a/src/Exceptron.Client/ExceptionData.cs b/src/NzbDrone.Common/Exceptron/ExceptionData.cs similarity index 79% rename from src/Exceptron.Client/ExceptionData.cs rename to src/NzbDrone.Common/Exceptron/ExceptionData.cs index 3e804e265..26d6cf23f 100644 --- a/src/Exceptron.Client/ExceptionData.cs +++ b/src/NzbDrone.Common/Exceptron/ExceptionData.cs @@ -1,7 +1,6 @@ using System; -using System.Web; -namespace Exceptron.Client +namespace NzbDrone.Common.Exceptron { /// /// Represents information that will be used to construct an exception report. @@ -51,12 +50,6 @@ namespace Exceptron.Client /// Severity of the exception being reported /// public ExceptionSeverity Severity { get; set; } - - - /// - /// that triggered this exception. If no is provided - /// will try to get the current from - /// - public HttpContext HttpContext { get; set; } + } } \ No newline at end of file diff --git a/src/Exceptron.Client/ExceptionSeverity.cs b/src/NzbDrone.Common/Exceptron/ExceptionSeverity.cs similarity index 94% rename from src/Exceptron.Client/ExceptionSeverity.cs rename to src/NzbDrone.Common/Exceptron/ExceptionSeverity.cs index aafa97e69..e76b26f66 100644 --- a/src/Exceptron.Client/ExceptionSeverity.cs +++ b/src/NzbDrone.Common/Exceptron/ExceptionSeverity.cs @@ -1,4 +1,4 @@ -namespace Exceptron.Client +namespace NzbDrone.Common.Exceptron { /// /// Severity of the exception being reported diff --git a/src/Exceptron.Client/ExceptronApiException.cs b/src/NzbDrone.Common/Exceptron/ExceptronApiException.cs similarity index 91% rename from src/Exceptron.Client/ExceptronApiException.cs rename to src/NzbDrone.Common/Exceptron/ExceptronApiException.cs index beca6443b..78e7f52c3 100644 --- a/src/Exceptron.Client/ExceptronApiException.cs +++ b/src/NzbDrone.Common/Exceptron/ExceptronApiException.cs @@ -1,7 +1,7 @@ using System; using System.Net; -namespace Exceptron.Client +namespace NzbDrone.Common.Exceptron { public class ExceptronApiException : Exception { diff --git a/src/Exceptron.Client/ExceptronClient.cs b/src/NzbDrone.Common/Exceptron/ExceptronClient.cs similarity index 87% rename from src/Exceptron.Client/ExceptronClient.cs rename to src/NzbDrone.Common/Exceptron/ExceptronClient.cs index 0deae5732..a84c64b00 100644 --- a/src/Exceptron.Client/ExceptronClient.cs +++ b/src/NzbDrone.Common/Exceptron/ExceptronClient.cs @@ -3,12 +3,39 @@ using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Threading; -using System.Web; -using Exceptron.Client.Configuration; -using Exceptron.Client.Message; +using NzbDrone.Common.EnvironmentInfo; +using NzbDrone.Common.Exceptron.Configuration; +using NzbDrone.Common.Exceptron.Message; -namespace Exceptron.Client +namespace NzbDrone.Common.Exceptron { + + public static class ExceptionExtentions + { + private const string IgnoreFlag = "exceptron_ignore"; + + public static Exception ExceptronIgnoreOnMono(this Exception exception) + { + if (OsInfo.IsMono) + { + exception.ExceptronIgnore(); + } + + return exception; + } + + public static Exception ExceptronIgnore(this Exception exception) + { + exception.Data.Add(IgnoreFlag, true); + return exception; + } + + public static bool ExceptronShouldIgnore(this Exception exception) + { + return exception.Data.Contains(IgnoreFlag); + } + } + public class ExceptronClient : IExceptronClient { internal IRestClient RestClient { private get; set; } @@ -103,7 +130,7 @@ namespace Exceptron.Client /// in which the exception occurred. If no is provided /// will try to get the current from /// - public ExceptionResponse SubmitException(Exception exception, string component, ExceptionSeverity severity = ExceptionSeverity.None, string message = null, string userId = null, HttpContext httpContext = null) + public ExceptionResponse SubmitException(Exception exception, string component, ExceptionSeverity severity = ExceptionSeverity.None, string message = null, string userId = null) { var exceptionData = new ExceptionData { @@ -111,8 +138,7 @@ namespace Exceptron.Client Component = component, Severity = severity, Message = message, - UserId = userId, - HttpContext = httpContext + UserId = userId }; return SubmitException(exceptionData); @@ -146,7 +172,6 @@ namespace Exceptron.Client report.fv = _maxFrameworkVersion; report.ft = FrameworkType; - SetHttpInfo(exceptionData, report); SetEnviromentInfo(report); var exceptionResponse = RestClient.Put(Configuration.Host, report); @@ -209,37 +234,7 @@ namespace Exceptron.Client } } - private void SetHttpInfo(ExceptionData exceptionData, ExceptionReport report) - { - if (exceptionData.HttpContext == null && HttpContext.Current == null) - return; - if (exceptionData.HttpContext == null) - { - exceptionData.HttpContext = HttpContext.Current; - } - - try - { - - report.hm = exceptionData.HttpContext.Request.HttpMethod; - - //TODO:find proper way to find http status code. - /* - var httpException = exceptionData.Exception as HttpException; - if (httpException != null) - { - report.sc = httpException.GetHttpCode(); - }*/ - - report.url = exceptionData.HttpContext.Request.Url.ToString(); - report.ua = exceptionData.HttpContext.Request.UserAgent; - } - catch (Exception) - { - if (Configuration.ThrowExceptions) throw; - } - } internal static List ConvertToFrames(Exception exception) { diff --git a/src/Exceptron.Client/IExceptronClient.cs b/src/NzbDrone.Common/Exceptron/IExceptronClient.cs similarity index 91% rename from src/Exceptron.Client/IExceptronClient.cs rename to src/NzbDrone.Common/Exceptron/IExceptronClient.cs index 518e70a4d..a942b5cf0 100644 --- a/src/Exceptron.Client/IExceptronClient.cs +++ b/src/NzbDrone.Common/Exceptron/IExceptronClient.cs @@ -1,9 +1,8 @@ using System; -using System.Web; -using Exceptron.Client.Configuration; -using Exceptron.Client.Message; +using NzbDrone.Common.Exceptron.Configuration; +using NzbDrone.Common.Exceptron.Message; -namespace Exceptron.Client +namespace NzbDrone.Common.Exceptron { public interface IExceptronClient { @@ -40,6 +39,6 @@ namespace Exceptron.Client /// in which the exception occurred. If no is provided /// will try to get the current from /// - ExceptionResponse SubmitException(Exception exception, string component, ExceptionSeverity severity = ExceptionSeverity.None, string message = null, string userId = null, HttpContext httpContext = null); + ExceptionResponse SubmitException(Exception exception, string component, ExceptionSeverity severity = ExceptionSeverity.None, string message = null, string userId = null); } } \ No newline at end of file diff --git a/src/Exceptron.Client/IRestClient.cs b/src/NzbDrone.Common/Exceptron/IRestClient.cs similarity index 79% rename from src/Exceptron.Client/IRestClient.cs rename to src/NzbDrone.Common/Exceptron/IRestClient.cs index b2ed3357a..d2639fd2e 100644 --- a/src/Exceptron.Client/IRestClient.cs +++ b/src/NzbDrone.Common/Exceptron/IRestClient.cs @@ -1,4 +1,4 @@ -namespace Exceptron.Client +namespace NzbDrone.Common.Exceptron { internal interface IRestClient { diff --git a/src/Exceptron.Client/Message/ExceptionReport.cs b/src/NzbDrone.Common/Exceptron/Message/ExceptionReport.cs similarity index 98% rename from src/Exceptron.Client/Message/ExceptionReport.cs rename to src/NzbDrone.Common/Exceptron/Message/ExceptionReport.cs index 5a6878459..039ab58cb 100644 --- a/src/Exceptron.Client/Message/ExceptionReport.cs +++ b/src/NzbDrone.Common/Exceptron/Message/ExceptionReport.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; -namespace Exceptron.Client.Message +namespace NzbDrone.Common.Exceptron.Message { internal class ExceptionReport { diff --git a/src/Exceptron.Client/Message/ExceptionResponse.cs b/src/NzbDrone.Common/Exceptron/Message/ExceptionResponse.cs similarity index 91% rename from src/Exceptron.Client/Message/ExceptionResponse.cs rename to src/NzbDrone.Common/Exceptron/Message/ExceptionResponse.cs index 4ba531adb..92dbd2b4c 100644 --- a/src/Exceptron.Client/Message/ExceptionResponse.cs +++ b/src/NzbDrone.Common/Exceptron/Message/ExceptionResponse.cs @@ -1,7 +1,7 @@ using System; -using Exceptron.Client.Configuration; +using NzbDrone.Common.Exceptron.Configuration; -namespace Exceptron.Client.Message +namespace NzbDrone.Common.Exceptron.Message { public class ExceptionResponse { diff --git a/src/Exceptron.Client/Message/Frame.cs b/src/NzbDrone.Common/Exceptron/Message/Frame.cs similarity index 93% rename from src/Exceptron.Client/Message/Frame.cs rename to src/NzbDrone.Common/Exceptron/Message/Frame.cs index e4ea6ce22..b46d62d90 100644 --- a/src/Exceptron.Client/Message/Frame.cs +++ b/src/NzbDrone.Common/Exceptron/Message/Frame.cs @@ -1,4 +1,4 @@ -namespace Exceptron.Client.Message +namespace NzbDrone.Common.Exceptron.Message { internal class Frame { diff --git a/src/Exceptron.Client/RestClient.cs b/src/NzbDrone.Common/Exceptron/RestClient.cs similarity index 96% rename from src/Exceptron.Client/RestClient.cs rename to src/NzbDrone.Common/Exceptron/RestClient.cs index 3ff2ca01a..ccedc7d81 100644 --- a/src/Exceptron.Client/RestClient.cs +++ b/src/NzbDrone.Common/Exceptron/RestClient.cs @@ -3,9 +3,9 @@ using System.Diagnostics; using System.IO; using System.Net; using System.Text; -using Exceptron.Client.fastJSON; +using NzbDrone.Common.Exceptron.fastJSON; -namespace Exceptron.Client +namespace NzbDrone.Common.Exceptron { public sealed class RestClient : IRestClient { diff --git a/src/Exceptron.Client/fastJSON/Getters.cs b/src/NzbDrone.Common/Exceptron/fastJSON/Getters.cs similarity index 90% rename from src/Exceptron.Client/fastJSON/Getters.cs rename to src/NzbDrone.Common/Exceptron/fastJSON/Getters.cs index f6e2b8057..4a10ed540 100644 --- a/src/Exceptron.Client/fastJSON/Getters.cs +++ b/src/NzbDrone.Common/Exceptron/fastJSON/Getters.cs @@ -4,7 +4,7 @@ using System; using System.Collections.Generic; -namespace Exceptron.Client.fastJSON +namespace NzbDrone.Common.Exceptron.fastJSON { internal class Getters { diff --git a/src/Exceptron.Client/fastJSON/JSON.cs b/src/NzbDrone.Common/Exceptron/fastJSON/JSON.cs similarity index 99% rename from src/Exceptron.Client/fastJSON/JSON.cs rename to src/NzbDrone.Common/Exceptron/fastJSON/JSON.cs index 4aaa4dd2c..c08883b33 100644 --- a/src/Exceptron.Client/fastJSON/JSON.cs +++ b/src/NzbDrone.Common/Exceptron/fastJSON/JSON.cs @@ -11,7 +11,7 @@ using System.Reflection; using System.Reflection.Emit; using System.Xml.Serialization; -namespace Exceptron.Client.fastJSON +namespace NzbDrone.Common.Exceptron.fastJSON { internal class JSON diff --git a/src/Exceptron.Client/fastJSON/JsonParser.cs b/src/NzbDrone.Common/Exceptron/fastJSON/JsonParser.cs similarity index 99% rename from src/Exceptron.Client/fastJSON/JsonParser.cs rename to src/NzbDrone.Common/Exceptron/fastJSON/JsonParser.cs index b1fb6495c..e1de1b925 100644 --- a/src/Exceptron.Client/fastJSON/JsonParser.cs +++ b/src/NzbDrone.Common/Exceptron/fastJSON/JsonParser.cs @@ -6,7 +6,7 @@ using System.Collections; using System.Collections.Generic; using System.Text; -namespace Exceptron.Client.fastJSON +namespace NzbDrone.Common.Exceptron.fastJSON { /// /// This class encodes and decodes JSON strings. diff --git a/src/Exceptron.Client/fastJSON/JsonSerializer.cs b/src/NzbDrone.Common/Exceptron/fastJSON/JsonSerializer.cs similarity index 99% rename from src/Exceptron.Client/fastJSON/JsonSerializer.cs rename to src/NzbDrone.Common/Exceptron/fastJSON/JsonSerializer.cs index f52e6e47d..fc2988e51 100644 --- a/src/Exceptron.Client/fastJSON/JsonSerializer.cs +++ b/src/NzbDrone.Common/Exceptron/fastJSON/JsonSerializer.cs @@ -9,7 +9,7 @@ using System.Globalization; using System.IO; using System.Text; -namespace Exceptron.Client.fastJSON +namespace NzbDrone.Common.Exceptron.fastJSON { internal class JSONSerializer { diff --git a/src/Exceptron.Client/fastJSON/SafeDictionary.cs b/src/NzbDrone.Common/Exceptron/fastJSON/SafeDictionary.cs similarity index 94% rename from src/Exceptron.Client/fastJSON/SafeDictionary.cs rename to src/NzbDrone.Common/Exceptron/fastJSON/SafeDictionary.cs index 40e314b61..d35b98b49 100644 --- a/src/Exceptron.Client/fastJSON/SafeDictionary.cs +++ b/src/NzbDrone.Common/Exceptron/fastJSON/SafeDictionary.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; -namespace Exceptron.Client.fastJSON +namespace NzbDrone.Common.Exceptron.fastJSON { internal class SafeDictionary { diff --git a/src/Exceptron.Client/fastJSON/license.txt b/src/NzbDrone.Common/Exceptron/fastJSON/license.txt similarity index 100% rename from src/Exceptron.Client/fastJSON/license.txt rename to src/NzbDrone.Common/Exceptron/fastJSON/license.txt diff --git a/src/NzbDrone.Common/Instrumentation/ExceptronTarget.cs b/src/NzbDrone.Common/Instrumentation/ExceptronTarget.cs index d3e56c113..437b48024 100644 --- a/src/NzbDrone.Common/Instrumentation/ExceptronTarget.cs +++ b/src/NzbDrone.Common/Instrumentation/ExceptronTarget.cs @@ -1,12 +1,11 @@ using System; -using System.Diagnostics; -using Exceptron.Client; -using Exceptron.Client.Configuration; using NLog; using NLog.Common; using NLog.Layouts; using NLog.Targets; using NzbDrone.Common.EnvironmentInfo; +using NzbDrone.Common.Exceptron; +using NzbDrone.Common.Exceptron.Configuration; namespace NzbDrone.Common.Instrumentation { @@ -46,9 +45,7 @@ namespace NzbDrone.Common.Instrumentation protected override void Write(LogEventInfo logEvent) { - if (logEvent == null || logEvent.Exception == null) return; - - InternalLogger.Debug("Sending Exception to api.exceptron.com. Process Name: {0}", Process.GetCurrentProcess().ProcessName); + if (logEvent == null || logEvent.Exception == null || logEvent.Exception.ExceptronShouldIgnore()) return; try { diff --git a/src/NzbDrone.Common/NzbDrone.Common.csproj b/src/NzbDrone.Common/NzbDrone.Common.csproj index ba97e0ebd..b697320b3 100644 --- a/src/NzbDrone.Common/NzbDrone.Common.csproj +++ b/src/NzbDrone.Common/NzbDrone.Common.csproj @@ -47,6 +47,7 @@ + @@ -55,6 +56,7 @@ ..\packages\NLog.2.1.0\lib\net40\NLog.dll + @@ -99,6 +101,22 @@ + + + + + + + + + + + + + + + + @@ -170,14 +188,9 @@ + - - - {B1784698-592E-4132-BDFA-9817409E3A96} - Exceptron.Client - - diff --git a/src/NzbDrone.Console/ConsoleApp.cs b/src/NzbDrone.Console/ConsoleApp.cs index 99fb834fd..5a2e22448 100644 --- a/src/NzbDrone.Console/ConsoleApp.cs +++ b/src/NzbDrone.Console/ConsoleApp.cs @@ -25,12 +25,13 @@ namespace NzbDrone.Console Logger.FatalException("EPIC FAIL!", e); System.Console.WriteLine("Press any key to exit..."); System.Console.ReadLine(); - - //Need this to terminate on mono (thanks nlog) - LogManager.Configuration = null; } Logger.Info("Exiting main."); + + //Need this to terminate on mono (thanks nlog) + LogManager.Configuration = null; + Environment.Exit(0); } } } diff --git a/src/NzbDrone.Host/Bootstrap.cs b/src/NzbDrone.Host/Bootstrap.cs index 66bbe0cf3..1f736d1f3 100644 --- a/src/NzbDrone.Host/Bootstrap.cs +++ b/src/NzbDrone.Host/Bootstrap.cs @@ -83,7 +83,7 @@ namespace NzbDrone.Host _container.Resolve().Spin(); } - private static void EnsureSingleInstance(bool isService, StartupContext startupContext) + private static void EnsureSingleInstance(bool isService, IStartupContext startupContext) { var instancePolicy = _container.Resolve(); @@ -101,7 +101,7 @@ namespace NzbDrone.Host } } - private static ApplicationModes GetApplicationMode(StartupContext startupContext) + private static ApplicationModes GetApplicationMode(IStartupContext startupContext) { if (startupContext.Flags.Contains(StartupContext.HELP)) { diff --git a/src/NzbDrone.sln b/src/NzbDrone.sln index d96a71dda..6e00e6e08 100644 --- a/src/NzbDrone.sln +++ b/src/NzbDrone.sln @@ -1,6 +1,8 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 2012 +# Visual Studio 2013 +VisualStudioVersion = 12.0.30723.0 +MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{57A04B72-8088-4F75-A582-1158CF8291F7}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Test.Common", "Test.Common", "{47697CDB-27B6-4B05-B4F8-0CBE6F6EDF97}" @@ -44,8 +46,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = ".nuget", ".nuget", "{1E6B3C EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NzbDrone.Api", "NzbDrone.Api\NzbDrone.Api.csproj", "{FD286DF8-2D3A-4394-8AD5-443FADE55FB2}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Exceptron.Client", "Exceptron.Client\Exceptron.Client.csproj", "{B1784698-592E-4132-BDFA-9817409E3A96}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Host", "Host", "{486ADF86-DD89-4E19-B805-9D94F19800D9}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NzbDrone.Console", "NzbDrone.Console\NzbDrone.Console.csproj", "{3DCA7B58-B8B3-49AC-9D9E-56F4A0460976}" @@ -313,21 +313,6 @@ Global {FD286DF8-2D3A-4394-8AD5-443FADE55FB2}.Release|Mixed Platforms.Build.0 = Release|x86 {FD286DF8-2D3A-4394-8AD5-443FADE55FB2}.Release|x86.ActiveCfg = Release|x86 {FD286DF8-2D3A-4394-8AD5-443FADE55FB2}.Release|x86.Build.0 = Release|x86 - {B1784698-592E-4132-BDFA-9817409E3A96}.Debug|Any CPU.ActiveCfg = Debug|x86 - {B1784698-592E-4132-BDFA-9817409E3A96}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 - {B1784698-592E-4132-BDFA-9817409E3A96}.Debug|Mixed Platforms.Build.0 = Debug|x86 - {B1784698-592E-4132-BDFA-9817409E3A96}.Debug|x86.ActiveCfg = Debug|x86 - {B1784698-592E-4132-BDFA-9817409E3A96}.Debug|x86.Build.0 = Debug|x86 - {B1784698-592E-4132-BDFA-9817409E3A96}.Mono|Any CPU.ActiveCfg = Release|x86 - {B1784698-592E-4132-BDFA-9817409E3A96}.Mono|Mixed Platforms.ActiveCfg = Release|x86 - {B1784698-592E-4132-BDFA-9817409E3A96}.Mono|Mixed Platforms.Build.0 = Release|x86 - {B1784698-592E-4132-BDFA-9817409E3A96}.Mono|x86.ActiveCfg = Debug|x86 - {B1784698-592E-4132-BDFA-9817409E3A96}.Mono|x86.Build.0 = Debug|x86 - {B1784698-592E-4132-BDFA-9817409E3A96}.Release|Any CPU.ActiveCfg = Release|x86 - {B1784698-592E-4132-BDFA-9817409E3A96}.Release|Mixed Platforms.ActiveCfg = Release|x86 - {B1784698-592E-4132-BDFA-9817409E3A96}.Release|Mixed Platforms.Build.0 = Release|x86 - {B1784698-592E-4132-BDFA-9817409E3A96}.Release|x86.ActiveCfg = Release|x86 - {B1784698-592E-4132-BDFA-9817409E3A96}.Release|x86.Build.0 = Release|x86 {3DCA7B58-B8B3-49AC-9D9E-56F4A0460976}.Debug|Any CPU.ActiveCfg = Debug|x86 {3DCA7B58-B8B3-49AC-9D9E-56F4A0460976}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 {3DCA7B58-B8B3-49AC-9D9E-56F4A0460976}.Debug|Mixed Platforms.Build.0 = Debug|x86 @@ -491,6 +476,8 @@ Global EndGlobalSection GlobalSection(NestedProjects) = preSolution {47697CDB-27B6-4B05-B4F8-0CBE6F6EDF97} = {57A04B72-8088-4F75-A582-1158CF8291F7} + {FAFB5948-A222-4CF6-AD14-026BE7564802} = {47697CDB-27B6-4B05-B4F8-0CBE6F6EDF97} + {CADDFCE0-7509-4430-8364-2074E1EEFCA2} = {47697CDB-27B6-4B05-B4F8-0CBE6F6EDF97} {193ADD3B-792B-4173-8E4C-5A3F8F0237F0} = {57A04B72-8088-4F75-A582-1158CF8291F7} {C0EA1A40-91AD-4EEB-BD16-2DDDEBD20AE5} = {57A04B72-8088-4F75-A582-1158CF8291F7} {35388E8E-0CDB-4A84-AD16-E4B6EFDA5D97} = {57A04B72-8088-4F75-A582-1158CF8291F7} @@ -499,9 +486,6 @@ Global {CBF6B8B0-A015-413A-8C86-01238BB45770} = {57A04B72-8088-4F75-A582-1158CF8291F7} {8CEFECD0-A6C2-498F-98B1-3FBE5820F9AB} = {57A04B72-8088-4F75-A582-1158CF8291F7} {CC26800D-F67E-464B-88DE-8EB1A0C227A3} = {57A04B72-8088-4F75-A582-1158CF8291F7} - {4EACDBBC-BCD7-4765-A57B-3E08331E4749} = {57A04B72-8088-4F75-A582-1158CF8291F7} - {FAFB5948-A222-4CF6-AD14-026BE7564802} = {47697CDB-27B6-4B05-B4F8-0CBE6F6EDF97} - {CADDFCE0-7509-4430-8364-2074E1EEFCA2} = {47697CDB-27B6-4B05-B4F8-0CBE6F6EDF97} {6BCE712F-846D-4846-9D1B-A66B858DA755} = {F9E67978-5CD6-4A5F-827B-4249711C0B02} {700D0B95-95CD-43F3-B6C9-FAA0FC1358D4} = {F9E67978-5CD6-4A5F-827B-4249711C0B02} {3DCA7B58-B8B3-49AC-9D9E-56F4A0460976} = {486ADF86-DD89-4E19-B805-9D94F19800D9} @@ -510,8 +494,9 @@ Global {1B9A82C4-BCA1-4834-A33E-226F17BE070B} = {F6E3A728-AE77-4D02-BAC8-82FBC1402DDA} {2B8C6DAD-4D85-41B1-83FD-248D9F347522} = {F6E3A728-AE77-4D02-BAC8-82FBC1402DDA} {F6FC6BE7-0847-4817-A1ED-223DC647C3D7} = {F6E3A728-AE77-4D02-BAC8-82FBC1402DDA} - {911284D3-F130-459E-836C-2430B6FBF21D} = {0F0D4998-8F5D-4467-A909-BB192C4B3B4B} {15AD7579-A314-4626-B556-663F51D97CD1} = {0F0D4998-8F5D-4467-A909-BB192C4B3B4B} + {911284D3-F130-459E-836C-2430B6FBF21D} = {0F0D4998-8F5D-4467-A909-BB192C4B3B4B} + {4EACDBBC-BCD7-4765-A57B-3E08331E4749} = {57A04B72-8088-4F75-A582-1158CF8291F7} {80B51429-7A0E-46D6-BEE3-C80DCB1C4EAA} = {4EACDBBC-BCD7-4765-A57B-3E08331E4749} {40D72824-7D02-4A77-9106-8FE0EEA2B997} = {4EACDBBC-BCD7-4765-A57B-3E08331E4749} EndGlobalSection