title: Dotfuscator Root Check causes EncoderFallbackException in Xamarin
body: <p>I use PreEmptive Dotfuscator to obfuscate my Xamarin Forms app for Android platform. I was able to build app earlier, but same DotfuscatorConfig.xml started giving exception when I upgraded Windows to 10, VS to 2019 and used latest version of Dotfucator Community version.</p>
  <p><strong>I am able to build successfully if I remove Root Check from DotfuscatorConfig.xml file.</strong></p>
  <p>Below is the VS output with Exception details:</p>
  <pre><code>2&gt;  Reflection call 'System.Type System.Type::GetType(System.String)' inside 'System.Boolean PreEmptive.SoS.Runtime.XRFinder::XRFind()' was detected with type name `䌏欑朓戕紗眙㈛嬝丟吡䴣吥䜧䐩䄫䬭帯䘱` which can't be resolved. (TaskId:285)
  2&gt;  Reflection call 'System.Reflection.MethodInfo System.Type::GetMethod(System.String,System.Type[])' inside 'System.Boolean PreEmptive.SoS.Runtime.XRFinder::XRFind()' does not use detectable instance type extraction (TaskId:285)
  2&gt;  Reflection call 'System.Type System.Type::GetType(System.String)' inside 'System.Boolean PreEmptive.SoS.Runtime.XRFinder::XRFind()' was detected with type name `䌏欑朓戕紗眙㈛圝漟డ琣䜥尧䈩` which can't be resolved. (TaskId:285)
  2&gt;  Reflection call 'System.Reflection.MethodInfo System.Type::GetMethod(System.String,System.Type[])' inside 'System.Boolean PreEmptive.SoS.Runtime.XRFinder::XRFind()' does not use detectable instance type extraction (TaskId:285)
  2&gt;  Reflection call 'System.Type System.Type::GetType(System.String)' inside 'System.Boolean PreEmptive.SoS.Runtime.XRFinder::XRFind()' was detected with type name `䌏欑朓戕紗眙㈛圝漟డ戣伥䐧伩` which can't be resolved. (TaskId:285)
  2&gt;  Reflection call 'System.Reflection.MethodInfo System.Type::GetMethod(System.String,System.Reflection.BindingFlags)' inside 'System.Boolean PreEmptive.SoS.Runtime.XRFinder::XRFind()' does not use detectable instance type extraction (TaskId:285)
  2&gt;MSBUILD : error MSB4166: Child node &quot;2&quot; exited prematurely. Shutting down. Diagnostic information may be found in files in &quot;C:\Users\WinUser\AppData\Local\Temp\&quot; and will be named MSBuild_*.failure.txt. This location can be changed by setting the MSBUILDDEBUGPATH environment variable to a different directory.
  2&gt;MSBUILD : error MSB4166: C:\Users\WinUser\AppData\Local\Temp\MSBuild_pid-1412_8a13e9d544e74c94b378a56e64d81b58.failure.txt:
  2&gt;MSBUILD : error MSB4166: UNHANDLED EXCEPTIONS FROM PROCESS 1412:
  2&gt;MSBUILD : error MSB4166: =====================
  2&gt;MSBUILD : error MSB4166: 7/9/2020 11:46:12 AM
  2&gt;MSBUILD : error MSB4166: System.Text.EncoderFallbackException: Unable to translate Unicode character \uDDA3 at index 235 to specified code page.
  2&gt;MSBUILD : error MSB4166:    at System.Text.EncoderExceptionFallbackBuffer.Fallback(Char charUnknown, Int32 index)
  2&gt;MSBUILD : error MSB4166:    at System.Text.EncoderFallbackBuffer.InternalFallback(Char ch, Char*&amp; chars)
  2&gt;MSBUILD : error MSB4166:    at System.Text.UTF8Encoding.GetByteCount(Char* chars, Int32 count, EncoderNLS baseEncoder)
  2&gt;MSBUILD : error MSB4166:    at System.Text.UTF8Encoding.GetByteCount(String chars)
  2&gt;MSBUILD : error MSB4166:    at System.IO.BinaryWriter.Write(String value)
  2&gt;MSBUILD : error MSB4166:    at Microsoft.Build.Framework.BuildEventArgs.WriteToStream(BinaryWriter writer)
  2&gt;MSBUILD : error MSB4166:    at Microsoft.Build.Framework.LazyFormattedBuildEventArgs.WriteToStream(BinaryWriter writer)
  2&gt;MSBUILD : error MSB4166:    at Microsoft.Build.Framework.BuildMessageEventArgs.WriteToStream(BinaryWriter writer)
  2&gt;MSBUILD : error MSB4166:    at Microsoft.Build.Shared.LogMessagePacketBase.WriteToStream(ITranslator translator)
  2&gt;MSBUILD : error MSB4166:    at Microsoft.Build.Shared.LogMessagePacketBase.Translate(ITranslator translator)
  2&gt;MSBUILD : error MSB4166:    at Microsoft.Build.BackEnd.NodeEndpointOutOfProcBase.RunReadLoop(Stream localReadPipe, Stream localWritePipe, ConcurrentQueue`1 localPacketQueue, AutoResetEvent localPacketAvailable, AutoResetEvent localTerminatePacketPump)
  </code></pre>
  <p>You must notice the Chinese characters in the initial logs - I wonder if it is the cause of the issue.</p>