Skip to content

Commit

Permalink
Disable tracelogger on net46 with mono backend
Browse files Browse the repository at this point in the history
Workaround for: #20
Disable the trace-logger on the '.Net 4.x' api in combination with the 'mono' scripting backend.
Reason is that the code-stripper (on all settings except 'Disabled') removes part of
'System.Configuration' on which 'System.Diagnostics.TraceListener' depends.
Because upm packages do not support 'link.xml' files at this time there is no easy way to instruct
the stripper not to remove those. Disabling is acceptable in this case as its only used as a log-sink
for 'Debug.Assert' and 'Debug.Fail' and either of those triggering would mean there is a serious bug
in this repository.
  • Loading branch information
BastianBlokland committed Nov 26, 2019
1 parent 6a068de commit c581a33
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/ComponentTask/Internal/TraceLogger.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
/* Workaround for: https://github.com/BastianBlokland/componenttask-unity/issues/20
Disable the trace-logger on the '.Net 4.x' api in combination with the 'mono' scripting backend.
Reason is that the code-stripper (on all settings except 'Disabled') removes part of
'System.Configuration' on which 'System.Diagnostics.TraceListener' depends.
Because upm packages do not support 'link.xml' files at this time there is no easy way to instruct
the stripper not to remove those. Disabling is acceptable in this case as its only used as a log-sink
for 'Debug.Assert' and 'Debug.Fail' and either of those triggering would mean there is a serious bug
in this repository. */
#if !(ENABLE_MONO && NET_4_6)

using System.Diagnostics;

namespace ComponentTask.Internal
Expand Down Expand Up @@ -43,3 +53,5 @@ runs AFTER scene load and not before should give projects the chance to use thei
}
}
}

#endif // !(ENABLE_MONO && NET_4_6)

0 comments on commit c581a33

Please sign in to comment.