Skip to content

Commit 7ec06ab

Browse files
authored
Update PluginDiscovery.cs
1 parent eae685e commit 7ec06ab

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Confuser.Core/PluginDiscovery.cs

+4-3
Original file line numberDiff line numberDiff line change
@@ -98,24 +98,25 @@ protected virtual void GetPluginsInternal(
9898
ConfuserContext context, IList<Protection> protections,
9999
IList<Packer> packers, IList<ConfuserComponent> components) {
100100
protections.Add(new WatermarkingProtection());
101+
var currentAssemblyLocation = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
101102
try {
102-
Assembly protAsm = Assembly.Load("Confuser.Protections");
103+
Assembly protAsm = Assembly.LoadFrom($"{currentAssemblyLocation}/Confuser.Protections.dll");
103104
AddPlugins(context, protections, packers, components, protAsm);
104105
}
105106
catch (Exception ex) {
106107
context.Logger.WarnException("Failed to load built-in protections.", ex);
107108
}
108109

109110
try {
110-
Assembly renameAsm = Assembly.Load("Confuser.Renamer");
111+
Assembly renameAsm = Assembly.LoadFrom($"{currentAssemblyLocation}/Confuser.Renamer.dll");
111112
AddPlugins(context, protections, packers, components, renameAsm);
112113
}
113114
catch (Exception ex) {
114115
context.Logger.WarnException("Failed to load renamer.", ex);
115116
}
116117

117118
try {
118-
Assembly renameAsm = Assembly.Load("Confuser.DynCipher");
119+
Assembly renameAsm = Assembly.LoadFrom($"{currentAssemblyLocation}/Confuser.DynCipher.dll");
119120
AddPlugins(context, protections, packers, components, renameAsm);
120121
}
121122
catch (Exception ex) {

0 commit comments

Comments
 (0)