About use dll file in plugin. EXE can't find dll

I build a dll file in Visual Studio. effect is very simple, just for test.
so… I create a new plugin in UE4.26

<*.Build.cs> like this:
PublicDelayLoadDLLs.Add(Path.Combine(“file path”, “dll name”));
RuntimeDependencies.Add(Path.Combine(“file path”, “dll name”), StagedFileType.NonUFS);

it’s work! in editor.
now I build windows package.
packaging success.

I see that file:
WindowsNoEditor&lt;project name>\Plugins… xxxx.dll
export finished

but if run EXE, will “Unable to locate program input point in xxxxxxxxxx”
if copy dll file to exe directory or “C:\Windows\System32”, It’s OK.

What’s missing in *.build.cs ?
What else anything else ?

I’d also try to put dll in the same directory as executable, but not sure that it will help

it’s work.
just I want to auto complete.

I even do this:
in *.build.cs

File.Copy(“plugin dll file”, “project->Binaries\Win64”, true); //plugin file copy to <Binaries\Win64>
RuntimeDependencies.Add(“project->Binaries\Win64”, StagedFileType.SystemNonUFS); // will copy to <WindowsNoEditor est\Binaries\Win64> in packaging complete

but, the file is locked or in use by another process.

ERROR: Unable to instantiate module ‘MyPlugin’: System.IO.IOException: file “D:\bfdata\mydev\TestPlugin\Plugins\MyPlugin…/…/Binaries/Win64\UEModel.dll”

OK, I get it.
If create new plugin have “Third Party Library”

I just don’t understand, Why have two plugin module.

I’ve been trying before combine

I can install my dlls correctly (editor and packaged) using

RuntimeDependencies.Add("$(BinaryOutputDir)/mylibrary.dll", Path.Combine(librariesPath, "mylibrary.dll"));

1 Like

This is the only solution that worked after trying for hours to solve UE not find the dll’s I am using with my plugin