Skip to content

Commit c81b126

Browse files
GeirGrusomniemyjski
authored andcommitted
Introduce Exceptionless.Linking.PreserveAttribute to constructors removed by Xamarin Linker (#189)
* Introduce an internal Android.PreserveAttribute and apply it to appropriate constructors. Fixes #188 * Apply PreserveAttribute to assembly instead of constructors.
1 parent 839f275 commit c81b126

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using System;
2+
3+
namespace Exceptionless.Linking {
4+
/// <summary>
5+
/// This class is used to tell the Xamarin linker to not remove the specified member, type or assembly.
6+
/// </summary>
7+
internal sealed class PreserveAttribute : Attribute {
8+
/// <summary>
9+
/// Ensures that all members of this type are preserved.
10+
/// </summary>
11+
public bool AllMembers;
12+
/// <summary>
13+
/// Flags the method as a method to preserve during linking if the container class is pulled in.
14+
/// </summary>
15+
public bool Conditional;
16+
}
17+
}

src/Exceptionless/Properties/AssemblyInfo.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
[assembly: ComVisible(false)]
88
[assembly: AssemblyTitle("Exceptionless")]
99
[assembly: AssemblyDescription("Exceptionless")]
10-
10+
[assembly: Exceptionless.Linking.Preserve]
1111
#if !PORTABLE && !NETSTANDARD1_2
1212
[assembly: Guid("2d458cc4-3bb3-4852-b6a2-11d5ac8672df")]
1313
#endif

0 commit comments

Comments
 (0)