Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions build.cake
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ Task("Default")

Task("Appveyor")
.IsDependentOn("SetVersion")
.IsDependentOn("Pack")
.IsDependentOn("MazeRunner");
.IsDependentOn("Pack");
//.IsDependentOn("MazeRunner");

RunTarget(target);
11 changes: 1 addition & 10 deletions src/Bugsnag.AspNet.Core/Bugsnag.AspNet.Core.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PackageId>Bugsnag.AspNet.Core</PackageId>
<Title>Bugsnag .NET ASP.NET Core Notifier</Title>
<Description>The Bugsnag Notifier for ASP.NET Core gives you instant notification of exceptions thrown from your ASP.NET Core applications. Any uncaught exceptions will trigger a notification to be sent to your Bugsnag project.</Description>
<TargetFrameworks>netstandard1.3;netstandard2.0</TargetFrameworks>
<TargetFrameworks>netstandard2.0</TargetFrameworks>
<SignAssembly>false</SignAssembly>
</PropertyGroup>
<ItemGroup>
Expand All @@ -13,15 +13,6 @@
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.DiagnosticAdapter" Version="1.1.2" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard1.3'">
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="1.1.1" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="1.1.2" />
<PackageReference Include="Microsoft.AspNetCore.Diagnostics.Abstractions" Version="1.1.5" />
<PackageReference Include="Microsoft.AspNetCore.Hosting.Abstractions" Version="1.1.3" />
<PackageReference Include="Microsoft.AspNetCore.Http.Abstractions" Version="1.1.2" />
<PackageReference Include="Microsoft.AspNetCore.Http.Extensions" Version="1.1.2" />
<PackageReference Include="Microsoft.AspNetCore.Http" Version="1.1.2" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="2.0.0" />
<PackageReference Include="Microsoft.Extensions.Options.ConfigurationExtensions" Version="2.0.0" />
Expand Down
3 changes: 1 addition & 2 deletions src/Bugsnag.AspNet.Mvc/AutoLoad.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#if NET45 || NET40
using System.Web.Mvc;

namespace Bugsnag.AspNet.Mvc
Expand All @@ -11,4 +10,4 @@ public static void Attach()
}
}
}
#endif

12 changes: 2 additions & 10 deletions src/Bugsnag.AspNet.Mvc/Bugsnag.AspNet.Mvc.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PackageId>Bugsnag.AspNet.Mvc</PackageId>
<Title>Bugsnag .NET ASP.NET MVC Notifier</Title>
<Description>The Bugsnag Notifier for ASP.NET MVC gives you instant notification of exceptions thrown from your ASP.NET MVC applications. Any uncaught exceptions will trigger a notification to be sent to your Bugsnag project.</Description>
<TargetFrameworks>net35;net40;net45</TargetFrameworks>
<TargetFrameworks>net462</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Bugsnag.AspNet\Bugsnag.AspNet.csproj" />
Expand All @@ -15,15 +15,7 @@
<Reference Include="System.Web" />
<Reference Include="System.Web.Abstractions" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net35'">
<PackageReference Include="Mvc2" Version="2.0.1">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net40'">
<PackageReference Include="Microsoft.AspNet.Mvc" Version="4.0.20505.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net45'">
<ItemGroup Condition="'$(TargetFramework)' == 'net462'">
<PackageReference Include="Microsoft.AspNet.Mvc" Version="5.0.0" />
</ItemGroup>
</Project>
3 changes: 1 addition & 2 deletions src/Bugsnag.AspNet.Mvc/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,5 @@
using System.Web;

[assembly: CLSCompliant(true)]
#if NET45 || NET40
[assembly: PreApplicationStartMethod(typeof(Bugsnag.AspNet.Mvc.AutoLoad), "Attach")]
#endif

7 changes: 2 additions & 5 deletions src/Bugsnag.AspNet.WebApi/Bugsnag.AspNet.WebApi.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PackageId>Bugsnag.AspNet.WebApi</PackageId>
<Title>Bugsnag .NET ASP.NET WebApi Notifier</Title>
<Description>The Bugsnag Notifier for ASP.NET WebApi gives you instant notification of exceptions thrown from your ASP.NET WebApi applications. Any uncaught exceptions will trigger a notification to be sent to your Bugsnag project.</Description>
<TargetFrameworks>net40;net45</TargetFrameworks>
<TargetFrameworks>net462</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
Expand All @@ -14,10 +14,7 @@
<ProjectReference Include="..\Bugsnag\Bugsnag.csproj" />
<ProjectReference Include="..\Bugsnag.ConfigurationSection\Bugsnag.ConfigurationSection.csproj" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net40'">
<PackageReference Include="Microsoft.AspNet.WebApi.Core" Version="4.0.20505.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net45'">
<ItemGroup Condition="'$(TargetFramework)' == 'net462'">
<PackageReference Include="Microsoft.AspNet.WebApi.Core" Version="5.2.0" />
</ItemGroup>
</Project>
3 changes: 1 addition & 2 deletions src/Bugsnag.AspNet.WebApi/ExceptionLogger.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#if NET45
using System.Web.Http.ExceptionHandling;

namespace Bugsnag.AspNet.WebApi
Expand All @@ -23,4 +22,4 @@ public override void Log(ExceptionLoggerContext context)
}
}
}
#endif

10 changes: 0 additions & 10 deletions src/Bugsnag.AspNet.WebApi/HttpConfigurationExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,7 @@ public static class HttpConfigurationExtensions
public static void UseBugsnag(this HttpConfiguration httpConfiguration, IConfiguration configuration)
{
httpConfiguration.MessageHandlers.Add(new DelegatingHandler(configuration));

#if NET40
// here we are being added to a webapi 1 application which does not
// support the IExceptionLogger
httpConfiguration.Filters.Add(new ExceptionFilterAttribute());
#elif NET45
// here we are being added to a webapi 2 application, we do not add the
// ExceptionFilterAttribute as well as that could result in double
// sending the exception
httpConfiguration.Services.Add(typeof(System.Web.Http.ExceptionHandling.IExceptionLogger), new ExceptionLogger());
#endif
}
}
}
5 changes: 1 addition & 4 deletions src/Bugsnag.AspNet/Bugsnag.AspNet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,12 @@
<PackageId>Bugsnag.AspNet</PackageId>
<Title>Bugsnag .NET ASP.NET Notifier</Title>
<Description>The Bugsnag Notifier for ASP.NET gives you instant notification of exceptions thrown from your ASP.NET applications. Any uncaught exceptions will trigger a notification to be sent to your Bugsnag project.</Description>
<TargetFrameworks>net35;net40;net45</TargetFrameworks>
<TargetFrameworks>net462</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Bugsnag\Bugsnag.csproj" />
<ProjectReference Include="..\Bugsnag.ConfigurationSection\Bugsnag.ConfigurationSection.csproj" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net40'">
<PackageReference Include="Microsoft.Web.Infrastructure" Version="1.0.0" />
</ItemGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Core" />
Expand Down
4 changes: 0 additions & 4 deletions src/Bugsnag.AspNet/HttpModuleAutoLoad.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@ public static class HttpModuleAutoLoad
{
public static void Attach()
{
#if NET45
System.Web.HttpApplication.RegisterModule(typeof(HttpModule));
#elif NET40
Microsoft.Web.Infrastructure.DynamicModuleHelper.DynamicModuleUtility.RegisterModule(typeof(HttpModule));
#endif
}
}
}
4 changes: 1 addition & 3 deletions src/Bugsnag.AspNet/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,5 @@
using System.Web;

[assembly: CLSCompliant(true)]

#if NET45 || NET40
[assembly: PreApplicationStartMethod(typeof(Bugsnag.AspNet.HttpModuleAutoLoad), "Attach")]
#endif

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<PackageId>Bugsnag.ConfigurationSection</PackageId>
<Title>Bugsnag .NET Configuration</Title>
<Description>The Bugsnag .NET configuration library is used to configure your Bugsnag integration using a Web.config or App.config</Description>
<TargetFrameworks>net35;net45</TargetFrameworks>
<TargetFrameworks>net462</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Bugsnag\Bugsnag.csproj" />
Expand Down
2 changes: 1 addition & 1 deletion src/Bugsnag.ConfigurationSection/Configuration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ public IWebProxy Proxy
{
try
{
if (Polyfills.String.IsNullOrWhiteSpace(ProxyAddress)) return null;
if (String.IsNullOrWhiteSpace(ProxyAddress)) return null;

// we should probably store this so we don't try to create a new one each time this is accessed
if (!string.IsNullOrEmpty(ProxyUsername) && !string.IsNullOrEmpty(ProxyPassword))
Expand Down
21 changes: 4 additions & 17 deletions src/Bugsnag/Bugsnag.csproj
Original file line number Diff line number Diff line change
@@ -1,31 +1,18 @@
<Project Sdk="Microsoft.NET.Sdk">
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<PackageId>Bugsnag</PackageId>
<Title>Bugsnag .NET Notifier</Title>
<Description>The Bugsnag Notifier for .NET gives you instant notification of exceptions thrown from your .NET applications. Any uncaught exceptions will trigger a notification to be sent to your Bugsnag project.</Description>
<TargetFrameworks>net35;net40;net45;netstandard1.3;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net462;netstandard2.0</TargetFrameworks>
</PropertyGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net35'">
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Runtime.Serialization" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net40'">
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Runtime.Serialization" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'net45'">
<ItemGroup Condition="'$(TargetFramework)' == 'net462'">
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.Xml" />
<Reference Include="System.Xml.Linq" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard1.3'">
<PackageReference Include="System.Reflection.TypeExtensions" Version="4.3.0" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard1.3' OR '$(TargetFramework)' == 'netstandard2.0'">
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0'">
<PackageReference Include="System.Collections.Specialized" Version="4.3.0" />
<PackageReference Include="System.Diagnostics.TraceSource" Version="4.3.0" />
<PackageReference Include="System.Diagnostics.StackTrace" Version="4.3.0" />
Expand Down
4 changes: 2 additions & 2 deletions src/Bugsnag/Middleware.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public static class InternalMiddleware
{
foreach (var stackTraceLine in exception.StackTrace)
{
if (!Polyfills.String.IsNullOrWhiteSpace(stackTraceLine.FileName))
if (!String.IsNullOrWhiteSpace(stackTraceLine.FileName))
{
foreach (var filePrefix in projectRoots)
{
Expand All @@ -93,7 +93,7 @@ public static class InternalMiddleware
{
foreach (var stackTraceLine in exception.StackTrace)
{
if (!Polyfills.String.IsNullOrWhiteSpace(stackTraceLine.MethodName))
if (!String.IsNullOrWhiteSpace(stackTraceLine.MethodName))
{
foreach (var @namespace in report.Configuration.ProjectNamespaces)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Bugsnag/Payload/Device.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ private static string OsName
{
get
{
#if NETSTANDARD1_3 || NETSTANDARD2_0
#if NETSTANDARD2_0
return System.Runtime.InteropServices.RuntimeInformation.OSDescription;
#else
return Environment.OSVersion.VersionString;
Expand Down
2 changes: 0 additions & 2 deletions src/Bugsnag/Payload/Exception.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ IEnumerator IEnumerable.GetEnumerator()
}
}
break;
#if !NET35
case System.AggregateException aggregateException:
foreach (var exception in aggregateException.InnerExceptions)
{
Expand All @@ -59,7 +58,6 @@ IEnumerator IEnumerable.GetEnumerator()
}
}
break;
#endif
default:
foreach (var item in FlattenAndReverseExceptionTree(ex.InnerException))
{
Expand Down
4 changes: 2 additions & 2 deletions src/Bugsnag/Payload/PayloadExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ public static void AddToPayload<T>(this Dictionary<string, T> dictionary, string

switch (value)
{
case System.String s:
if (!Polyfills.String.IsNullOrWhiteSpace(s))
case String s:
if (!String.IsNullOrWhiteSpace(s))
{
dictionary[key] = value;
}
Expand Down
5 changes: 2 additions & 3 deletions src/Bugsnag/Payload/StackTraceLine.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
Expand Down Expand Up @@ -27,7 +28,6 @@ public IEnumerator<StackTraceLine> GetEnumerator()
var exceptionStackTrace = true;
var stackFrames = new System.Diagnostics.StackTrace(_originalException, true).GetFrames();

#if !NETSTANDARD1_3
if (stackFrames == null || stackFrames.Length == 0)
{
// this usually means that the exception has not been thrown so we need
Expand All @@ -36,7 +36,6 @@ public IEnumerator<StackTraceLine> GetEnumerator()
exceptionStackTrace = false;
stackFrames = new System.Diagnostics.StackTrace(true).GetFrames();
}
#endif

if (stackFrames == null)
{
Expand All @@ -53,7 +52,7 @@ public IEnumerator<StackTraceLine> GetEnumerator()
{
// if the exception has not come from a stack trace then we need to
// skip the frames that originate from inside the notifier code base
var currentStackFrameIsNotify = !Polyfills.String.IsNullOrWhiteSpace(stackFrame.MethodName) && stackFrame.MethodName.StartsWith("Bugsnag.Client.Notify");
var currentStackFrameIsNotify = !String.IsNullOrWhiteSpace(stackFrame.MethodName) && stackFrame.MethodName.StartsWith("Bugsnag.Client.Notify");
seenBugsnagFrames = seenBugsnagFrames || currentStackFrameIsNotify;
if (!seenBugsnagFrames || currentStackFrameIsNotify)
{
Expand Down
58 changes: 0 additions & 58 deletions src/Bugsnag/Polyfills.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ public static class FileExtensions
{
public static IEnumerable<string> ReadLines(string file)
{
#if NET35
return Enumerable.Empty<string>();
#else
try
{
return File.ReadLines(file);
Expand All @@ -22,61 +19,6 @@ public static IEnumerable<string> ReadLines(string file)
Trace.WriteLine(exception);
return Enumerable.Empty<string>();
}
#endif
}
}

public static class String
{
public static bool IsNullOrWhiteSpace(string s)
{
#if NET35
if (s == null) return true;

for (int i = 0; i < s.Length; i++)
{
if (!Char.IsWhiteSpace(s[i])) return false;
}

return true;
#else
return System.String.IsNullOrWhiteSpace(s);
#endif
}
}
}

#if NET35 || NET40
namespace System.Reflection
{
public static class IntrospectionExtensions
{
public static TypeInfo GetTypeInfo(this Type type)
{
return new TypeInfo();
}
}

public class TypeInfo
{
public Type[] GenericTypeArguments { get; } = new Type[0];

public bool IsGenericType => false;
}
}

namespace Microsoft.Extensions.FileProviders
{
public interface IFileProvider
{
IFileInfo GetFileInfo(string path);
}

public interface IFileInfo
{
string PhysicalPath { get; }
bool Exists { get; }
Stream CreateReadStream();
}
}
#endif
3 changes: 0 additions & 3 deletions src/Bugsnag/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
using System;
#if NET45
using System.Security;
#endif

[assembly: CLSCompliant(true)]
Loading