The used approach only worked in debug builds. `InlineableStringResource` is not one of the nodes that survives from scanning phase to compilation phase. Make the compiler think `GetResourceString` was reflected on instead.
&& InlineableStringsResourceNode.IsInlineableStringsResource(module, resName + ".resources"))
{
dependencies ??= new DependencyList();
- dependencies.Add(factory.InlineableStringResource(module), "EventSource used resource");
+ var accessorMethod = module.GetType(
+ InlineableStringsResourceNode.ResourceAccessorTypeNamespace,
+ InlineableStringsResourceNode.ResourceAccessorTypeName)
+ .GetMethod(InlineableStringsResourceNode.ResourceAccessorGetStringMethodName, null);
+ dependencies.Add(factory.ReflectedMethod(accessorMethod), "EventSource used resource");
}
}
}