I have created a basic class that adds two numbers in c#. I have built it into a dll but when attempting to call it in golang I am unsuccessful.
Is this possible currently in golang? If so can someone provide a example how to do this?
Edit: I have included the last attempt I made at doing this. The C# dll is simply a method that adds the two numbers that are passed in.
package main
import (
"fmt"
"syscall"
)
func main() {
var mod = syscall.NewLazyDLL("MathForGo.dll")
var proc = mod.NewProc("Add");
proc.Call(2,3);
fmt.Printf("%v",proc)
}
There is a project on Github that aims to do this.
https://github.com/matiasinsaurralde/go-dotnet
C# assemblies are not the same as C or C++ and will not load using syscall like we might want.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With