Hi all, I am using a 3rd party .net assembly which for some reason writes to System.Diagnostics.Debug.WriteLine and I can’t tell it to stop doing that. The webplayer throws exceptions about Method not found: ‘System.Diagnostics.Debug.WriteLine’
I have tried to use a C# extension method to quiet the error, but it’s not working. Any suggestions for how to suppress this or workaround this? Just want to make sure I am not overlooking something easy, before I go dig into the source code of the 3rd party dll
// this doesn't suppress the webplayer error
public static class DiagnosticsDebugExtensions {
public static void WriteLine( this System.Diagnostics.Debug debug, string msg ) { Debug.Log(msg); }
}
This is rather awkward, as System.Diagnostics.Debug.WriteLine is marked with ConditionalAttribute and should not be included in any release build of .NET assembly. Are you using 3rd party debug assembly?
Thanks Dmitry- on your suggestion I got the TeamDev.Redis source, built it with VS and then grabbed the Release .dll and no more exceptions. I guess they had inadvertently linked to a debug build of the client on their website.
to whoever in the future has the same issue: i had the same problem, but recompiling was not enough, had to get the code for TeamDev.Redis, go inside, find the 2 lines of Debug.WriteLine that are there (they used a log wrapper function, luckily) comment them and then recompile. No more issues!