From 1911910c48b3ed4643983361adf2ad61df90753b Mon Sep 17 00:00:00 2001 From: John Tseng Date: Thu, 31 Aug 2017 22:23:12 -0500 Subject: [PATCH 1/3] for ExceptionHandlerMiddleware, move Rollbar to a per-request dependency to avoid the error: Cannot resolve scoped service 'RollbarDotNet.Rollbar' from root provider. --- src/RollbarDotNet/Core/ExceptionHandlerMiddleware.cs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/RollbarDotNet/Core/ExceptionHandlerMiddleware.cs b/src/RollbarDotNet/Core/ExceptionHandlerMiddleware.cs index e821e54..484e61c 100644 --- a/src/RollbarDotNet/Core/ExceptionHandlerMiddleware.cs +++ b/src/RollbarDotNet/Core/ExceptionHandlerMiddleware.cs @@ -7,18 +7,14 @@ public class ExceptionHandlerMiddleware { public ExceptionHandlerMiddleware( - RequestDelegate next, - Rollbar rollbar) + RequestDelegate next) { this.Next = next; - this.Rollbar = rollbar; } protected RequestDelegate Next { get; set; } - - protected Rollbar Rollbar { get; set; } - public async Task Invoke(HttpContext context) + public async Task Invoke(HttpContext context, Rollbar rollbar) { try { @@ -26,7 +22,7 @@ public async Task Invoke(HttpContext context) } catch(Exception exception) { - var response = await this.Rollbar.SendException(exception); + var response = await rollbar.SendException(exception); var rollbarResponseFeature = new RollbarResponseFeature { Handled = true, From 56d3c247c9545b6b4410688eb10ddc00bb1c96eb Mon Sep 17 00:00:00 2001 From: William Roush Date: Mon, 4 Sep 2017 00:45:55 -0400 Subject: [PATCH 2/3] Open 0.6.3, remove key from source. --- CHANGELOG.md | 5 ++++- src/RollbarDotNet/RollbarDotNet.csproj | 2 +- .../DependencyInjection/WebDependencyInjectionTests.cs | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ca566b5..c8a3034 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,7 @@ -# 0.6.2 +# 0.6.3 +Released: TBA + +# 0.6.2 Released: 2017/8/20 - Change method trace string to have full namespace, method name and parameters. diff --git a/src/RollbarDotNet/RollbarDotNet.csproj b/src/RollbarDotNet/RollbarDotNet.csproj index ee87358..ddb42d8 100644 --- a/src/RollbarDotNet/RollbarDotNet.csproj +++ b/src/RollbarDotNet/RollbarDotNet.csproj @@ -4,7 +4,7 @@ Rollbar Integration for .NET Core William Roush 2016-2017 RollbarDotNet - 0.6.2 + 0.6.3 William Roush RollbarDotNet RollbarDotNet diff --git a/test/RollbarDotNet.Tests/DependencyInjection/WebDependencyInjectionTests.cs b/test/RollbarDotNet.Tests/DependencyInjection/WebDependencyInjectionTests.cs index e7c62bb..fd3e495 100644 --- a/test/RollbarDotNet.Tests/DependencyInjection/WebDependencyInjectionTests.cs +++ b/test/RollbarDotNet.Tests/DependencyInjection/WebDependencyInjectionTests.cs @@ -21,7 +21,7 @@ public WebDependencyInjectionTests() .AddSingleton(mockHostingEnvironment.Object); services.Configure(o => { - o.AccessToken = Environment.GetEnvironmentVariable("ROLLBAR_TOKEN") ?? "992eb96a7d4b4d62bd529188bb8152cb"; + o.AccessToken = Environment.GetEnvironmentVariable("ROLLBAR_TOKEN"); o.Environment = "Testing"; }); From 95d9c7590ef44315cc701522bc29abc7a81de78a Mon Sep 17 00:00:00 2001 From: William Roush Date: Mon, 4 Sep 2017 02:18:40 -0400 Subject: [PATCH 3/3] Update changelog. --- CHANGELOG.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c8a3034..3f3323b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # 0.6.3 -Released: TBA +Released: 2017/09/04 + +- Use per-request dependencies for handling RollbarClient to prevent errors. # 0.6.2 Released: 2017/8/20