From f1957f5c6d4ac09068b5d10a90eab14d7b9a6cb6 Mon Sep 17 00:00:00 2001 From: innocent Date: Mon, 19 Aug 2019 17:26:39 +1200 Subject: [PATCH 1/7] Added shared singleton for instantiating the webclient. cancelationtoken handler for cancelled requests --- .../Mindscape.Raygun4Net.WebApi.csproj | 1 + .../RaygunWebApiClient.cs | 87 ++++++++----------- .../RaygunWebApiDelegatingHandler.cs | 12 ++- .../WebClientHelper.cs | 51 +++++++++++ Mindscape.Raygun4Net/SimpleJson.cs | 2 +- .../Mindscape.Raygun4Net4.csproj | 3 + Mindscape.Raygun4Net4/RaygunClient.cs | 62 +++---------- 7 files changed, 117 insertions(+), 101 deletions(-) create mode 100644 Mindscape.Raygun4Net.WebApi/WebClientHelper.cs diff --git a/Mindscape.Raygun4Net.WebApi/Mindscape.Raygun4Net.WebApi.csproj b/Mindscape.Raygun4Net.WebApi/Mindscape.Raygun4Net.WebApi.csproj index 96f54dbc..6bb08903 100644 --- a/Mindscape.Raygun4Net.WebApi/Mindscape.Raygun4Net.WebApi.csproj +++ b/Mindscape.Raygun4Net.WebApi/Mindscape.Raygun4Net.WebApi.csproj @@ -84,6 +84,7 @@ + diff --git a/Mindscape.Raygun4Net.WebApi/RaygunWebApiClient.cs b/Mindscape.Raygun4Net.WebApi/RaygunWebApiClient.cs index 0531b867..9f29006a 100644 --- a/Mindscape.Raygun4Net.WebApi/RaygunWebApiClient.cs +++ b/Mindscape.Raygun4Net.WebApi/RaygunWebApiClient.cs @@ -237,6 +237,7 @@ protected bool ValidateApiKey() System.Diagnostics.Debug.WriteLine("ApiKey has not been provided, exception will not be logged"); return false; } + return true; } @@ -252,6 +253,7 @@ protected override bool CanSend(Exception exception) { return false; } + return base.CanSend(exception); } @@ -261,6 +263,7 @@ protected bool CanSend(RaygunMessage message) { return !RaygunSettings.Settings.ExcludedStatusCodes.Contains(message.Details.Response.StatusCode); } + return true; } @@ -419,7 +422,7 @@ public void AddRawDataFilter(IRaygunDataFilter filter) /// The exception to deliver. public override void Send(Exception exception) { - Send(exception, null, (IDictionary)null); + Send(exception, null, (IDictionary) null); } /// @@ -430,7 +433,7 @@ public override void Send(Exception exception) /// A list of strings associated with the message. public void Send(Exception exception, IList tags) { - Send(exception, tags, (IDictionary)null); + Send(exception, tags, (IDictionary) null); } /// @@ -458,7 +461,7 @@ public void Send(Exception exception, IList tags, IDictionary userCustom /// The exception to deliver. public void SendInBackground(Exception exception) { - SendInBackground(exception, null, (IDictionary)null); + SendInBackground(exception, null, (IDictionary) null); } /// @@ -468,7 +471,7 @@ public void SendInBackground(Exception exception) /// A list of strings associated with the message. public void SendInBackground(Exception exception, IList tags) { - SendInBackground(exception, tags, (IDictionary)null); + SendInBackground(exception, tags, (IDictionary) null); } /// @@ -486,7 +489,8 @@ public void SendInBackground(Exception exception, IList tags, IDictionar RaygunRequestMessage currentRequestMessage = BuildRequestMessage(); DateTime currentTime = DateTime.UtcNow; - ThreadPool.QueueUserWorkItem(c => { + ThreadPool.QueueUserWorkItem(c => + { _currentRequestMessage.Value = currentRequestMessage; StripAndSend(exception, tags, userCustomData, currentTime); }); @@ -547,6 +551,7 @@ protected RaygunMessage BuildMessage(Exception exception, IList tags, ID { message.Details.GroupingKey = customGroupingKey; } + return message; } @@ -585,11 +590,15 @@ protected IEnumerable StripWrapperExceptions(Exception exception) { e.Data["Type"] = rtle.Types[index]; } - catch { } + catch + { + } + foreach (Exception ex in StripWrapperExceptions(e)) { yield return ex; } + index++; } } @@ -615,55 +624,35 @@ protected IEnumerable StripWrapperExceptions(Exception exception) /// set to a valid DateTime and as much of the Details property as is available. public override void Send(RaygunMessage raygunMessage) { - if (ValidateApiKey()) + try { - bool canSend = OnSendingMessage(raygunMessage) && CanSend(raygunMessage); - if (canSend) + if (ValidateApiKey()) { - using (var client = new WebClient()) - { - client.Headers.Add("X-ApiKey", _apiKey); - client.Headers.Add("content-type", "application/json; charset=utf-8"); - client.Encoding = System.Text.Encoding.UTF8; - - if (WebRequest.DefaultWebProxy != null) - { - Uri proxyUri = WebRequest.DefaultWebProxy.GetProxy(new Uri(RaygunSettings.Settings.ApiEndpoint.ToString())); - - if (proxyUri != null && proxyUri.AbsoluteUri != RaygunSettings.Settings.ApiEndpoint.ToString()) - { - client.Proxy = new WebProxy(proxyUri, false); - - if (ProxyCredentials == null) - { - client.UseDefaultCredentials = true; - client.Proxy.Credentials = CredentialCache.DefaultCredentials; - } - else - { - client.UseDefaultCredentials = false; - client.Proxy.Credentials = ProxyCredentials; - } - } - } - try - { - var message = SimpleJson.SerializeObject(raygunMessage); - client.UploadString(RaygunSettings.Settings.ApiEndpoint, message); - } - catch (Exception ex) - { - System.Diagnostics.Trace.WriteLine(string.Format("Error Logging Exception to Raygun.io {0}", ex.Message)); - - if (RaygunSettings.Settings.ThrowOnError) - { - throw; - } - } + bool canSend = OnSendingMessage(raygunMessage) && CanSend(raygunMessage); + if (canSend) + { + var message = SimpleJson.SerializeObject(raygunMessage); + WebClientHelper.Send(message, _apiKey, ProxyCredentials); } } } + catch (Exception ex) + { + try + { + System.Diagnostics.Trace.WriteLine(string.Format("Error Logging Exception to Raygun.io {0}", ex.Message)); + } + catch + { + // ignored + } + + if (RaygunSettings.Settings.ThrowOnError) + { + throw; + } + } } } } \ No newline at end of file diff --git a/Mindscape.Raygun4Net.WebApi/RaygunWebApiDelegatingHandler.cs b/Mindscape.Raygun4Net.WebApi/RaygunWebApiDelegatingHandler.cs index cb0d4a4c..1b92551c 100644 --- a/Mindscape.Raygun4Net.WebApi/RaygunWebApiDelegatingHandler.cs +++ b/Mindscape.Raygun4Net.WebApi/RaygunWebApiDelegatingHandler.cs @@ -1,4 +1,5 @@ using System.Linq; +using System.Net; using System.Net.Http; using System.Text; @@ -23,7 +24,16 @@ protected override async System.Threading.Tasks.Task SendAs } } - return await base.SendAsync(request, cancellationToken); + var response = await base.SendAsync(request, cancellationToken); + if (cancellationToken.IsCancellationRequested) + { + return new HttpResponseMessage(HttpStatusCode.InternalServerError) + { + ReasonPhrase = "The request was cancelled by the client" + }; + } + + return response; } } } \ No newline at end of file diff --git a/Mindscape.Raygun4Net.WebApi/WebClientHelper.cs b/Mindscape.Raygun4Net.WebApi/WebClientHelper.cs new file mode 100644 index 00000000..aa5a0017 --- /dev/null +++ b/Mindscape.Raygun4Net.WebApi/WebClientHelper.cs @@ -0,0 +1,51 @@ +using System; +using System.Net; + +namespace Mindscape.Raygun4Net +{ + + public static class WebClientHelper + { + [ThreadStatic] + private static WebClient _client; + + private static WebClient Client => _client ?? (_client = new WebClient()); + private static readonly Uri ProxyUri; + + + static WebClientHelper() + { + ProxyUri = WebRequest.DefaultWebProxy.GetProxy(new Uri(RaygunSettings.Settings.ApiEndpoint.ToString())); + } + + public static void Send(string message, string apiKey, ICredentials proxyCredentials) + { + Client.Headers.Clear(); + Client.Headers.Add("X-ApiKey", apiKey); + Client.Headers.Add("content-type", "application/json; charset=utf-8"); + Client.Encoding = System.Text.Encoding.UTF8; + + if (WebRequest.DefaultWebProxy != null) + { + + if (ProxyUri != null && ProxyUri.AbsoluteUri != RaygunSettings.Settings.ApiEndpoint.ToString()) + { + Client.Proxy = new WebProxy(ProxyUri, false); + + if (proxyCredentials == null) + { + Client.UseDefaultCredentials = true; + Client.Proxy.Credentials = CredentialCache.DefaultCredentials; + } + else + { + Client.UseDefaultCredentials = false; + Client.Proxy.Credentials = proxyCredentials; + } + } + } + + Client.UploadString(RaygunSettings.Settings.ApiEndpoint, message); + } + } +} \ No newline at end of file diff --git a/Mindscape.Raygun4Net/SimpleJson.cs b/Mindscape.Raygun4Net/SimpleJson.cs index 3435212b..599fe835 100644 --- a/Mindscape.Raygun4Net/SimpleJson.cs +++ b/Mindscape.Raygun4Net/SimpleJson.cs @@ -1022,7 +1022,7 @@ static bool SerializeValue(IJsonSerializerStrategy jsonSerializerStrategy, objec if (visited.Contains(value)) { - return SerializeString(CYCLIC_MESSAGE, builder); ; + return SerializeString(CYCLIC_MESSAGE, builder); } visited.Push(value); diff --git a/Mindscape.Raygun4Net4/Mindscape.Raygun4Net4.csproj b/Mindscape.Raygun4Net4/Mindscape.Raygun4Net4.csproj index 6eac3b19..570665bf 100644 --- a/Mindscape.Raygun4Net4/Mindscape.Raygun4Net4.csproj +++ b/Mindscape.Raygun4Net4/Mindscape.Raygun4Net4.csproj @@ -60,6 +60,9 @@ Properties\AssemblyVersionInfo.cs + + WebClientHelper.cs + Breadcrumbs\DefaultBreadcrumbStorage.cs diff --git a/Mindscape.Raygun4Net4/RaygunClient.cs b/Mindscape.Raygun4Net4/RaygunClient.cs index 136a3851..76f0d1ce 100644 --- a/Mindscape.Raygun4Net4/RaygunClient.cs +++ b/Mindscape.Raygun4Net4/RaygunClient.cs @@ -1,6 +1,7 @@ using System; using System.Collections; using System.Collections.Generic; +using System.Diagnostics; using System.Linq; using System.Net; using Mindscape.Raygun4Net.Messages; @@ -605,12 +606,19 @@ public override void Send(RaygunMessage raygunMessage) { try { - Send(message); + WebClientHelper.Send(message,_apiKey, ProxyCredentials); } catch (Exception ex) { - SaveMessage(message); - System.Diagnostics.Trace.WriteLine(string.Format("Error Logging Exception to Raygun.io {0}", ex.Message)); + try + { + SaveMessage(message); + Trace.WriteLine(string.Format("Error Logging Exception to Raygun.io {0}", ex.Message)); + } + catch + { + //ignored + } if (RaygunSettings.Settings.ThrowOnError) { @@ -622,52 +630,6 @@ public override void Send(RaygunMessage raygunMessage) } } } - - private void Send(string message) - { - if (ValidateApiKey()) - { - using (var client = CreateWebClient()) - { - client.UploadString(RaygunSettings.Settings.ApiEndpoint, message); - } - } - } - - protected WebClient CreateWebClient() - { - var client = new WebClient(); - client.Headers.Add("X-ApiKey", _apiKey); - client.Headers.Add("content-type", "application/json; charset=utf-8"); - client.Encoding = System.Text.Encoding.UTF8; - - if (WebProxy != null) - { - client.Proxy = WebProxy; - } - else if (WebRequest.DefaultWebProxy != null) - { - Uri proxyUri = WebRequest.DefaultWebProxy.GetProxy(new Uri(RaygunSettings.Settings.ApiEndpoint.ToString())); - - if (proxyUri != null && proxyUri.AbsoluteUri != RaygunSettings.Settings.ApiEndpoint.ToString()) - { - client.Proxy = new WebProxy(proxyUri, false); - - if (ProxyCredentials == null) - { - client.UseDefaultCredentials = true; - client.Proxy.Credentials = CredentialCache.DefaultCredentials; - } - else - { - client.UseDefaultCredentials = false; - client.Proxy.Credentials = ProxyCredentials; - } - } - } - return client; - } - private void SaveMessage(string message) { try @@ -745,7 +707,7 @@ private void SendStoredMessages() string text = reader.ReadToEnd(); try { - Send(text); + WebClientHelper.Send(text,_apiKey, ProxyCredentials); } catch { From 6aa2d2d5af7cefba1f11610ff4b9f5952c33b2cd Mon Sep 17 00:00:00 2001 From: innocent Date: Fri, 23 Aug 2019 16:49:12 +1200 Subject: [PATCH 2/7] Formatting fixes --- Mindscape.Raygun4Net.WebApi.sln | 16 ++++++ .../Mindscape.Raygun4Net.WebApi.csproj | 4 +- .../Mindscape.Raygun4Net.csproj | 12 ++--- .../Mindscape.Raygun4Net4.csproj | 8 ++- Mindscape.Raygun4Net4/RaygunClient.cs | 50 ++++++++++++------- .../WebClientHelper.cs | 8 +-- 6 files changed, 61 insertions(+), 37 deletions(-) rename {Mindscape.Raygun4Net.WebApi => Mindscape.Raygun4Net4}/WebClientHelper.cs (95%) diff --git a/Mindscape.Raygun4Net.WebApi.sln b/Mindscape.Raygun4Net.WebApi.sln index 3010095a..b44e7924 100644 --- a/Mindscape.Raygun4Net.WebApi.sln +++ b/Mindscape.Raygun4Net.WebApi.sln @@ -9,6 +9,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mindscape.Raygun4Net.Core", EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mindscape.Raygun4Net.WebApi.Tests", "Mindscape.Raygun4Net.WebApi.Tests\Mindscape.Raygun4Net.WebApi.Tests.csproj", "{80C7BB59-C753-4E64-9C8D-79B8D57C8215}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FileUploadTest", "C:\Users\innocent\Documents\Visual Studio 2015\Projects\diagnostictest\FileUploadTest\FileUploadTest\FileUploadTest.csproj", "{E41A20CC-B2DB-4DD5-8D1D-091FB09EDAED}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mindscape.Raygun4Net", "Mindscape.Raygun4Net\Mindscape.Raygun4Net.csproj", "{495E53B3-F3AF-4C4F-BAAF-865EFAA2F4A9}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -34,6 +38,18 @@ Global {80C7BB59-C753-4E64-9C8D-79B8D57C8215}.Release|Any CPU.Build.0 = Release|Any CPU {80C7BB59-C753-4E64-9C8D-79B8D57C8215}.Sign|Any CPU.ActiveCfg = Release|Any CPU {80C7BB59-C753-4E64-9C8D-79B8D57C8215}.Sign|Any CPU.Build.0 = Release|Any CPU + {E41A20CC-B2DB-4DD5-8D1D-091FB09EDAED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E41A20CC-B2DB-4DD5-8D1D-091FB09EDAED}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E41A20CC-B2DB-4DD5-8D1D-091FB09EDAED}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E41A20CC-B2DB-4DD5-8D1D-091FB09EDAED}.Release|Any CPU.Build.0 = Release|Any CPU + {E41A20CC-B2DB-4DD5-8D1D-091FB09EDAED}.Sign|Any CPU.ActiveCfg = Debug|Any CPU + {E41A20CC-B2DB-4DD5-8D1D-091FB09EDAED}.Sign|Any CPU.Build.0 = Debug|Any CPU + {495E53B3-F3AF-4C4F-BAAF-865EFAA2F4A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {495E53B3-F3AF-4C4F-BAAF-865EFAA2F4A9}.Debug|Any CPU.Build.0 = Debug|Any CPU + {495E53B3-F3AF-4C4F-BAAF-865EFAA2F4A9}.Release|Any CPU.ActiveCfg = Release|Any CPU + {495E53B3-F3AF-4C4F-BAAF-865EFAA2F4A9}.Release|Any CPU.Build.0 = Release|Any CPU + {495E53B3-F3AF-4C4F-BAAF-865EFAA2F4A9}.Sign|Any CPU.ActiveCfg = Sign|Any CPU + {495E53B3-F3AF-4C4F-BAAF-865EFAA2F4A9}.Sign|Any CPU.Build.0 = Sign|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Mindscape.Raygun4Net.WebApi/Mindscape.Raygun4Net.WebApi.csproj b/Mindscape.Raygun4Net.WebApi/Mindscape.Raygun4Net.WebApi.csproj index 6bb08903..2adf5aa3 100644 --- a/Mindscape.Raygun4Net.WebApi/Mindscape.Raygun4Net.WebApi.csproj +++ b/Mindscape.Raygun4Net.WebApi/Mindscape.Raygun4Net.WebApi.csproj @@ -72,6 +72,9 @@ + + WebClientHelper.cs + @@ -84,7 +87,6 @@ - diff --git a/Mindscape.Raygun4Net/Mindscape.Raygun4Net.csproj b/Mindscape.Raygun4Net/Mindscape.Raygun4Net.csproj index 8e0416dd..79d6befb 100644 --- a/Mindscape.Raygun4Net/Mindscape.Raygun4Net.csproj +++ b/Mindscape.Raygun4Net/Mindscape.Raygun4Net.csproj @@ -36,13 +36,13 @@ pdbonly - true + true bin\Sign\ - SIGN;TRACE - prompt - 4 - true - true + SIGN;TRACE + prompt + 4 + true + true Raygun4Net.snk diff --git a/Mindscape.Raygun4Net4/Mindscape.Raygun4Net4.csproj b/Mindscape.Raygun4Net4/Mindscape.Raygun4Net4.csproj index 570665bf..074a5d12 100644 --- a/Mindscape.Raygun4Net4/Mindscape.Raygun4Net4.csproj +++ b/Mindscape.Raygun4Net4/Mindscape.Raygun4Net4.csproj @@ -31,7 +31,7 @@ Raygun4Net4.snk - true + true bin\Sign\ TRACE true @@ -39,7 +39,7 @@ AnyCPU prompt MinimumRecommendedRules.ruleset - 4 + 4 @@ -60,9 +60,6 @@ Properties\AssemblyVersionInfo.cs - - WebClientHelper.cs - Breadcrumbs\DefaultBreadcrumbStorage.cs @@ -92,6 +89,7 @@ + diff --git a/Mindscape.Raygun4Net4/RaygunClient.cs b/Mindscape.Raygun4Net4/RaygunClient.cs index 76f0d1ce..2d884a6a 100644 --- a/Mindscape.Raygun4Net4/RaygunClient.cs +++ b/Mindscape.Raygun4Net4/RaygunClient.cs @@ -26,10 +26,8 @@ public class RaygunClient : RaygunClientBase private readonly RaygunRequestMessageOptions _requestMessageOptions = new RaygunRequestMessageOptions(); private readonly List _wrapperExceptions = new List(); - [ThreadStatic] - private static RaygunRequestMessage _currentRequestMessage; - [ThreadStatic] - private static List _currentBreadcrumbs; + [ThreadStatic] private static RaygunRequestMessage _currentRequestMessage; + [ThreadStatic] private static List _currentBreadcrumbs; private static readonly RaygunBreadcrumbs _breadcrumbs = new RaygunBreadcrumbs(new DefaultBreadcrumbStorage()); @@ -105,6 +103,7 @@ protected bool ValidateApiKey() System.Diagnostics.Debug.WriteLine("ApiKey has not been provided, exception will not be logged"); return false; } + return true; } @@ -289,12 +288,13 @@ protected override bool CanSend(Exception exception) } } } + return base.CanSend(exception); } public static void RecordBreadcrumb(string message) { - _breadcrumbs.Record(new RaygunBreadcrumb { Message = message }); + _breadcrumbs.Record(new RaygunBreadcrumb {Message = message}); } public static void RecordBreadcrumb(RaygunBreadcrumb crumb) @@ -313,7 +313,7 @@ public static void ClearBreadcrumbs() /// The exception to deliver. public override void Send(Exception exception) { - Send(exception, null, (IDictionary)null, null); + Send(exception, null, (IDictionary) null, null); } /// @@ -324,7 +324,7 @@ public override void Send(Exception exception) /// A list of strings associated with the message. public void Send(Exception exception, IList tags) { - Send(exception, tags, (IDictionary)null, null); + Send(exception, tags, (IDictionary) null, null); } /// @@ -367,7 +367,7 @@ public void Send(Exception exception, IList tags, IDictionary userCustom /// The exception to deliver. public void SendInBackground(Exception exception) { - SendInBackground(exception, null, (IDictionary)null, null); + SendInBackground(exception, null, (IDictionary) null, null); } /// @@ -377,7 +377,7 @@ public void SendInBackground(Exception exception) /// A list of strings associated with the message. public void SendInBackground(Exception exception, IList tags) { - SendInBackground(exception, tags, (IDictionary)null, null); + SendInBackground(exception, tags, (IDictionary) null, null); } /// @@ -437,12 +437,12 @@ public void SendInBackground(Exception exception, IList tags, IDictionar } catch (Exception) { - // This will swallow any unhandled exceptions unless we explicitly want to throw on error. - // Otherwise this can bring the whole process down. - if (RaygunSettings.Settings.ThrowOnError) - { - throw; - } + // This will swallow any unhandled exceptions unless we explicitly want to throw on error. + // Otherwise this can bring the whole process down. + if (RaygunSettings.Settings.ThrowOnError) + { + throw; + } } } @@ -554,11 +554,15 @@ protected IEnumerable StripWrapperExceptions(Exception exception) { e.Data["Type"] = rtle.Types[index]; } - catch { } + catch + { + } + foreach (Exception ex in StripWrapperExceptions(e)) { yield return ex; } + index++; } } @@ -606,7 +610,7 @@ public override void Send(RaygunMessage raygunMessage) { try { - WebClientHelper.Send(message,_apiKey, ProxyCredentials); + WebClientHelper.Send(message, _apiKey, ProxyCredentials); } catch (Exception ex) { @@ -630,6 +634,7 @@ public override void Send(RaygunMessage raygunMessage) } } } + private void SaveMessage(string message) { try @@ -654,8 +659,10 @@ private void SaveMessage(string message) { isolatedStorage.DeleteFile(nextFileName); } + break; } + number++; } @@ -667,6 +674,7 @@ private void SaveMessage(string message) isolatedStorage.DeleteFile(firstFileName); } } + using (IsolatedStorageFileStream isoStream = new IsolatedStorageFileStream(directoryName + "\\RaygunErrorMessage" + number + ".txt", FileMode.OpenOrCreate, FileAccess.Write, isolatedStorage)) { using (StreamWriter writer = new StreamWriter(isoStream, Encoding.Unicode)) @@ -676,6 +684,7 @@ private void SaveMessage(string message) writer.Close(); } } + System.Diagnostics.Trace.WriteLine("Saved message: " + "RaygunErrorMessage" + number + ".txt"); } } @@ -707,17 +716,20 @@ private void SendStoredMessages() string text = reader.ReadToEnd(); try { - WebClientHelper.Send(text,_apiKey, ProxyCredentials); + WebClientHelper.Send(text, _apiKey, ProxyCredentials); } catch { // If just one message fails to send, then don't delete the message, and don't attempt sending anymore until later. return; } + System.Diagnostics.Debug.WriteLine("Sent " + name); } + isolatedStorage.DeleteFile(directoryName + "\\" + name); } + if (isolatedStorage.GetFileNames(directoryName + "\\*.txt").Length == 0) { System.Diagnostics.Debug.WriteLine("Successfully sent all pending messages"); @@ -745,4 +757,4 @@ private IsolatedStorageFile GetIsolatedStorageScope() } } } -} +} \ No newline at end of file diff --git a/Mindscape.Raygun4Net.WebApi/WebClientHelper.cs b/Mindscape.Raygun4Net4/WebClientHelper.cs similarity index 95% rename from Mindscape.Raygun4Net.WebApi/WebClientHelper.cs rename to Mindscape.Raygun4Net4/WebClientHelper.cs index aa5a0017..3a0457db 100644 --- a/Mindscape.Raygun4Net.WebApi/WebClientHelper.cs +++ b/Mindscape.Raygun4Net4/WebClientHelper.cs @@ -3,16 +3,13 @@ namespace Mindscape.Raygun4Net { - public static class WebClientHelper { - [ThreadStatic] - private static WebClient _client; + [ThreadStatic] private static WebClient _client; private static WebClient Client => _client ?? (_client = new WebClient()); private static readonly Uri ProxyUri; - - + static WebClientHelper() { ProxyUri = WebRequest.DefaultWebProxy.GetProxy(new Uri(RaygunSettings.Settings.ApiEndpoint.ToString())); @@ -27,7 +24,6 @@ public static void Send(string message, string apiKey, ICredentials proxyCredent if (WebRequest.DefaultWebProxy != null) { - if (ProxyUri != null && ProxyUri.AbsoluteUri != RaygunSettings.Settings.ApiEndpoint.ToString()) { Client.Proxy = new WebProxy(ProxyUri, false); From 658b8c8bf4ed491f323661bcb880c9f32169042d Mon Sep 17 00:00:00 2001 From: innocent Date: Tue, 27 Aug 2019 18:14:33 +1200 Subject: [PATCH 3/7] removed reference to test project --- Mindscape.Raygun4Net.WebApi.sln | 8 -------- Mindscape.Raygun4Net4/RaygunClient.cs | 5 ++++- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/Mindscape.Raygun4Net.WebApi.sln b/Mindscape.Raygun4Net.WebApi.sln index b44e7924..ce0daeb9 100644 --- a/Mindscape.Raygun4Net.WebApi.sln +++ b/Mindscape.Raygun4Net.WebApi.sln @@ -9,8 +9,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mindscape.Raygun4Net.Core", EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mindscape.Raygun4Net.WebApi.Tests", "Mindscape.Raygun4Net.WebApi.Tests\Mindscape.Raygun4Net.WebApi.Tests.csproj", "{80C7BB59-C753-4E64-9C8D-79B8D57C8215}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "FileUploadTest", "C:\Users\innocent\Documents\Visual Studio 2015\Projects\diagnostictest\FileUploadTest\FileUploadTest\FileUploadTest.csproj", "{E41A20CC-B2DB-4DD5-8D1D-091FB09EDAED}" -EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mindscape.Raygun4Net", "Mindscape.Raygun4Net\Mindscape.Raygun4Net.csproj", "{495E53B3-F3AF-4C4F-BAAF-865EFAA2F4A9}" EndProject Global @@ -38,12 +36,6 @@ Global {80C7BB59-C753-4E64-9C8D-79B8D57C8215}.Release|Any CPU.Build.0 = Release|Any CPU {80C7BB59-C753-4E64-9C8D-79B8D57C8215}.Sign|Any CPU.ActiveCfg = Release|Any CPU {80C7BB59-C753-4E64-9C8D-79B8D57C8215}.Sign|Any CPU.Build.0 = Release|Any CPU - {E41A20CC-B2DB-4DD5-8D1D-091FB09EDAED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E41A20CC-B2DB-4DD5-8D1D-091FB09EDAED}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E41A20CC-B2DB-4DD5-8D1D-091FB09EDAED}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E41A20CC-B2DB-4DD5-8D1D-091FB09EDAED}.Release|Any CPU.Build.0 = Release|Any CPU - {E41A20CC-B2DB-4DD5-8D1D-091FB09EDAED}.Sign|Any CPU.ActiveCfg = Debug|Any CPU - {E41A20CC-B2DB-4DD5-8D1D-091FB09EDAED}.Sign|Any CPU.Build.0 = Debug|Any CPU {495E53B3-F3AF-4C4F-BAAF-865EFAA2F4A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {495E53B3-F3AF-4C4F-BAAF-865EFAA2F4A9}.Debug|Any CPU.Build.0 = Debug|Any CPU {495E53B3-F3AF-4C4F-BAAF-865EFAA2F4A9}.Release|Any CPU.ActiveCfg = Release|Any CPU diff --git a/Mindscape.Raygun4Net4/RaygunClient.cs b/Mindscape.Raygun4Net4/RaygunClient.cs index 2d884a6a..037ea11b 100644 --- a/Mindscape.Raygun4Net4/RaygunClient.cs +++ b/Mindscape.Raygun4Net4/RaygunClient.cs @@ -610,7 +610,10 @@ public override void Send(RaygunMessage raygunMessage) { try { - WebClientHelper.Send(message, _apiKey, ProxyCredentials); + if (ValidateApiKey()) + { + WebClientHelper.Send(message, _apiKey, ProxyCredentials); + } } catch (Exception ex) { From 8b6b20f32f5b9d6a2e710a13d4d602f6121925ac Mon Sep 17 00:00:00 2001 From: innocent Date: Tue, 27 Aug 2019 18:26:19 +1200 Subject: [PATCH 4/7] Update Mindscape.Raygun4Net.WebApi.sln --- Mindscape.Raygun4Net.WebApi.sln | 8 -------- 1 file changed, 8 deletions(-) diff --git a/Mindscape.Raygun4Net.WebApi.sln b/Mindscape.Raygun4Net.WebApi.sln index ce0daeb9..3010095a 100644 --- a/Mindscape.Raygun4Net.WebApi.sln +++ b/Mindscape.Raygun4Net.WebApi.sln @@ -9,8 +9,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mindscape.Raygun4Net.Core", EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mindscape.Raygun4Net.WebApi.Tests", "Mindscape.Raygun4Net.WebApi.Tests\Mindscape.Raygun4Net.WebApi.Tests.csproj", "{80C7BB59-C753-4E64-9C8D-79B8D57C8215}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Mindscape.Raygun4Net", "Mindscape.Raygun4Net\Mindscape.Raygun4Net.csproj", "{495E53B3-F3AF-4C4F-BAAF-865EFAA2F4A9}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -36,12 +34,6 @@ Global {80C7BB59-C753-4E64-9C8D-79B8D57C8215}.Release|Any CPU.Build.0 = Release|Any CPU {80C7BB59-C753-4E64-9C8D-79B8D57C8215}.Sign|Any CPU.ActiveCfg = Release|Any CPU {80C7BB59-C753-4E64-9C8D-79B8D57C8215}.Sign|Any CPU.Build.0 = Release|Any CPU - {495E53B3-F3AF-4C4F-BAAF-865EFAA2F4A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {495E53B3-F3AF-4C4F-BAAF-865EFAA2F4A9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {495E53B3-F3AF-4C4F-BAAF-865EFAA2F4A9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {495E53B3-F3AF-4C4F-BAAF-865EFAA2F4A9}.Release|Any CPU.Build.0 = Release|Any CPU - {495E53B3-F3AF-4C4F-BAAF-865EFAA2F4A9}.Sign|Any CPU.ActiveCfg = Sign|Any CPU - {495E53B3-F3AF-4C4F-BAAF-865EFAA2F4A9}.Sign|Any CPU.Build.0 = Sign|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE From e45293de7e729a7c460db86eabeea1452bfbbd8e Mon Sep 17 00:00:00 2001 From: innocent Date: Thu, 29 Aug 2019 14:12:18 +1200 Subject: [PATCH 5/7] Added Proxy and kevalidation to helper class --- .../RaygunWebApiClient.cs | 23 ++++--------------- Mindscape.Raygun4Net4/RaygunClient.cs | 13 ++++++++--- Mindscape.Raygun4Net4/WebClientHelper.cs | 18 ++++++++++++--- 3 files changed, 29 insertions(+), 25 deletions(-) diff --git a/Mindscape.Raygun4Net.WebApi/RaygunWebApiClient.cs b/Mindscape.Raygun4Net.WebApi/RaygunWebApiClient.cs index 9f29006a..90e0b763 100644 --- a/Mindscape.Raygun4Net.WebApi/RaygunWebApiClient.cs +++ b/Mindscape.Raygun4Net.WebApi/RaygunWebApiClient.cs @@ -230,17 +230,6 @@ public static void Detach(HttpConfiguration config) } } - protected bool ValidateApiKey() - { - if (string.IsNullOrEmpty(_apiKey)) - { - System.Diagnostics.Debug.WriteLine("ApiKey has not been provided, exception will not be logged"); - return false; - } - - return true; - } - /// /// Gets or sets the username/password credentials which are used to authenticate with the system default Proxy server, if one is set /// and requires credentials. @@ -626,15 +615,11 @@ public override void Send(RaygunMessage raygunMessage) { try { - if (ValidateApiKey()) + bool canSend = OnSendingMessage(raygunMessage) && CanSend(raygunMessage); + if (canSend) { - - bool canSend = OnSendingMessage(raygunMessage) && CanSend(raygunMessage); - if (canSend) - { - var message = SimpleJson.SerializeObject(raygunMessage); - WebClientHelper.Send(message, _apiKey, ProxyCredentials); - } + var message = SimpleJson.SerializeObject(raygunMessage); + WebClientHelper.Send(message, _apiKey, ProxyCredentials); } } catch (Exception ex) diff --git a/Mindscape.Raygun4Net4/RaygunClient.cs b/Mindscape.Raygun4Net4/RaygunClient.cs index 037ea11b..d7a3bb2a 100644 --- a/Mindscape.Raygun4Net4/RaygunClient.cs +++ b/Mindscape.Raygun4Net4/RaygunClient.cs @@ -610,10 +610,12 @@ public override void Send(RaygunMessage raygunMessage) { try { - if (ValidateApiKey()) - { + if (WebProxy != null) + { + WebClientHelper.WebProxy = WebProxy; + } + WebClientHelper.Send(message, _apiKey, ProxyCredentials); - } } catch (Exception ex) { @@ -719,6 +721,11 @@ private void SendStoredMessages() string text = reader.ReadToEnd(); try { + if (WebProxy != null) + { + WebClientHelper.WebProxy = WebProxy; + } + WebClientHelper.Send(text, _apiKey, ProxyCredentials); } catch diff --git a/Mindscape.Raygun4Net4/WebClientHelper.cs b/Mindscape.Raygun4Net4/WebClientHelper.cs index 3a0457db..699465d4 100644 --- a/Mindscape.Raygun4Net4/WebClientHelper.cs +++ b/Mindscape.Raygun4Net4/WebClientHelper.cs @@ -9,20 +9,32 @@ public static class WebClientHelper private static WebClient Client => _client ?? (_client = new WebClient()); private static readonly Uri ProxyUri; - + + internal static IWebProxy WebProxy { get; set; } + static WebClientHelper() { ProxyUri = WebRequest.DefaultWebProxy.GetProxy(new Uri(RaygunSettings.Settings.ApiEndpoint.ToString())); } - + public static void Send(string message, string apiKey, ICredentials proxyCredentials) { + if (string.IsNullOrEmpty(apiKey)) + { + System.Diagnostics.Debug.WriteLine("ApiKey has not been provided, exception will not be logged"); + return; + } Client.Headers.Clear(); Client.Headers.Add("X-ApiKey", apiKey); Client.Headers.Add("content-type", "application/json; charset=utf-8"); Client.Encoding = System.Text.Encoding.UTF8; - if (WebRequest.DefaultWebProxy != null) + if (WebProxy != null) + { + Client.Proxy = WebProxy; + } + + else if (WebRequest.DefaultWebProxy != null) { if (ProxyUri != null && ProxyUri.AbsoluteUri != RaygunSettings.Settings.ApiEndpoint.ToString()) { From 20cf0cb5490f1488ffa30c2b19c1ee3be4cc73ce Mon Sep 17 00:00:00 2001 From: innocent Date: Tue, 10 Sep 2019 09:44:06 +1200 Subject: [PATCH 6/7] Removed empty line --- Mindscape.Raygun4Net4/WebClientHelper.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/Mindscape.Raygun4Net4/WebClientHelper.cs b/Mindscape.Raygun4Net4/WebClientHelper.cs index 699465d4..dfb45c1f 100644 --- a/Mindscape.Raygun4Net4/WebClientHelper.cs +++ b/Mindscape.Raygun4Net4/WebClientHelper.cs @@ -33,7 +33,6 @@ public static void Send(string message, string apiKey, ICredentials proxyCredent { Client.Proxy = WebProxy; } - else if (WebRequest.DefaultWebProxy != null) { if (ProxyUri != null && ProxyUri.AbsoluteUri != RaygunSettings.Settings.ApiEndpoint.ToString()) From 9f7252b85ea26808d2498a5a6675819983ccce04 Mon Sep 17 00:00:00 2001 From: innocent Date: Mon, 16 Sep 2019 10:32:00 +1200 Subject: [PATCH 7/7] Version update --- .nuget/packages.config | 2 +- AssemblyVersionInfo.cs | 4 ++-- Mindscape.Raygun4Net.Core.Signed.nuspec | 2 +- Mindscape.Raygun4Net.Core.nuspec | 2 +- Mindscape.Raygun4Net.Mvc.Signed.nuspec | 4 ++-- Mindscape.Raygun4Net.Mvc.nuspec | 4 ++-- Mindscape.Raygun4Net.Signed.nuspec | 2 +- Mindscape.Raygun4Net.WebApi.Signed.nuspec | 4 ++-- Mindscape.Raygun4Net.WebApi.nuspec | 4 ++-- Mindscape.Raygun4Net.WebApi/Properties/AssemblyVersionInfo.cs | 4 ++-- Mindscape.Raygun4Net.nuspec | 2 +- build.bat | 4 ++-- build.ps1 | 3 +++ buildSigned.bat | 4 ++-- buildSigned.ps1 | 3 +++ 15 files changed, 27 insertions(+), 21 deletions(-) diff --git a/.nuget/packages.config b/.nuget/packages.config index f59e4683..ed305e34 100644 --- a/.nuget/packages.config +++ b/.nuget/packages.config @@ -1,5 +1,5 @@  - + \ No newline at end of file diff --git a/AssemblyVersionInfo.cs b/AssemblyVersionInfo.cs index a83b5645..34ba1c12 100644 --- a/AssemblyVersionInfo.cs +++ b/AssemblyVersionInfo.cs @@ -10,5 +10,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("5.8.0.0")] -[assembly: AssemblyFileVersion("5.8.0.0")] +[assembly: AssemblyVersion("5.9.0.0")] +[assembly: AssemblyFileVersion("5.9.0.0")] diff --git a/Mindscape.Raygun4Net.Core.Signed.nuspec b/Mindscape.Raygun4Net.Core.Signed.nuspec index 0a2d91a1..b5c9d261 100644 --- a/Mindscape.Raygun4Net.Core.Signed.nuspec +++ b/Mindscape.Raygun4Net.Core.Signed.nuspec @@ -2,7 +2,7 @@ Mindscape.Raygun4Net.Core.Signed - 5.8.0 + 5.9.0 <authors>Raygun</authors> <owners /> diff --git a/Mindscape.Raygun4Net.Core.nuspec b/Mindscape.Raygun4Net.Core.nuspec index 38e449b6..0620fb6c 100644 --- a/Mindscape.Raygun4Net.Core.nuspec +++ b/Mindscape.Raygun4Net.Core.nuspec @@ -2,7 +2,7 @@ <package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"> <metadata minClientVersion="2.5"> <id>Mindscape.Raygun4Net.Core</id> - <version>5.8.0</version> + <version>5.9.0</version> <title /> <authors>Raygun</authors> <owners /> diff --git a/Mindscape.Raygun4Net.Mvc.Signed.nuspec b/Mindscape.Raygun4Net.Mvc.Signed.nuspec index 071d06cc..b14576b6 100644 --- a/Mindscape.Raygun4Net.Mvc.Signed.nuspec +++ b/Mindscape.Raygun4Net.Mvc.Signed.nuspec @@ -2,7 +2,7 @@ <package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"> <metadata minClientVersion="2.5"> <id>Mindscape.Raygun4Net.Mvc.Signed</id> - <version>5.8.0</version> + <version>5.9.0</version> <title /> <authors>Raygun</authors> <owners /> @@ -12,7 +12,7 @@ <projectUrl>https://github.com/MindscapeHQ/raygun4net</projectUrl> <licenseUrl>https://raw.github.com/MindscapeHQ/raygun4net/master/LICENSE</licenseUrl> <dependencies> - <dependency id="Mindscape.Raygun4Net.Core.Signed" version="5.7.0" /> + <dependency id="Mindscape.Raygun4Net.Core.Signed" version="5.9.0" /> </dependencies> </metadata> <files> diff --git a/Mindscape.Raygun4Net.Mvc.nuspec b/Mindscape.Raygun4Net.Mvc.nuspec index fd8555ab..1a1285e1 100644 --- a/Mindscape.Raygun4Net.Mvc.nuspec +++ b/Mindscape.Raygun4Net.Mvc.nuspec @@ -2,7 +2,7 @@ <package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"> <metadata minClientVersion="2.5"> <id>Mindscape.Raygun4Net.Mvc</id> - <version>5.8.0</version> + <version>5.9.0</version> <title /> <authors>Raygun</authors> <owners /> @@ -12,7 +12,7 @@ <projectUrl>https://github.com/MindscapeHQ/raygun4net</projectUrl> <licenseUrl>https://raw.github.com/MindscapeHQ/raygun4net/master/LICENSE</licenseUrl> <dependencies> - <dependency id="Mindscape.Raygun4Net.Core" version="5.7.0" /> + <dependency id="Mindscape.Raygun4Net.Core" version="5.9.0" /> </dependencies> </metadata> <files> diff --git a/Mindscape.Raygun4Net.Signed.nuspec b/Mindscape.Raygun4Net.Signed.nuspec index 58727e13..7a6177d3 100644 --- a/Mindscape.Raygun4Net.Signed.nuspec +++ b/Mindscape.Raygun4Net.Signed.nuspec @@ -2,7 +2,7 @@ <package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"> <metadata minClientVersion="2.5"> <id>Mindscape.Raygun4Net.Signed</id> - <version>5.8.0</version> + <version>5.9.0</version> <title /> <authors>Raygun</authors> <owners /> diff --git a/Mindscape.Raygun4Net.WebApi.Signed.nuspec b/Mindscape.Raygun4Net.WebApi.Signed.nuspec index 7fb47230..9e95129f 100644 --- a/Mindscape.Raygun4Net.WebApi.Signed.nuspec +++ b/Mindscape.Raygun4Net.WebApi.Signed.nuspec @@ -2,7 +2,7 @@ <package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"> <metadata minClientVersion="2.5"> <id>Mindscape.Raygun4Net.WebApi.Signed</id> - <version>5.8.0</version> + <version>5.9.0</version> <title>Raygun for ASP.NET Web API Raygun @@ -13,7 +13,7 @@ https://github.com/MindscapeHQ/raygun4net https://raw.github.com/MindscapeHQ/raygun4net/master/LICENSE - + diff --git a/Mindscape.Raygun4Net.WebApi.nuspec b/Mindscape.Raygun4Net.WebApi.nuspec index 7ffbdfce..7c30ca4b 100644 --- a/Mindscape.Raygun4Net.WebApi.nuspec +++ b/Mindscape.Raygun4Net.WebApi.nuspec @@ -2,7 +2,7 @@ Mindscape.Raygun4Net.WebApi - 5.8.0 + 5.9.0 Raygun for ASP.NET Web API Raygun @@ -13,7 +13,7 @@ https://github.com/MindscapeHQ/raygun4net https://raw.github.com/MindscapeHQ/raygun4net/master/LICENSE - + diff --git a/Mindscape.Raygun4Net.WebApi/Properties/AssemblyVersionInfo.cs b/Mindscape.Raygun4Net.WebApi/Properties/AssemblyVersionInfo.cs index a83b5645..34ba1c12 100644 --- a/Mindscape.Raygun4Net.WebApi/Properties/AssemblyVersionInfo.cs +++ b/Mindscape.Raygun4Net.WebApi/Properties/AssemblyVersionInfo.cs @@ -10,5 +10,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("5.8.0.0")] -[assembly: AssemblyFileVersion("5.8.0.0")] +[assembly: AssemblyVersion("5.9.0.0")] +[assembly: AssemblyFileVersion("5.9.0.0")] diff --git a/Mindscape.Raygun4Net.nuspec b/Mindscape.Raygun4Net.nuspec index b58a91bc..f3bec41a 100644 --- a/Mindscape.Raygun4Net.nuspec +++ b/Mindscape.Raygun4Net.nuspec @@ -2,7 +2,7 @@ Mindscape.Raygun4Net - 5.8.0 + 5.9.0 <authors>Raygun</authors> <owners /> diff --git a/build.bat b/build.bat index 6a3428de..8a45313c 100644 --- a/build.bat +++ b/build.bat @@ -1,4 +1,4 @@ -set EnableNuGetPackageRestore=true -call .\packages\psake.4.3.2\tools\psake.cmd build.ps1 %* +.\.nuget\NuGet.exe install .nuget\packages.config -o packages +.\packages\psake.4.8.0\tools\psake\psake.cmd build.ps1 %* pause \ No newline at end of file diff --git a/build.ps1 b/build.ps1 index 9c7e7702..0eccbca5 100644 --- a/build.ps1 +++ b/build.ps1 @@ -1,3 +1,6 @@ +# This causes psake to use the VS 2017 build tool: +Framework "4.6" + properties { $root = $psake.build_script_dir $solution_file_net2 = "$root/Mindscape.Raygun4Net2.sln" diff --git a/buildSigned.bat b/buildSigned.bat index a939db19..865fd11c 100644 --- a/buildSigned.bat +++ b/buildSigned.bat @@ -1,4 +1,4 @@ -set EnableNuGetPackageRestore=true -call .\packages\psake.4.3.2\tools\psake.cmd buildSigned.ps1 %* +.\.nuget\NuGet.exe install .nuget\packages.config -o packages +.\packages\psake.4.8.0\tools\psake\psake.cmd buildSigned.ps1 %* pause \ No newline at end of file diff --git a/buildSigned.ps1 b/buildSigned.ps1 index bb29c38a..84885002 100644 --- a/buildSigned.ps1 +++ b/buildSigned.ps1 @@ -1,3 +1,6 @@ +# This causes psake to use the VS 2017 build tool: +Framework "4.6" + properties { $root = $psake.build_script_dir $solution_file_net2 = "$root/Mindscape.Raygun4Net2.sln"