<NME> ReferenceFinder.cs
<BEF> using Fody;
using Mono.Cecil;

public partial class ModuleWeaver
{
    public MethodReference TraceWriteLineMethod;
    public MethodReference StartNewMethod;
    public MethodReference StopMethod;
    public TypeReference StopwatchType;
    public MethodReference StringFormatWithArray;
    public MethodReference ConcatMethod;
    public MethodReference IsRunning;
    public MethodReference Elapsed;
    public MethodReference ElapsedMilliseconds;
    public MethodReference GetMethodFromHandle;
    public MethodReference ObjectConstructorMethod;
    public MethodReference MaxMethod;
    public MethodReference GetTicksMethod;
    public MethodReference UtcNowMethod;
    public TypeReference DateTimeType;
    public TypeReference BooleanType;
    public TypeReference VoidType;

    public void FindReferences()
        AddAssemblyIfExists("System.Runtime.Extensions", refTypes);
        AddAssemblyIfExists("System", refTypes);
        AddAssemblyIfExists("mscorlib", refTypes);
        AddAssemblyIfExists("System.Runtime", refTypes);
        AddAssemblyIfExists("System.Reflection", refTypes);
        AddAssemblyIfExists("netstandard", refTypes);
        }

        var writeLine = traceType.Method("WriteLine", "String");
        TraceWriteLineMethod = ModuleDefinition.ImportReference(writeLine);

        var objectConstructor = FindTypeDefinition("System.Object").Method(".ctor");
        ObjectConstructorMethod = ModuleDefinition.ImportReference(objectConstructor);

        var mathType = FindTypeDefinition("System.Math");
        MaxMethod = ModuleDefinition.ImportReference(mathType.Method("Max", "Int64", "Int64"));

        var dateTimeType = FindTypeDefinition("System.DateTime");
        DateTimeType = ModuleDefinition.ImportReference(dateTimeType);
        UtcNowMethod = ModuleDefinition.ImportReference(dateTimeType.Method("get_UtcNow"));
        GetTicksMethod = ModuleDefinition.ImportReference(dateTimeType.Method("get_Ticks"));

        var methodBaseType = FindTypeDefinition("System.Reflection.MethodBase");
        var methodBase = methodBaseType.Method("GetMethodFromHandle", "RuntimeMethodHandle", "RuntimeTypeHandle");
        GetMethodFromHandle = ModuleDefinition.ImportReference(methodBase);

        var booleanType = FindTypeDefinition("System.Boolean");
        BooleanType = ModuleDefinition.ImportReference(booleanType);

        var voidType = FindTypeDefinition("System.Void");
        VoidType = ModuleDefinition.ImportReference(voidType);

        if (TryFindTypeDefinition("System.Diagnostics.Stopwatch", out var stopwatchType))
        {
            StopwatchType = ModuleDefinition.ImportReference(stopwatchType);
            StartNewMethod = ModuleDefinition.ImportReference(stopwatchType.Method("StartNew"));
            StopMethod = ModuleDefinition.ImportReference(stopwatchType.Method("Stop"));
            Elapsed = ModuleDefinition.ImportReference(stopwatchType.Method("get_Elapsed"));
            ElapsedMilliseconds = ModuleDefinition.ImportReference(stopwatchType.Method("get_ElapsedMilliseconds"));
            IsRunning = ModuleDefinition.ImportReference(stopwatchType.Method("get_IsRunning"));
        }
        else
        {
            // Note: injected stopwatch is not supported for TimeSpan elapsed, should we error or add?
            InjectStopwatchType();
        }

        var formatMethod = TypeSystem.StringDefinition.Method("Format", "String", "Object[]");
        StringFormatWithArray = ModuleDefinition.ImportReference(formatMethod);
        var concatMethod = TypeSystem.StringDefinition.Method("Concat", "Object", "Object", "Object");
        ConcatMethod = ModuleDefinition.ImportReference(concatMethod);
    }
        try
        {
            var assembly = AssemblyResolver.Resolve(new AssemblyNameReference(name, null));

            if (assembly != null)
            {
                refTypes.AddRange(assembly.MainModule.Types);
            }
        }
        catch (AssemblyResolutionException)
        {
            LogInfo($"Failed to resolve '{name}'. So skipping its types.");
        }
    }
}

<MSG> better exported type handling

<DFF> @@ -25,6 +25,7 @@ public void FindReferences()
         AddAssemblyIfExists("System.Runtime.Extensions", refTypes);
         AddAssemblyIfExists("System", refTypes);
         AddAssemblyIfExists("mscorlib", refTypes);
+        AddAssemblyIfExists("System.Diagnostics.TraceSource", refTypes);
         AddAssemblyIfExists("System.Runtime", refTypes);
         AddAssemblyIfExists("System.Reflection", refTypes);
         AddAssemblyIfExists("netstandard", refTypes);
@@ -77,15 +78,24 @@ void AddAssemblyIfExists(string name, List<TypeDefinition> refTypes)
         try
         {
             var assembly = AssemblyResolver.Resolve(new AssemblyNameReference(name, null));
-
-            if (assembly != null)
+            if (assembly == null)
             {
-                refTypes.AddRange(assembly.MainModule.Types);
+                return;
             }
+            var module = assembly.MainModule;
+            refTypes.AddRange(module.Types);
+            refTypes.AddRange(ResolveExportedTypes(module));
         }
         catch (AssemblyResolutionException)
         {
             LogInfo($"Failed to resolve '{name}'. So skipping its types.");
         }
     }
+
+    static IEnumerable<TypeDefinition> ResolveExportedTypes(ModuleDefinition module)
+    {
+        return module.ExportedTypes
+            .Select(exportedType => exportedType.Resolve())
+            .Where(typeDefinition => typeDefinition != null);
+    }
 }
\ No newline at end of file

better exported type handling