I have external dll which I want to include to project. I cannot add this dll as standard library (it is c++ dll).
I am using DllImport for external dll.
[DllImport("MyExternal.dll")]
public static extern UInt32 Authent([Out] UInt32[] LibRandNum);
This is working if I include dll in main project:
"publishOptions": {
"include": [
"MyExternal.dll"
]
}
But it is not working in class libaray (same publish option in class library project.json file).
If I add dll to "C:\windows\system32" than it is working. But I do not want to assume that dll exist, I want to add dll from project library.
edit 1:
I found "How to use native dependencies", but still not working. I don't know how to do it with nuget package, but I would like to avoid nuget if possible.
edit 2:
Something like this, but in Core class library.
edit 3
I have tried:
"copyToOutput": {
"include": [ "MyExternal.dll" ]
}
Still without success.
edit 4
I created minimal solution (.NET core - visual studio 2015). You can get here : http://www.filedropper.com/myapp_1
There is dll file in class library (SGLW64.dll)
If you add this dll to C:\Windows\System32 than it is working.