Skip to content

Commit a3e0977

Browse files
authored
Removed Portable Package (PCL) support (#227)
* Removed Portable Package (PCL) support
1 parent 7a9d3a6 commit a3e0977

37 files changed

+94
-841
lines changed

src/Exceptionless.Portable/Exceptionless.Portable.csproj

Lines changed: 0 additions & 70 deletions
This file was deleted.

src/Exceptionless.Portable/readme.txt

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/Exceptionless/Configuration/CertificateData.cs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
#if !PORTABLE && !NETSTANDARD1_2
2-
using System.Net.Http;
1+
using System.Net.Http;
32
using System.Net.Security;
43
using System.Security.Cryptography.X509Certificates;
54

@@ -45,12 +44,11 @@ private CertificateData(X509Chain chain, SslPolicyErrors sslPolicyErrors) {
4544
public object Sender { get; }
4645
#endif
4746

48-
#if !NET45 && !PORTABLE && !NETSTANDARD1_2
47+
#if !NET45
4948
/// <summary>
5049
/// The request which was sent to the remore party
5150
/// </summary>
5251
public HttpRequestMessage Request { get; }
5352
#endif
5453
}
55-
}
56-
#endif
54+
}

src/Exceptionless/Configuration/ExceptionlessConfiguration.cs

Lines changed: 3 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
using System;
2-
#if !PORTABLE
32
using System.Collections.Concurrent;
4-
#endif
53
using System.Collections.Generic;
64
using System.Diagnostics;
75
using System.Linq;
@@ -20,14 +18,9 @@ public class ExceptionlessConfiguration {
2018
private const string DEFAULT_HEARTBEAT_SERVER_URL = "https://heartbeat.exceptionless.io";
2119
private const string DEFAULT_USER_AGENT = "exceptionless/";
2220
private static readonly Lazy<string> _version = new Lazy<string>(() => {
23-
#if !PORTABLE
2421
var assembly = Assembly.GetExecutingAssembly();
2522
var attribute = assembly.GetCustomAttribute<AssemblyFileVersionAttribute>();
2623
return attribute.Version;
27-
#else
28-
// NOTE: This is hard coded for a single release. The next release will deprecate portable.
29-
return "4.4.0.0";
30-
#endif
3124
});
3225
private const int DEFAULT_SUBMISSION_BATCH_SIZE = 50;
3326

@@ -167,7 +160,7 @@ public string ApiKey {
167160
/// Whether the client is currently enabled or not. If it is disabled, submitted errors will be discarded and no data will be sent to the server.
168161
/// </summary>
169162
public bool Enabled { get; set; }
170-
163+
171164
/// <summary>
172165
/// Maximum time (provided in days) that the queue will persist events
173166
/// </summary>
@@ -194,7 +187,7 @@ public string ApiKey {
194187
public SettingsDictionary Settings { get; private set; }
195188

196189
/// <summary>
197-
/// How often the client should check for updated server settings when idle. The default is every 2 minutes.
190+
/// How often the client should check for updated server settings when idle. The default is every 2 minutes.
198191
/// </summary>
199192
public TimeSpan? UpdateSettingsWhenIdleInterval {
200193
get { return _updateSettingsWhenIdleInterval; }
@@ -287,12 +280,10 @@ public int SubmissionBatchSize {
287280
}
288281
}
289282

290-
#if !PORTABLE && !NETSTANDARD1_2
291283
/// <summary>
292284
/// Callback which is invoked to validate the exceptionless server certificate.
293285
/// </summary>
294286
public Func<CertificateData, bool> ServerCertificateValidationCallback { get; set; }
295-
#endif
296287

297288
/// <summary>
298289
/// A list of exclusion patterns that will automatically remove any data that matches them from any data submitted to the server.
@@ -372,11 +363,7 @@ public void AddEventExclusion(Func<Event, bool> eventExclusionCallback) {
372363

373364
#region Plugins
374365

375-
#if !PORTABLE
376366
private readonly ConcurrentDictionary<string, PluginRegistration> _plugins = new ConcurrentDictionary<string, PluginRegistration>();
377-
#else
378-
private readonly Dictionary<string, PluginRegistration> _plugins = new Dictionary<string, PluginRegistration>();
379-
#endif
380367

381368
/// <summary>
382369
/// The list of plugins that will be used in this configuration.
@@ -394,12 +381,8 @@ public void AddPlugin<T>(T plugin) where T : IEventPlugin {
394381
string key = typeof(T).FullName;
395382
RemovePlugin(key);
396383

397-
#if !PORTABLE
398384
if (!_plugins.TryAdd(key, new PluginRegistration(key, GetPriority(typeof(T)), new Lazy<IEventPlugin>(() => plugin))))
399385
Resolver.GetLog().Error(String.Format("Unable to add plugin: {0}", key));
400-
#else
401-
_plugins[key] = new PluginRegistration(key, GetPriority(typeof(T)), new Lazy<IEventPlugin>(() => plugin));
402-
#endif
403386
}
404387

405388
/// <summary>
@@ -419,12 +402,8 @@ public void AddPlugin(string key, Type pluginType) {
419402
RemovePlugin(key);
420403

421404
var plugin = new PluginRegistration(key, GetPriority(pluginType), new Lazy<IEventPlugin>(() => Resolver.Resolve(pluginType) as IEventPlugin));
422-
#if !PORTABLE
423405
if (!_plugins.TryAdd(key, plugin))
424406
Resolver.GetLog().Error(String.Format("Unable to add plugin: {0}", key));
425-
#else
426-
_plugins[key] = plugin;
427-
#endif
428407
}
429408

430409
/// <summary>
@@ -446,12 +425,8 @@ public void AddPlugin(string key, int priority, Func<ExceptionlessConfiguration,
446425
RemovePlugin(key);
447426

448427
var plugin = new PluginRegistration(key, priority, new Lazy<IEventPlugin>(() => factory(this)));
449-
#if !PORTABLE
450428
if (!_plugins.TryAdd(key, plugin))
451429
Resolver.GetLog().Error(String.Format("Unable to add plugin: {0}", key));
452-
#else
453-
_plugins[key] = plugin;
454-
#endif
455430
}
456431

457432
/// <summary>
@@ -479,14 +454,10 @@ public void AddPlugin(string key, Action<EventPluginContext> pluginAction) {
479454
/// <param name="pluginAction">The plugin action to run.</param>
480455
public void AddPlugin(string key, int priority, Action<EventPluginContext> pluginAction) {
481456
RemovePlugin(key);
482-
457+
483458
var plugin = new PluginRegistration(key, priority, new Lazy<IEventPlugin>(() => new ActionPlugin(pluginAction)));
484-
#if !PORTABLE
485459
if (!_plugins.TryAdd(key, plugin))
486460
Resolver.GetLog().Error(String.Format("Unable to add plugin: {0}", key));
487-
#else
488-
_plugins[key] = plugin;
489-
#endif
490461
}
491462

492463
/// <summary>
@@ -502,16 +473,9 @@ public void RemovePlugin<T>() where T : IEventPlugin {
502473
/// </summary>
503474
/// <param name="key">The key for the plugin to be removed.</param>
504475
public void RemovePlugin(string key) {
505-
#if !PORTABLE
506476
PluginRegistration plugin;
507477
if (_plugins.TryRemove(key, out plugin))
508478
plugin.Dispose();
509-
#else
510-
if (_plugins.ContainsKey(key)) {
511-
_plugins[key].Dispose();
512-
_plugins.Remove(key);
513-
}
514-
#endif
515479
}
516480

517481
private int GetPriority(Type type) {

src/Exceptionless/Configuration/ExceptionlessSection.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#if !PORTABLE && !NETSTANDARD
1+
#if !NETSTANDARD
22
using System;
33
using System.ComponentModel;
44
using System.Configuration;
@@ -10,7 +10,7 @@ internal class ExceptionlessSection : ConfigurationSection {
1010

1111
[ConfigurationProperty("apiKey", IsRequired = true)]
1212
public string ApiKey { get { return base["apiKey"] as string; } set { base["apiKey"] = value; } }
13-
13+
1414
[ConfigurationProperty("serverUrl")]
1515
public string ServerUrl { get { return base["serverUrl"] as string; } set { base["serverUrl"] = value; } }
1616

src/Exceptionless/Exceptionless.csproj

Lines changed: 2 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,14 @@
55
<TargetFramework>netstandard2.0</TargetFramework>
66
</PropertyGroup>
77
<PropertyGroup Condition=" '$(OS)' == 'Windows_NT' ">
8-
<TargetFrameworks>netstandard2.0;portable46-net451+win81+wpa81;net45</TargetFrameworks>
8+
<TargetFrameworks>netstandard2.0;net45</TargetFrameworks>
99
</PropertyGroup>
1010

1111
<PropertyGroup Label="Package">
1212
<PackageId>Exceptionless</PackageId>
1313
<AssemblyName>Exceptionless</AssemblyName>
1414
<AssemblyTitle>Exceptionless client for non visual (ie. Console and Services) applications.</AssemblyTitle>
15-
<Description>Exceptionless client for portable applications. $(Description)</Description>
16-
<PackageTags>Exceptionless;Error;Report;Reporting;Exception;Logging;Log;ELMAH;pcl;NETSTANDARD;Core</PackageTags>
15+
<PackageTags>Exceptionless;Error;Report;Reporting;Exception;Logging;Log;ELMAH;NETSTANDARD;Core</PackageTags>
1716
</PropertyGroup>
1817

1918
<ItemGroup Label="Package">
@@ -39,48 +38,6 @@
3938
<PackageReference Include="System.Reflection.Emit.Lightweight" Version="4.7.0" />
4039
</ItemGroup>
4140

42-
<PropertyGroup Condition="'$(TargetFramework)' == 'portable46-net451+win81+wpa81'" Label="Build">
43-
<TargetFrameworkIdentifier>.NETPortable</TargetFrameworkIdentifier>
44-
<TargetFrameworkVersion>v4.6</TargetFrameworkVersion>
45-
<TargetFrameworkProfile>Profile151</TargetFrameworkProfile>
46-
<DefineConstants>$(DefineConstants);PORTABLE</DefineConstants>
47-
</PropertyGroup>
48-
49-
<ItemGroup Condition="'$(TargetFramework)' == 'portable46-net451+win81+wpa81'" Label="Framework References">
50-
<Reference Include="Microsoft.CSharp" />
51-
<Reference Include="System" />
52-
<Reference Include="System.Collections" />
53-
<Reference Include="System.Core" />
54-
<Reference Include="System.Diagnostics.Debug" />
55-
<Reference Include="System.Dynamic.Runtime" />
56-
<Reference Include="System.Globalization" />
57-
<Reference Include="System.IO" />
58-
<Reference Include="System.IO.Compression" />
59-
<Reference Include="System.Linq" />
60-
<Reference Include="System.Linq.Expressions" />
61-
<Reference Include="System.Net.Http" />
62-
<Reference Include="System.Net.Primitives" />
63-
<Reference Include="System.ObjectModel" />
64-
<Reference Include="System.Reflection" />
65-
<Reference Include="System.Reflection.Extensions" />
66-
<Reference Include="System.Reflection.Primitives" />
67-
<Reference Include="System.Resources.ResourceManager" />
68-
<Reference Include="System.Runtime" />
69-
<Reference Include="System.Runtime.Extensions" />
70-
<Reference Include="System.Runtime.Serialization" />
71-
<Reference Include="System.Runtime.Serialization.Primitives" />
72-
<Reference Include="System.Text.Encoding" />
73-
<Reference Include="System.Text.Encoding.Extensions" />
74-
<Reference Include="System.Text.RegularExpressions" />
75-
<Reference Include="System.Threading" />
76-
<Reference Include="System.Threading.Tasks" />
77-
<Reference Include="System.Threading.Timer" />
78-
<Reference Include="System.Xml" />
79-
<Reference Include="System.Xml.Linq" />
80-
<Reference Include="System.Xml.ReaderWriter" />
81-
<Reference Include="System.Xml.XDocument" />
82-
</ItemGroup>
83-
8441
<PropertyGroup Condition="'$(TargetFramework)' == 'net45'" Label="Build">
8542
<DefineConstants>$(DefineConstants);NET45</DefineConstants>
8643
</PropertyGroup>

src/Exceptionless/Extensions/EventBuilderExtensions.cs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
using System;
22
using System.Collections.Generic;
33
using Exceptionless.Models.Data;
4-
5-
#if !PORTABLE && !NETSTANDARD1_2
64
using Exceptionless.Plugins.Default;
7-
#endif
85

96
namespace Exceptionless {
107
public static class EventBuilderExtensions {
@@ -102,7 +99,6 @@ public static EventBuilder SetManualStackingKey(this EventBuilder builder, strin
10299
return builder;
103100
}
104101

105-
#if !PORTABLE && !NETSTANDARD1_2
106102
/// <summary>
107103
/// Adds the recent trace log entries to the event.
108104
/// </summary>
@@ -113,6 +109,5 @@ public static EventBuilder AddRecentTraceLogEntries(this EventBuilder builder, D
113109
TraceLogPlugin.AddRecentTraceLogEntries(builder.Target, listener, maxEntriesToInclude);
114110
return builder;
115111
}
116-
#endif
117112
}
118113
}

src/Exceptionless/Extensions/ExceptionlessClientExtensions.cs

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,15 @@ public static void Startup(this ExceptionlessClient client, string apiKey = null
2323
client.Configuration.ApiKey = apiKey;
2424

2525
client.Configuration.ReadAllConfig();
26-
27-
#if !PORTABLE && !NETSTANDARD1_2
2826
client.Configuration.UseTraceLogEntriesPlugin();
29-
#endif
3027

3128
if (client.Configuration.UpdateSettingsWhenIdleInterval == null)
3229
client.Configuration.UpdateSettingsWhenIdleInterval = TimeSpan.FromMinutes(2);
3330

34-
#if !PORTABLE && !NETSTANDARD1_2
3531
client.RegisterAppDomainUnhandledExceptionHandler();
3632

3733
// make sure that queued events are sent when the app exits
3834
client.RegisterOnProcessExitHandler();
39-
#endif
4035
client.RegisterTaskSchedulerUnobservedTaskExceptionHandler();
4136

4237
if (client.Configuration.SessionsEnabled)
@@ -51,10 +46,8 @@ public static void Shutdown(this ExceptionlessClient client) {
5146
if (client == null)
5247
throw new ArgumentNullException(nameof(client));
5348

54-
#if !PORTABLE && !NETSTANDARD1_2
5549
client.UnregisterAppDomainUnhandledExceptionHandler();
5650
client.UnregisterOnProcessExitHandler();
57-
#endif
5851
client.UnregisterTaskSchedulerUnobservedTaskExceptionHandler();
5952

6053
client.ProcessQueue();
@@ -349,7 +342,6 @@ public static void SubmitSessionHeartbeat(this ExceptionlessClient client, strin
349342

350343
namespace Exceptionless.Extensions {
351344
public static class ExceptionlessClientExtensions {
352-
#if !PORTABLE && !NETSTANDARD1_2
353345
private static UnhandledExceptionEventHandler _onAppDomainUnhandledException;
354346
public static void RegisterAppDomainUnhandledExceptionHandler(this ExceptionlessClient client) {
355347
if (client == null)
@@ -426,7 +418,6 @@ public static void UnregisterOnProcessExitHandler(this ExceptionlessClient clien
426418
AppDomain.CurrentDomain.ProcessExit -= _onProcessExit;
427419
_onProcessExit = null;
428420
}
429-
#endif
430421

431422
private static EventHandler<UnobservedTaskExceptionEventArgs> _onTaskSchedulerOnUnobservedTaskException;
432423
public static void RegisterTaskSchedulerUnobservedTaskExceptionHandler(this ExceptionlessClient client) {

0 commit comments

Comments
 (0)