Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion BepInEx.Core/Bootstrap/BaseChainloader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@

namespace BepInEx.Bootstrap;

public abstract class BaseChainloader<TPlugin>

Check warning on line 15 in BepInEx.Core/Bootstrap/BaseChainloader.cs

View workflow job for this annotation

GitHub Actions / build

Missing XML comment for publicly visible type or member 'BaseChainloader<TPlugin>'

Check warning on line 15 in BepInEx.Core/Bootstrap/BaseChainloader.cs

View workflow job for this annotation

GitHub Actions / build

Missing XML comment for publicly visible type or member 'BaseChainloader<TPlugin>'
{
protected static readonly string CurrentAssemblyName = Assembly.GetExecutingAssembly().GetName().Name;

Check warning on line 17 in BepInEx.Core/Bootstrap/BaseChainloader.cs

View workflow job for this annotation

GitHub Actions / build

Missing XML comment for publicly visible type or member 'BaseChainloader<TPlugin>.CurrentAssemblyName'

Check warning on line 17 in BepInEx.Core/Bootstrap/BaseChainloader.cs

View workflow job for this annotation

GitHub Actions / build

Missing XML comment for publicly visible type or member 'BaseChainloader<TPlugin>.CurrentAssemblyName'
protected static readonly Version CurrentAssemblyVersion = Assembly.GetExecutingAssembly().GetName().Version;

Check warning on line 18 in BepInEx.Core/Bootstrap/BaseChainloader.cs

View workflow job for this annotation

GitHub Actions / build

Missing XML comment for publicly visible type or member 'BaseChainloader<TPlugin>.CurrentAssemblyVersion'

Check warning on line 18 in BepInEx.Core/Bootstrap/BaseChainloader.cs

View workflow job for this annotation

GitHub Actions / build

Missing XML comment for publicly visible type or member 'BaseChainloader<TPlugin>.CurrentAssemblyVersion'
private static readonly Dictionary<string, bool> RefCache = new();
private static Regex allowedGuidRegex { get; } = new(@"^[a-zA-Z0-9\._\-]+$");

Expand Down Expand Up @@ -101,13 +101,23 @@

foreach (var r in ass.MainModule.AssemblyReferences)
{
var dep = ass.MainModule.AssemblyResolver.Resolve(r);
AssemblyDefinition dep;
try
{
dep = ass.MainModule.AssemblyResolver.Resolve(r);
}
catch (AssemblyResolutionException ex)
{
// Dependency can't be resolved (e.g. framework facade like System.IO.Ports pulled in transitively via legacy libs). It can't reference this assembly, so skip the branch instead of failing discovery.
Logger.Log(LogLevel.Debug, $"Skipping unresolvable assembly reference '{r.FullName}' while checking '{ass.Name.FullName}': {ex.Message}");
continue;
}
if (dep != null && ReferencesThisAssembly(dep, seen))
return RefCache[key] = true;
}
return RefCache[key] = false;
}
protected static bool HasBepinPlugins(AssemblyDefinition ass)

Check warning on line 120 in BepInEx.Core/Bootstrap/BaseChainloader.cs

View workflow job for this annotation

GitHub Actions / build

Missing XML comment for publicly visible type or member 'BaseChainloader<TPlugin>.HasBepinPlugins(AssemblyDefinition)'

Check warning on line 120 in BepInEx.Core/Bootstrap/BaseChainloader.cs

View workflow job for this annotation

GitHub Actions / build

Missing XML comment for publicly visible type or member 'BaseChainloader<TPlugin>.HasBepinPlugins(AssemblyDefinition)'
{
if (!ReferencesThisAssembly(ass))
return false;
Expand Down
Loading