Skip to content

Commit 298fdcc

Browse files
committed
Updated NppPlugin.Host to handle Npp breaking change when the aditor tries to load both, file from the plugins root dll and from the subdirectory named the same way as the root dll.
1 parent c4fab56 commit 298fdcc

File tree

5 files changed

+16
-3
lines changed

5 files changed

+16
-3
lines changed

src/NppPlugin.Host/PluginInfrastructure/PluginProxy.cs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,25 @@ public static void beNotified(IntPtr notifyCode)
4444
plugin.beNotified(notifyCode);
4545
}
4646

47+
static string ProbeFile(params string[] paths)
48+
{
49+
var file = Path.Combine(paths);
50+
if (File.Exists(file))
51+
return file;
52+
else
53+
return null;
54+
}
55+
4756
public static void Init()
4857
{
4958
string thisAssembly = Assembly.GetExecutingAssembly().Location;
5059
string pluginName = Path.GetFileNameWithoutExtension(Path.GetFileNameWithoutExtension(thisAssembly));
5160

52-
string pluginPath = Path.Combine(Path.GetDirectoryName(thisAssembly), pluginName, pluginName + ".dll");
61+
string baseDir = Path.GetDirectoryName(thisAssembly);
62+
63+
string pluginPath = ProbeFile(baseDir, pluginName + ".asm.dll") ??
64+
ProbeFile(baseDir, pluginName, pluginName + ".dll") ??
65+
ProbeFile(baseDir, pluginName, pluginName + ".asm.dll");
5366

5467
Assembly pluginAssembly = Assembly.LoadFrom(pluginPath);
5568

src/NppPlugin.Host/Properties/AssemblyInfo.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@
3232
// You can specify all the values or you can default the Build and Revision Numbers
3333
// by using the '*' as shown below:
3434
// [assembly: AssemblyVersion("1.0.*")]
35-
[assembly: AssemblyVersion("1.0.0.0")]
36-
[assembly: AssemblyFileVersion("1.0.0.0")]
35+
[assembly: AssemblyVersion("1.0.1.0")]
36+
[assembly: AssemblyFileVersion("1.0.1.0")]
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)