diff --git a/Src/CoreConsoleApp/CoreConsoleApp.csproj b/Src/CoreConsoleApp/CoreConsoleApp.csproj index ebe8247..c8ad429 100644 --- a/Src/CoreConsoleApp/CoreConsoleApp.csproj +++ b/Src/CoreConsoleApp/CoreConsoleApp.csproj @@ -1,31 +1,39 @@  - netcoreapp1.0 + netcoreapp2.0 CoreConsoleApp Exe CoreConsoleApp win10-x64 - 1.0.4 - $(PackageTargetFallback);dnxcore50 + 2.0.0 false false false + - - + + + - - - + + + + + NETCORE + + + + NETFULL + diff --git a/Src/CoreConsoleApp/Program.cs b/Src/CoreConsoleApp/Program.cs index 7d6e8f9..e08a559 100644 --- a/Src/CoreConsoleApp/Program.cs +++ b/Src/CoreConsoleApp/Program.cs @@ -24,8 +24,7 @@ static void Main(string[] args) { var builder = new ConfigurationBuilder() .SetBasePath(Directory.GetCurrentDirectory()) - .AddJsonFile("appsettings.json", optional: true, - reloadOnChange: true); + .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true); var config = builder.Build(); config.ConfigureStackifyLogging(); diff --git a/Src/CoreWebApp/CoreWebApp.csproj b/Src/CoreWebApp/CoreWebApp.csproj index 7392d38..3d06918 100644 --- a/Src/CoreWebApp/CoreWebApp.csproj +++ b/Src/CoreWebApp/CoreWebApp.csproj @@ -1,13 +1,12 @@ - netcoreapp1.0 + netcoreapp2.0 true CoreWebApp Exe CoreWebApp - 1.0.4 - $(PackageTargetFallback);dotnet5.6;portable-net45+win8 + 2.0.0 @@ -25,22 +24,26 @@ - - - - - - - - - - - + + + + + + + + + + NETCORE + + + + NETFULL + diff --git a/Src/NLog.Targets.Stackify/NLog.Targets.Stackify.csproj b/Src/NLog.Targets.Stackify/NLog.Targets.Stackify.csproj index 5f928a8..7a9a1e3 100644 --- a/Src/NLog.Targets.Stackify/NLog.Targets.Stackify.csproj +++ b/Src/NLog.Targets.Stackify/NLog.Targets.Stackify.csproj @@ -3,7 +3,7 @@ NLog.Targets.Stackify 2.0.0 - netstandard1.5;net40;net45 + netstandard2.0;net40;net45;net451;net452;net46 NLog.Targets.Stackify NLog.Targets.Stackify stackify;errors;logs @@ -15,7 +15,7 @@ false false false - 2.0.2 + 2.1.0 https://github.com/stackify/stackify-api-dotnet/blob/master/LICENSE https://github.com/stackify/stackify-api-dotnet https://stackify.com/wp-content/uploads/2017/02/stk.png @@ -26,21 +26,19 @@ + + + NETCORE + - + - - - - - - - - - + + NETFULL + diff --git a/Src/NLog.Targets.Stackify/StackifyTarget.cs b/Src/NLog.Targets.Stackify/StackifyTarget.cs index 0e8d07e..8c6434d 100644 --- a/Src/NLog.Targets.Stackify/StackifyTarget.cs +++ b/Src/NLog.Targets.Stackify/StackifyTarget.cs @@ -4,7 +4,7 @@ using System.Globalization; using System.Linq; using System.Reflection; -#if NET45 || NET40 +#if NETFULL using System.Runtime.Remoting.Messaging; #endif using StackifyLib; @@ -145,7 +145,7 @@ private Dictionary GetDiagnosticContextProperties() } } -#if NET45 || NET40 +#if NETFULL foreach (string key in _CallContextKeys) { diff --git a/Src/StackifyLib.AspNetCore/StackifyLib.AspNetCore.csproj b/Src/StackifyLib.AspNetCore/StackifyLib.AspNetCore.csproj index 7f0cf14..e22709d 100644 --- a/Src/StackifyLib.AspNetCore/StackifyLib.AspNetCore.csproj +++ b/Src/StackifyLib.AspNetCore/StackifyLib.AspNetCore.csproj @@ -3,16 +3,14 @@ StackifyLib for AspNetCore 2.0.0 - netstandard1.3;net451 + netstandard2.0 StackifyLib.AspNetCore StackifyLib.AspNetCore stackify;metrics;errors;logs - 1.6.1 - $(PackageTargetFallback);dnxcore50 false false false - 2.0.1 + 2.1.0 StackifyLib.AspNetCore https://github.com/stackify/stackify-api-dotnet/blob/master/LICENSE https://github.com/stackify/stackify-api-dotnet @@ -25,25 +23,14 @@ - - - - - - - - - - - - - + + - - - - - + + + + + diff --git a/Src/StackifyLib.CoreLogger/StackifyLib.CoreLogger.csproj b/Src/StackifyLib.CoreLogger/StackifyLib.CoreLogger.csproj index 5b999df..09d9f0f 100644 --- a/Src/StackifyLib.CoreLogger/StackifyLib.CoreLogger.csproj +++ b/Src/StackifyLib.CoreLogger/StackifyLib.CoreLogger.csproj @@ -3,12 +3,10 @@ Stackify .NET Core LoggerFactory 2.0.0 - netstandard1.3;net45 + netstandard2.0 StackifyLib.CoreLogger StackifyLib.CoreLogger stackify;metrics;errors;logs - 1.6.1 - $(PackageTargetFallback);dnxcore50 false false false @@ -18,7 +16,7 @@ git https://stackify.com/wp-content/uploads/2017/02/stk.png StackifyLib.CoreLogger - 2.0.2 + 2.1.0 @@ -26,14 +24,8 @@ - - - - - - + - - + \ No newline at end of file diff --git a/Src/StackifyLib.StackifyTraceListener/StackifyLib.StackifyTraceListener.csproj b/Src/StackifyLib.StackifyTraceListener/StackifyLib.StackifyTraceListener.csproj index 4ed884d..30adef0 100644 --- a/Src/StackifyLib.StackifyTraceListener/StackifyLib.StackifyTraceListener.csproj +++ b/Src/StackifyLib.StackifyTraceListener/StackifyLib.StackifyTraceListener.csproj @@ -2,14 +2,13 @@ 2.0.0 - netstandard1.3;net45 + netstandard2.0;net40;net45;net451;net452;net46 StackifyLib.StackifyTraceListener StackifyLib.StackifyTraceListener - $(PackageTargetFallback);dnxcore50 false false false - 2.0.1 + 2.1.0 StackifyLib.StackifyTraceListener https://github.com/stackify/stackify-api-dotnet/blob/master/LICENSE https://github.com/stackify/stackify-api-dotnet @@ -22,12 +21,7 @@ - - - - - - + diff --git a/Src/StackifyLib.log4net/StackifyAppender.cs b/Src/StackifyLib.log4net/StackifyAppender.cs index e9e15dd..1d554ac 100644 --- a/Src/StackifyLib.log4net/StackifyAppender.cs +++ b/Src/StackifyLib.log4net/StackifyAppender.cs @@ -7,8 +7,6 @@ using Apache_log4net = log4net; using log4net.Appender; using log4net.Core; -using log4netOffical = log4net; - namespace StackifyLib.log4net { @@ -323,7 +321,7 @@ private Dictionary GetDiagnosticContextProperties() } } } -#if NET45 +#if NETFULL foreach (string mdcKey in _LogicalThreadContextKeys) { object mdcValue = Apache_log4net.LogicalThreadContext.Properties[mdcKey]; diff --git a/Src/StackifyLib.log4net/StackifyLib.log4net.csproj b/Src/StackifyLib.log4net/StackifyLib.log4net.csproj index 67a3941..86bd876 100644 --- a/Src/StackifyLib.log4net/StackifyLib.log4net.csproj +++ b/Src/StackifyLib.log4net/StackifyLib.log4net.csproj @@ -3,7 +3,7 @@ Stackify Log4Net Appender 2.0.0 - netstandard1.3;net40;net45 + netstandard2.0;net40;net45 StackifyLib.log4net StackifyLib.log4net stackify;metrics;errors;logs @@ -13,7 +13,7 @@ false false false - 2.0.1 + 2.1.0 https://github.com/stackify/stackify-api-dotnet/blob/master/LICENSE https://github.com/stackify/stackify-api-dotnet https://github.com/stackify/stackify-api-dotnet @@ -25,20 +25,17 @@ - - - - - - - - - - - - - + + + + + NETCORE + + + + NETFULL + diff --git a/Src/StackifyLib.log4net/packages.config b/Src/StackifyLib.log4net/packages.config index ca950e3..6e62391 100644 --- a/Src/StackifyLib.log4net/packages.config +++ b/Src/StackifyLib.log4net/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/Src/StackifyLib/Config.cs b/Src/StackifyLib/Config.cs index 2c40080..37817ec 100644 --- a/Src/StackifyLib/Config.cs +++ b/Src/StackifyLib/Config.cs @@ -13,7 +13,7 @@ namespace StackifyLib /// public class Config { -#if NETSTANDARD1_3 || NET451 +#if NETCORE private static Microsoft.Extensions.Configuration.IConfigurationRoot _configuration = null; public static void SetConfiguration(Microsoft.Extensions.Configuration.IConfigurationRoot configuration) @@ -151,7 +151,7 @@ internal static string Get(string key, string defaultValue = null) { if (key != null) { -#if NETSTANDARD1_3 || NET451 +#if NETCORE if (_configuration != null) { var appSettings = _configuration.GetSection("Stackify"); @@ -159,7 +159,7 @@ internal static string Get(string key, string defaultValue = null) } #endif -#if NET451 || NET45 +#if NETFULL if (string.IsNullOrEmpty(v)) { v = System.Configuration.ConfigurationManager.AppSettings[key]; diff --git a/Src/StackifyLib/Extensions.cs b/Src/StackifyLib/Extensions.cs index a068ce7..277fe4d 100644 --- a/Src/StackifyLib/Extensions.cs +++ b/Src/StackifyLib/Extensions.cs @@ -38,7 +38,7 @@ public static StackifyLib.StackifyError NewStackifyError(this Exception ex) } } -#if NETSTANDARD1_3 || NET451 +#if NETCORE public static void ConfigureStackifyLogging(this Microsoft.Extensions.Configuration.IConfigurationRoot configuration) { Config.SetConfiguration(configuration); diff --git a/Src/StackifyLib/Internal/Logs/LogClient.cs b/Src/StackifyLib/Internal/Logs/LogClient.cs index b4a96a9..08b13c9 100644 --- a/Src/StackifyLib/Internal/Logs/LogClient.cs +++ b/Src/StackifyLib/Internal/Logs/LogClient.cs @@ -323,7 +323,7 @@ internal HttpClient.StackifyWebResponse SendLogsByGroups(LogMsg[] messages) if (!_ServicePointSet) { -#if NET451 || NET45 || NET40 +#if NETFULL ServicePointManager.FindServicePoint(urlToUse, null).ConnectionLimit = 10; #endif _ServicePointSet = true; diff --git a/Src/StackifyLib/Internal/Logs/LogQueue.cs b/Src/StackifyLib/Internal/Logs/LogQueue.cs index b856f22..5ef265d 100644 --- a/Src/StackifyLib/Internal/Logs/LogQueue.cs +++ b/Src/StackifyLib/Internal/Logs/LogQueue.cs @@ -6,7 +6,7 @@ using System.Linq; using System.Threading.Tasks; -#if NET451 || NET45 || NET40 +#if NETFULL using System.Runtime.Remoting.Messaging; using StackifyLib.Web; #endif @@ -98,7 +98,7 @@ public void QueueLogMessage(Models.LogMsg msg) // ignore } -#if NET451 || NET45 || NET40 +#if NETFULL try { if (string.IsNullOrEmpty(msg.TransID)) @@ -241,7 +241,7 @@ private void OnTimer(Object stateInfo) if (_FlushInterval.TotalSeconds > 1) { _FlushInterval = TimeSpan.FromSeconds(_FlushInterval.TotalSeconds / 2); - StackifyAPILogger.Log(string.Format("#LogQueue Adjust log flush interval down to {0:0.00} seconds",_FlushInterval.TotalSeconds)); + StackifyAPILogger.Log(string.Format("#LogQueue Adjust log flush interval down to {0:0.00} seconds", _FlushInterval.TotalSeconds)); } } else if (processedCount < 10 && _FlushInterval != TimeSpan.FromSeconds(5)) @@ -261,7 +261,7 @@ private void OnTimer(Object stateInfo) { _FlushInterval = TimeSpan.FromSeconds(proposedSeconds); - StackifyAPILogger.Log(string.Format("#LogQueue Adjust log flush interval up to {0:0.00} seconds",_FlushInterval.TotalSeconds)); + StackifyAPILogger.Log(string.Format("#LogQueue Adjust log flush interval up to {0:0.00} seconds", _FlushInterval.TotalSeconds)); } } } diff --git a/Src/StackifyLib/Logger.cs b/Src/StackifyLib/Logger.cs index f22d0d8..055d161 100644 --- a/Src/StackifyLib/Logger.cs +++ b/Src/StackifyLib/Logger.cs @@ -261,7 +261,7 @@ public static List GetCurrentStackTrace(string declaringClassName, i { var frames = new List(); -#if NET451 || NET45 || NET40 +#if NETFULL try { //moves to the part of the trace where the declaring method starts then the other loop gets all the frames. This is to remove frames that happen within the logging library itself. diff --git a/Src/StackifyLib/Models/EnvironmentDetail.cs b/Src/StackifyLib/Models/EnvironmentDetail.cs index ef9dd45..83ea29f 100644 --- a/Src/StackifyLib/Models/EnvironmentDetail.cs +++ b/Src/StackifyLib/Models/EnvironmentDetail.cs @@ -7,7 +7,7 @@ using System.Threading.Tasks; using Newtonsoft.Json; using StackifyLib.Utils; -#if NET451 || NET45 || NET40 +#if NETFULL using System.Linq; using System.Web.Hosting; using System.Management; @@ -36,7 +36,7 @@ public static EnvironmentDetail Get(bool refresh) /// private void GetAzureInfo() { -#if NET451 || NET45 || NET40 +#if NETFULL if (registryAccessFailure) return; @@ -108,7 +108,7 @@ private void GetAzureInfo() /// /// Get the EC2 Instance name if it exists else null /// -#if NET451 || NET45 || NET40 +#if NETFULL public static string GetDeviceName() { @@ -284,7 +284,7 @@ private static bool IsEc2MachineName(string machineName) /// private void IsWindowService() { -#if NET451 || NET45 || NET40 +#if NETFULL try { string query = "select DisplayName from Win32_Service WHERE ProcessID='" + System.Diagnostics.Process.GetCurrentProcess().Id + "'"; @@ -323,7 +323,7 @@ public EnvironmentDetail(bool loadDetails) return; bool isWebRequest = false; -#if NET451 || NET45 || NET40 +#if NETFULL try { isWebRequest = AppDomain.CurrentDomain.FriendlyName.Contains("W3SVC"); @@ -404,7 +404,7 @@ public EnvironmentDetail(bool loadDetails) GetAzureInfo(); -#if NET451 || NET45 || NET40 +#if NETFULL //Not a web app, check for windows service if (!Environment.UserInteractive && !AppDomain.CurrentDomain.FriendlyName.Contains("W3SVC")) { @@ -414,7 +414,7 @@ public EnvironmentDetail(bool loadDetails) DeviceName = GetDeviceName(); -#if NET451 || NET45 || NET40 +#if NETFULL if (string.IsNullOrEmpty(AppName) && !isWebRequest) { AppName = AppDomain.CurrentDomain.FriendlyName; @@ -443,7 +443,7 @@ public EnvironmentDetail(bool loadDetails) StackifyLib.Utils.StackifyAPILogger.Log("Error figuring out app environment details\r\n" + ex.ToString(), true); } -#if NET451 || NET45 || NET40 +#if NETFULL try { diff --git a/Src/StackifyLib/Models/ErrorItem.cs b/Src/StackifyLib/Models/ErrorItem.cs index 3574446..b14c7e1 100644 --- a/Src/StackifyLib/Models/ErrorItem.cs +++ b/Src/StackifyLib/Models/ErrorItem.cs @@ -32,7 +32,7 @@ public ErrorItem(Exception ex) Message = ex.Message; -#if NET451 || NET45 || NET40 +#if NETFULL if (ex is System.Data.SqlClient.SqlException) { System.Data.SqlClient.SqlException sql = ex as System.Data.SqlClient.SqlException; @@ -131,7 +131,7 @@ private void AddTraceFrames(Exception ex) bool isSource = false; -#if NET451 || NET45 || NET40 +#if NETFULL isSource = (ex.TargetSite != null && ex.TargetSite == method); #endif @@ -151,7 +151,7 @@ private void AddTraceFrames(Exception ex) } } -#if NET451 || NET45 || NET40 +#if NETFULL var stackTrace2 = new StackTrace(true); var allFrames = stackTrace2.GetFrames(); @@ -196,7 +196,7 @@ public static string GetMethodFullName(MethodBase method, bool simpleMethodNames if (method == null) return "Unknown"; -#if NET451 || NET45 || NET40 +#if NETFULL if (method.ReflectedType != null) { if (simpleMethodNames) diff --git a/Src/StackifyLib/Models/WebRequestDetail.cs b/Src/StackifyLib/Models/WebRequestDetail.cs index 57ea29d..b6a4b0b 100644 --- a/Src/StackifyLib/Models/WebRequestDetail.cs +++ b/Src/StackifyLib/Models/WebRequestDetail.cs @@ -7,7 +7,7 @@ using Newtonsoft.Json; -#if NET451 || NET45 || NET40 +#if NETFULL using System.Web; using System.Web.Routing; using StackifyLib.Web; @@ -29,7 +29,7 @@ public WebRequestDetail(StackifyError error) { _Error = error; -#if NET451 || NET45 || NET40 +#if NETFULL if (System.Web.HttpContext.Current != null) { Load(System.Web.HttpContext.Current); @@ -92,7 +92,7 @@ public WebRequestDetail(StackifyError error) -#if NET451 || NET45 || NET40 +#if NETFULL private void Load(HttpContext context) { if (context == null || context.Request == null) @@ -247,7 +247,7 @@ internal static void AddKey(string key, string value, Dictionary dictionary[key] = value; } -#if NET451 || NET45 || NET40 +#if NETFULL internal static Dictionary ToKeyValues(HttpCookieCollection collection, List goodKeys, List badKeys) { var keys = collection.AllKeys; diff --git a/Src/StackifyLib/ProfileTracer.cs b/Src/StackifyLib/ProfileTracer.cs index 8b67cbd..8f31189 100644 --- a/Src/StackifyLib/ProfileTracer.cs +++ b/Src/StackifyLib/ProfileTracer.cs @@ -23,8 +23,10 @@ public class ProfileTracer private readonly string _transactionId = Guid.NewGuid().ToString(); private string _requestId = null; -#if NET45 || NET451 || NETSTANDARD1_3 +#if NETFULL +#if !NET40 private static EtwEventListener _etwEventListener = null; +#endif #endif internal bool IsOperation { get; set; } @@ -35,7 +37,7 @@ internal ProfileTracer(string methodDisplayText, string requestLevelReportingCat _requestReportingCategory = requestLevelReportingCategory; _appReportingCategory = appLevelReportingCategory; -#if NET451 || NET45 || NET40 +#if NETFULL try { if (System.Web.HttpContext.Current != null) @@ -68,7 +70,7 @@ internal ProfileTracer(string methodDisplayText, string requestLevelReportingCat [MethodImpl(MethodImplOptions.PreserveSig | MethodImplOptions.NoInlining | MethodImplOptions.NoOptimization)] public static void SetReportingUrl(string reportingUrl) { -#if NET451 || NET45 || NET40 +#if NETFULL try { if (System.Web.HttpContext.Current != null) @@ -140,11 +142,13 @@ public static ProfileTracer CreateAsTrackedFunction(string functionName) /// public static ProfileTracer CreateAsOperation(string operationName, string uniqueOperationID = null) { -#if NET45 || NET451 || NETSTANDARD1_3 +#if NETFULL +#if !NET40 if (_etwEventListener == null) { _etwEventListener = new EtwEventListener(); } +#endif #endif var tracer = new ProfileTracer(operationName, null, null); diff --git a/Src/StackifyLib/Properties/AssemblyInfo.cs b/Src/StackifyLib/Properties/AssemblyInfo.cs index f9e502f..8e4c09f 100644 --- a/Src/StackifyLib/Properties/AssemblyInfo.cs +++ b/Src/StackifyLib/Properties/AssemblyInfo.cs @@ -19,7 +19,7 @@ // COM, set the ComVisible attribute to true on that type. [assembly: ComVisible(false)] -#if NET451 || NET45 || NET40 +#if NETFULL // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("67aae97f-aa9f-4c35-b611-b68af22b9712")] #endif diff --git a/Src/StackifyLib/StackifyError.cs b/Src/StackifyLib/StackifyError.cs index 2a5ab2c..a10f439 100644 --- a/Src/StackifyLib/StackifyError.cs +++ b/Src/StackifyLib/StackifyError.cs @@ -4,7 +4,7 @@ using Newtonsoft.Json; using StackifyLib.Utils; -#if NET451 || NET45 || NET40 +#if NETFULL using System.Web; #endif @@ -92,7 +92,7 @@ public StackifyError(string message, Exception exception) Error = new ErrorItem(exception.InnerException); _Exception = exception.InnerException; } -#if NET451 || NET45 || NET40 +#if NETFULL else if (exception is HttpUnhandledException && exception.InnerException != null) { Error = new ErrorItem(exception.GetBaseException()); @@ -117,7 +117,7 @@ private void Init() EnvironmentDetail = EnvironmentDetail.Get(false); ServerVariables = new Dictionary(); -#if NET451 || NET45 || NET40 +#if NETFULL if (System.Web.HttpContext.Current != null) { // Make sure that the request is available in the current context. @@ -160,7 +160,7 @@ private void Init() } } -#elif NETSTANDARD1_3 +#else WebRequestDetail = new WebRequestDetail(this); #endif diff --git a/Src/StackifyLib/StackifyLib.csproj b/Src/StackifyLib/StackifyLib.csproj index 9c499cc..bd973d3 100644 --- a/Src/StackifyLib/StackifyLib.csproj +++ b/Src/StackifyLib/StackifyLib.csproj @@ -3,69 +3,52 @@ Stackify API 2.0.0 - netstandard1.3;net40;net45;net451 + netstandard2.0;net40;net45;net451;net452;net46 StackifyLib StackifyLib stackify;metrics;errors;logs - 1.6.1 false false false false false false - 2.0.3 + 2.1.0 StackifyLib https://github.com/stackify/stackify-api-dotnet https://github.com/stackify/stackify-api-dotnet/blob/master/LICENSE https://github.com/stackify/stackify-api-dotnet git https://stackify.com/wp-content/uploads/2017/02/stk.png - 2.0.2.0 - 2.0.2.0 + 2.1.0.0 + 2.1.0.0 - - + - - - - - - - - - - - - - - + + + + NETCORE + - - - - - - - - - - + + - - - + + + + NETFULL + - + \ No newline at end of file diff --git a/Src/StackifyLib/Utils/AsyncTracer.cs b/Src/StackifyLib/Utils/AsyncTracer.cs index c114dc1..ce08250 100644 --- a/Src/StackifyLib/Utils/AsyncTracer.cs +++ b/Src/StackifyLib/Utils/AsyncTracer.cs @@ -1,4 +1,4 @@ -#if NET45 || NET451 +#if NETFULL using System; using System.Collections.Generic; using System.Diagnostics; diff --git a/Src/StackifyLib/Utils/EtwEventListener.cs b/Src/StackifyLib/Utils/EtwEventListener.cs index a30c04c..62b8c49 100644 --- a/Src/StackifyLib/Utils/EtwEventListener.cs +++ b/Src/StackifyLib/Utils/EtwEventListener.cs @@ -1,4 +1,5 @@ -#if NET45 || NET451 || NETSTANDARD1_3 +#if NETFULL +#if !NET40 using System; using System.Collections.Generic; using System.Diagnostics; @@ -28,4 +29,5 @@ protected override void OnEventWritten(EventWrittenEventArgs eventData) } } } +#endif #endif \ No newline at end of file diff --git a/Src/StackifyLib/Utils/HelperFunctions.cs b/Src/StackifyLib/Utils/HelperFunctions.cs index 62591d6..2ae0601 100644 --- a/Src/StackifyLib/Utils/HelperFunctions.cs +++ b/Src/StackifyLib/Utils/HelperFunctions.cs @@ -133,7 +133,7 @@ public static string SerializeDebugData(object logObject, bool serializeSimpleTy } else { -#if NET451 || NET45 || NET40 +#if NETFULL var genericArgs = typeInfo.GetGenericArguments(); #else var genericArgs = typeInfo.IsGenericTypeDefinition ? diff --git a/Src/StackifyLib/Utils/HttpClient.cs b/Src/StackifyLib/Utils/HttpClient.cs index a31d848..4ba45fd 100644 --- a/Src/StackifyLib/Utils/HttpClient.cs +++ b/Src/StackifyLib/Utils/HttpClient.cs @@ -80,7 +80,7 @@ public bool IsClientError() static HttpClient() { -#if NET451 || NET45 || NET40 +#if NETFULL LoadWebProxyConfig(); #endif } @@ -118,7 +118,7 @@ public HttpClient(string apiKey, string apiUrl) BaseAPIUrl += "/"; } -#if NET451 || NET45 || NET40 +#if NETFULL public static void LoadWebProxyConfig() { try @@ -375,7 +375,7 @@ public StackifyWebResponse SendJsonAndGetResponse(string url, string jsonData, b { var request = BuildJsonRequest(url, jsonData, compress); -#if NET451 || NET45 || NET40 +#if NETFULL using (var response = (HttpWebResponse)request.GetResponse()) #else using (var response = (HttpWebResponse)request.GetResponseAsync().GetAwaiter().GetResult()) @@ -467,7 +467,7 @@ public StackifyWebResponse POSTAndGetResponse(string url, string postData) { var request = BuildPOSTRequest(url, postData); -#if NET451 || NET45 || NET40 +#if NETFULL using (var response = (HttpWebResponse)request.GetResponse()) #else using (var response = (HttpWebResponse)request.GetResponseAsync().GetAwaiter().GetResult()) @@ -577,7 +577,7 @@ private HttpWebRequest BuildJsonRequest(string url, string jsonData, bool compre if (string.IsNullOrEmpty(_version)) { -#if NET451 || NET45 || NET40 +#if NETFULL _version = Assembly.GetExecutingAssembly().GetName().Version.ToString(); #else _version = @@ -589,7 +589,7 @@ private HttpWebRequest BuildJsonRequest(string url, string jsonData, bool compre HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url); -#if NET451 || NET45 || NET40 +#if NETFULL request.UserAgent = "StackifyLib-" + _version; #else request.Headers[HttpRequestHeader.UserAgent] = "StackifyLib-" + _version; @@ -611,7 +611,7 @@ private HttpWebRequest BuildJsonRequest(string url, string jsonData, bool compre byte[] payload = Encoding.UTF8.GetBytes(jsonData); -#if NET451 || NET45 || NET40 +#if NETFULL using (Stream postStream = request.GetRequestStream()) #else using (Stream postStream = request.GetRequestStreamAsync().GetAwaiter().GetResult()) @@ -630,7 +630,7 @@ private HttpWebRequest BuildJsonRequest(string url, string jsonData, bool compre byte[] payload = Encoding.UTF8.GetBytes(jsonData); -#if NET451 || NET45 || NET40 +#if NETFULL request.ContentLength= payload.Length; using (Stream stream = request.GetRequestStream()) #else @@ -654,7 +654,7 @@ private HttpWebRequest BuildPOSTRequest(string url, string postdata) { if (string.IsNullOrEmpty(_version)) { -#if NET451 || NET45 || NET40 +#if NETFULL _version = Assembly.GetExecutingAssembly().GetName().Version.ToString(); #else _version = @@ -670,7 +670,7 @@ private HttpWebRequest BuildPOSTRequest(string url, string postdata) request.Headers["X-Stackify-Key"] = this.APIKey; request.ContentType = "application/x-www-form-urlencoded"; -#if NET451 || NET45 || NET40 +#if NETFULL request.UserAgent = "StackifyLib-" + _version; request.ContentLength = 0; #else @@ -690,7 +690,7 @@ private HttpWebRequest BuildPOSTRequest(string url, string postdata) { byte[] payload = Encoding.UTF8.GetBytes(postdata); -#if NET451 || NET45 || NET40 +#if NETFULL using (Stream postStream = request.GetRequestStream()) #else using (Stream postStream = request.GetRequestStreamAsync().GetAwaiter().GetResult()) diff --git a/Src/StackifyLib/Utils/RegistryHelper.cs b/Src/StackifyLib/Utils/RegistryHelper.cs index d534641..4eaf648 100644 --- a/Src/StackifyLib/Utils/RegistryHelper.cs +++ b/Src/StackifyLib/Utils/RegistryHelper.cs @@ -1,4 +1,4 @@ -#if NET451 || NET45 || NET40 +#if NETFULL using System; using System.Collections.Generic; using System.Linq; diff --git a/Src/StackifyLib/Utils/SequentialGuid.cs b/Src/StackifyLib/Utils/SequentialGuid.cs index 0023772..0268965 100644 --- a/Src/StackifyLib/Utils/SequentialGuid.cs +++ b/Src/StackifyLib/Utils/SequentialGuid.cs @@ -8,13 +8,13 @@ namespace StackifyLib.Utils { public static class SequentialGuid { -#if NET451 || NET45 || NET40 +#if NETFULL [DllImport("rpcrt4.dll", SetLastError = true)] private static extern int UuidCreateSequential(out Guid guid); #endif public static Guid NewGuid() { -#if NET451 || NET45 || NET40 +#if NETFULL const int RPC_S_OK = 0; Guid guid; int result = UuidCreateSequential(out guid); diff --git a/Src/StackifyLib/Utils/StackifyAPILogger.cs b/Src/StackifyLib/Utils/StackifyAPILogger.cs index bffa4a8..8baea0d 100644 --- a/Src/StackifyLib/Utils/StackifyAPILogger.cs +++ b/Src/StackifyLib/Utils/StackifyAPILogger.cs @@ -11,10 +11,10 @@ namespace StackifyLib.Utils { public class StackifyAPILogger { -#if NETSTANDARD1_3 - private static readonly string DefaultLoggerPathAndFile = Path.Combine(System.AppContext.BaseDirectory, "stackify.debug.log"); -#elif NET451 || NET45 || NET40 +#if NETFULL private static readonly string DefaultLoggerPathAndFile = Path.Combine(Environment.CurrentDirectory, "stackify.debug.log"); +#else + private static readonly string DefaultLoggerPathAndFile = Path.Combine(System.AppContext.BaseDirectory, "stackify.debug.log"); #endif private static readonly object LoggerDefaultLock = new object(); private static StreamWriter _loggerDefault; diff --git a/Src/StackifyLib/Web/ErrorLoggerHttpModule.cs b/Src/StackifyLib/Web/ErrorLoggerHttpModule.cs index 6349742..0a867c9 100644 --- a/Src/StackifyLib/Web/ErrorLoggerHttpModule.cs +++ b/Src/StackifyLib/Web/ErrorLoggerHttpModule.cs @@ -1,4 +1,4 @@ -#if NET451 || NET45 || NET40 +#if NETFULL using System; using System.Collections.Generic; using System.Linq; diff --git a/Src/StackifyLib/Web/RouteResolver.cs b/Src/StackifyLib/Web/RouteResolver.cs index a3d912b..b9236d1 100644 --- a/Src/StackifyLib/Web/RouteResolver.cs +++ b/Src/StackifyLib/Web/RouteResolver.cs @@ -1,4 +1,4 @@ -#if NET451 || NET45 || NET40 +#if NETFULL using System; using System.Linq; using System.Text;