C
C#9mo ago
armin

❔ Project depended on cvextern.dll EVEN with resource embeding

In my dotnet project, i use Emgu cv, specifically Emgu cv runtime windows, I also use costura fody to embed everything in the executable and i do: dotnet publish --singleFile=true However there is still a dll file called "cvextern.dll" on which the project depends on (it says: The type initializer for 'Emgu.CV.Util.VectorOfInt' threw an exception." when i try to use VideoCapture (I dont think it is releveant, because I am just trying to embed this dll file into the executable, it's the only one that is left. My question is how to achieve this, I tried to use Costura Fody and also resources embeder, I also tried to add the dll file as project reference, but it threw the error: "The reference is invalid or unsupported." I am not sure but I think the only option to embed it, is to edit the FodyWeavers.xml file, but I am pretty sure that "cvextern.dll" is only located in my publish folder. I am in a desperate situation and would really appreciate ANY help.
No description
8 Replies
Jimmacle
Jimmacle9mo ago
is cvextern.dll .NET assembly or a native library?
armin
armin9mo ago
I'm not quite sure but i think native library (it comes from a nuget package)
Jimmacle
Jimmacle9mo ago
yeah, that can't be merged into a single assembly the way that PublishSingleFile and fody work because it's not .NET code side note, i'm pretty sure you don't need both single file publishing and fody unless you're doing something i missed
armin
armin9mo ago
I know that it is possible, I just dont know how to achieve it, I was able to put plenty of dll files embeded into the executable with fody. I need fody and single file, however, this is not the point of the conversation
Accord
Accord9mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
armin
armin9mo ago
no @Jimmacle
Jimmacle
Jimmacle9mo ago
the only way i've successfully done this is making the native library an embedded resource and extracting it at runtime if there's a better solution i'm not aware of it
Accord
Accord9mo ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.