There is a project from Github https://github.com/versex799/FanucFocasTutorial which is qritten on c# .NET framework 4.7.1. Works ok. Trying to make the same on .NET 6.0 I get an error "System.BadImageFormatException: "An attempt was made to load a program with an incorrect format. (0x8007000B)" This error occurs when the program calls method Focas1.cnc_allclibhndl3("192.168.0.1", 8193, 6, out _handle); This method is described in fwlib32.cs .
It seems that some code in the fwlib32.dll which is calles by fwlib32.cs isn't supported or some sintaxis of fwlib32.cs is old for .NET 6.0 though there are no visible errors.