I am working with an existing VB application that allows plugins to be imported as DLLs on Windows 11. I am told that the language used to create the DLL plugin does not matter.
I am a fan of GoLang and so I tried to create a very simple DLL to see if I could import it as a plugin.
The GoLang DLL looks like this:
package main
import "C"
import "fmt"
//export Hello
func Hello() {
fmt.Println("Hello from DLL!")
}
func main() {}
The compilation command I use is this:
go -o mydll.dll -buildmode=c-shared
However, when I try to load the plugin into the VB app, I get this error:
.NET DLL Exception: Could not load file or assembly 'file:///C:testingmydll.dll' or one of its dependencies. The module was expected to contain an assembly manifest. UM DLL Exception: ImageRvaToVa (NamesPointer) failed
I have not found any solutions to this so far on Google. How can I use my GoLang DLL with the VB app?
I was expecting to load my GoLang DLL into the VB app as a plugin.
UPDATE:
Interestingly using mt.exe seems to do nothing. It does not change the size or modification time of the dll:
> .mt.exe -manifest "App.config" -outputresource:"mydll.dll"
> .mt.exe -inputresource:"mydll.dll" -out:"my.extracted.manifest"
5