Skip to content

Commit 4d4929a

Browse files
committed
Added support for System.Appdomain in netstandard 1.3
1 parent 6bc9192 commit 4d4929a

File tree

11 files changed

+29
-17
lines changed

11 files changed

+29
-17
lines changed

src/Exceptionless.Signed/project.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,13 +92,15 @@
9292
"dependencies": {
9393
"Microsoft.CSharp": "4.0.1-rc2-24027",
9494
"Microsoft.Extensions.PlatformAbstractions": "1.0.0-rc2-final",
95+
"System.AppDomain": "2.0.10",
9596
"System.Collections": "4.0.11-rc2-24027",
9697
"System.Collections.Concurrent": "4.0.12-rc2-24027",
9798
"System.ComponentModel.TypeConverter": "4.0.1-rc2-24027",
9899
"System.Data.Common": "4.0.1-rc2-24027",
99100
"System.Diagnostics.Debug": "4.0.11-rc2-24027",
100101
"System.Diagnostics.Process": "4.1.0-rc2-24027",
101102
"System.Diagnostics.StackTrace": "4.0.1-rc2-24027",
103+
"System.Diagnostics.Tools": "4.0.1-rc2-24027",
102104
"System.Diagnostics.TraceSource": "4.0.0-rc2-24027",
103105
"System.Dynamic.Runtime": "4.0.11-rc2-24027",
104106
"System.Globalization": "4.0.11-rc2-24027",
@@ -143,13 +145,15 @@
143145
"dependencies": {
144146
"Microsoft.CSharp": "4.0.1-rc2-24027",
145147
"Microsoft.Extensions.PlatformAbstractions": "1.0.0-rc2-final",
148+
"System.AppDomain": "2.0.10",
146149
"System.Collections": "4.0.11-rc2-24027",
147150
"System.Collections.Concurrent": "4.0.12-rc2-24027",
148151
"System.ComponentModel.TypeConverter": "4.0.1-rc2-24027",
149152
"System.Data.Common": "4.0.1-rc2-24027",
150153
"System.Diagnostics.Debug": "4.0.11-rc2-24027",
151154
"System.Diagnostics.Process": "4.1.0-rc2-24027",
152155
"System.Diagnostics.StackTrace": "4.0.1-rc2-24027",
156+
"System.Diagnostics.Tools": "4.0.1-rc2-24027",
153157
"System.Diagnostics.TraceSource": "4.0.0-rc2-24027",
154158
"System.Dynamic.Runtime": "4.0.11-rc2-24027",
155159
"System.Globalization": "4.0.11-rc2-24027",
@@ -195,7 +199,7 @@
195199
"dependencies": {
196200
"Microsoft.CSharp": "4.0.1-rc2-24027",
197201
"Microsoft.Extensions.PlatformAbstractions": "1.0.0-rc2-final",
198-
"System.AppDomain": "2.0.9",
202+
"System.AppDomain": "2.0.10",
199203
"System.Collections": "4.0.11-rc2-24027",
200204
"System.Collections.Concurrent": "4.0.12-rc2-24027",
201205
"System.ComponentModel.TypeConverter": "4.0.1-rc2-24027",

src/Exceptionless/Dependency/TinyIoC.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
#undef READER_WRITER_LOCK_SLIM
5151
#endif
5252

53-
#if NETSTANDARD1_0 || NETSTANDARD1_1 || NETSTANDARD1_2 || NETSTANDARD1_3 || NETSTANDARD1_4
53+
#if NETSTANDARD1_0 || NETSTANDARD1_1 || NETSTANDARD1_2
5454
#undef APPDOMAIN_GETASSEMBLIES
5555
#endif
5656

src/Exceptionless/Extensions/ExceptionlessClientExtensions.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ public static void Startup(this ExceptionlessClient client, string apiKey = null
2828
if (client.Configuration.UpdateSettingsWhenIdleInterval == null)
2929
client.Configuration.UpdateSettingsWhenIdleInterval = TimeSpan.FromMinutes(2);
3030

31-
#if NETSTANDARD1_5 || NET45
31+
#if !PORTABLE && !NETSTANDARD1_2
3232
client.RegisterAppDomainUnhandledExceptionHandler();
3333

3434
// make sure that queued events are sent when the app exits
@@ -45,7 +45,7 @@ public static void Startup(this ExceptionlessClient client, string apiKey = null
4545
/// </summary>
4646
/// <param name="client">The ExceptionlessClient.</param>
4747
public static void Shutdown(this ExceptionlessClient client) {
48-
#if NETSTANDARD1_5 || NET45
48+
#if !PORTABLE && !NETSTANDARD1_2
4949
client.UnregisterAppDomainUnhandledExceptionHandler();
5050
client.UnregisterOnProcessExitHandler();
5151
#endif
@@ -280,7 +280,7 @@ public static void SubmitSessionHeartbeat(this ExceptionlessClient client, strin
280280

281281
namespace Exceptionless.Extensions {
282282
public static class ExceptionlessClientExtensions {
283-
#if NETSTANDARD1_5 || NET45
283+
#if !PORTABLE && !NETSTANDARD1_2
284284
private static UnhandledExceptionEventHandler _onAppDomainUnhandledException;
285285
public static void RegisterAppDomainUnhandledExceptionHandler(this ExceptionlessClient client) {
286286
if (_onAppDomainUnhandledException == null) {

src/Exceptionless/Extensions/ToErrorModelExtensions.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,20 +138,22 @@ private static string GetMessage(this Exception exception) {
138138

139139
private static ModuleCollection GetLoadedModules(IExceptionlessLog log, bool includeSystem = false, bool includeDynamic = false) {
140140
var modules = new ModuleCollection();
141-
#if NET45 || NETSTANDARD1_5
141+
#if !PORTABLE && !NETSTANDARD1_2
142142
try {
143143
int id = 1;
144144
foreach (Assembly assembly in AppDomain.CurrentDomain.GetAssemblies()) {
145145
if (!includeDynamic && assembly.IsDynamic)
146146
continue;
147147

148+
#if !NETSTANDARD1_3 && !NETSTANDARD1_4
148149
try {
149150
if (!includeDynamic && String.IsNullOrEmpty(assembly.Location))
150151
continue;
151152
} catch (SecurityException ex) {
152153
const string message = "An error occurred while getting the Assembly.Location value. This error will occur when when you are not running under full trust.";
153154
log.Error(typeof(ExceptionlessClient), ex, message);
154155
}
156+
#endif
155157

156158
if (!includeSystem) {
157159
try {

src/Exceptionless/Newtonsoft.Json/Serialization/DefaultSerializationBinder.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ private static Type GetTypeFromTypeNameKey(TypeNameKey typeNameKey)
6161
assembly = Assembly.Load(assemblyName);
6262
#endif
6363

64-
#if !(PORTABLE40 || PORTABLE || DOTNET || NETSTANDARD1_0 || NETSTANDARD1_1 || NETSTANDARD1_2 || NETSTANDARD1_3 || NETSTANDARD1_4)
64+
#if !(PORTABLE40 || PORTABLE || DOTNET || NETSTANDARD1_0 || NETSTANDARD1_1 || NETSTANDARD1_2)
6565
if (assembly == null)
6666
{
6767
// will find assemblies loaded with Assembly.LoadFile outside of the main directory

src/Exceptionless/Newtonsoft.Json/Serialization/JsonTypeReflector.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ public static bool FullyTrusted
418418
{
419419
if (_fullyTrusted == null)
420420
{
421-
#if (DOTNET || PORTABLE || PORTABLE40 || NETSTANDARD1_0 || NETSTANDARD1_1 || NETSTANDARD1_2 || NETSTANDARD1_3 || NETSTANDARD1_4 || NETSTANDARD1_5)
421+
#if (DOTNET || PORTABLE || PORTABLE40 || NETSTANDARD1_0 || NETSTANDARD1_1 || NETSTANDARD1_2)
422422
_fullyTrusted = false;
423423
#elif !(NET20 || NET35 || PORTABLE40)
424424
AppDomain appDomain = AppDomain.CurrentDomain;

src/Exceptionless/Plugins/Default/080_VersionPlugin.cs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public void Run(EventPluginContext context) {
2626
_checkedForVersion = true;
2727

2828
string version = GetVersionFromRuntimeInfo(context.Log);
29-
#if NET45 || NETSTANDARD1_5
29+
#if !PORTABLE && !NETSTANDARD1_2
3030
if (String.IsNullOrEmpty(version))
3131
version = GetVersionFromLoadedAssemblies(context.Log);
3232
#endif
@@ -48,7 +48,7 @@ private string GetVersionFromRuntimeInfo(IExceptionlessLog log) {
4848
return null;
4949
}
5050

51-
#if NET45 || NETSTANDARD1_5
51+
#if !PORTABLE && !NETSTANDARD1_2
5252
private string GetVersionFromLoadedAssemblies(IExceptionlessLog log) {
5353
try {
5454
foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies().Where(a => !a.IsDynamic && a != typeof(ExceptionlessClient).GetTypeInfo().Assembly && a != GetType().GetTypeInfo().Assembly && a != typeof(object).GetTypeInfo().Assembly)) {
@@ -58,9 +58,11 @@ private string GetVersionFromLoadedAssemblies(IExceptionlessLog log) {
5858
string company = assembly.GetCompany();
5959
if (!String.IsNullOrEmpty(company) && (String.Equals(company, "Exceptionless", StringComparison.OrdinalIgnoreCase) || String.Equals(company, "Microsoft Corporation", StringComparison.OrdinalIgnoreCase)))
6060
continue;
61-
61+
62+
#if !NETSTANDARD1_3 && !NETSTANDARD1_4
6263
if (!assembly.GetReferencedAssemblies().Any(an => String.Equals(an.FullName, typeof(ExceptionlessClient).GetTypeInfo().Assembly.FullName)))
6364
continue;
65+
#endif
6466

6567
string version = GetVersionFromAssembly(assembly);
6668
if (!String.IsNullOrEmpty(version))
@@ -92,6 +94,6 @@ private string GetVersionFromAssembly(Assembly assembly) {
9294
return !String.IsNullOrEmpty(version) && !String.Equals(version, "0.0.0.0") ? version : null;
9395
}
9496
#endif
95-
}
96-
}
97+
}
98+
}
9799
#endif

src/Exceptionless/Services/DefaultEnvironmentInfoCollector.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public EnvironmentInfo GetEnvironmentInfo() {
3939
}
4040

4141
private void PopulateApplicationInfo(EnvironmentInfo info) {
42-
#if NET45 || NETSTANDARD1_5
42+
#if !PORTABLE && !NETSTANDARD1_2
4343
try {
4444
info.Data.Add("AppDomainName", AppDomain.CurrentDomain.FriendlyName);
4545
} catch (Exception ex) {

src/Exceptionless/Utility/AssemblyHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public static string GetAssemblyTitle() {
3535
public static List<Type> GetTypes(IExceptionlessLog log) {
3636
var types = new List<Type>();
3737

38-
#if NET45 || NETSTANDARD1_5
38+
#if !PORTABLE && !NETSTANDARD1_2
3939
var assemblies = AppDomain.CurrentDomain.GetAssemblies();
4040
foreach (var assembly in assemblies) {
4141
try {

src/Exceptionless/Utility/PathHelper.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public static string ExpandPath(string sourceFile) {
4343
#endif
4444
}
4545

46-
#if !(PORTABLE || NETSTANDARD1_0 || NETSTANDARD1_1 || NETSTANDARD1_2 || NETSTANDARD1_3 || NETSTANDARD1_4)
46+
#if !(PORTABLE || NETSTANDARD1_0 || NETSTANDARD1_1 || NETSTANDARD1_2)
4747
/// <summary>
4848
/// Gets the data directory for the |DataDirectory| macro.
4949
/// </summary>

0 commit comments

Comments
 (0)