示例#1
0
 public bool CanInstrument()
 {
     try
     {
         if (InstrumentationHelper.HasPdb(_module, out bool embeddedPdb))
         {
             if (embeddedPdb)
             {
                 if (InstrumentationHelper.EmbeddedPortablePdbHasLocalSource(_module))
                 {
                     return(true);
                 }
                 else
                 {
                     _logger.LogWarning($"Unable to instrument module: {_module}, embedded pdb without local source files");
                     return(false);
                 }
             }
             else
             {
                 return(true);
             }
         }
         else
         {
             return(false);
         }
     }
     catch (Exception ex)
     {
         _logger.LogWarning($"Unable to instrument module: '{_module}' because : {ex.Message}");
         return(false);
     }
 }