I am making a plugin which requires another dll (both written in C#).
However, it seems that just putting the two dll together inside "Plugins" folder is not the solution. It gives error on dll not found. Anyone knows the solution?
Could not load file or assembly 'xxxxxx, Version=...' or one of its dependencies. The system cannot find the file specified.
Thanks and regards,
I'm not very good with these sort of things but I'm reasonably sure the extra dll has to be in the same folder as n++.
I take it you're using the c# template or something because I really don't think n++ can use regular c# dlls. If you weren't I don't think you'd be getting that error.
The default location that N++ seems to search for the second dll is in the N++ install directory. I am using the NppPlugin.NET.v0.6 template and had the same issue. I added the following code to the UnmanagedExports class in the UnamanagedExports.cs and it solved my issue.
AppDomain.CurrentDomain.AssemblyResolve += OnCurrentDomainAssemblyResolve;
static Assembly OnCurrentDomainAssemblyResolve(object sender, ResolveEventArgs args)
if (args.Name.Contains("<NAME OF="" DLL="" TO="" BE="" LOADED="">"))
var location = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
return Assembly.LoadFile(Path.Combine(location, @"<RELATIVE PATH TO DLL TO BE LOADED"));
The "NAME OF DLL TO BE LOADED" should not contain the extension. The relative path starts from the plugins folder of N++. I.e. if your 2nd dll is in the plugins folder then it would be "2nd.dll", but if you have a folder within the plugins that contains your 2nd dll, then it would be "FolderName\2nd.dll"
Hope this helps.
Disclaimer: I am very much a beginner at programming in C++ and C# myself, but the above is working flawlessly for my plugin.
Yeah!!! it works!!! Thank you so much :D
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.