I am developing a windows app using WinUI and .net framework 6.0. For integrating with a pos printer , i am using Pos For .Net Framework. Sample print applications provided with Epson OPOS ADK for .net is verified working . But when i try to use this from a WinUI3 page , i am getting exception
FileNotFoundException: Could not load file or assembly 'System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'. The system cannot find the file specified.
I tried adding the reference to Forms dll and its throwing error related to version 4.0.0. Also i tried enabling forms from project properties (https://learn.microsoft.com/en-us/dotnet/core/project-sdk/msbuild-props-desktop#usewindowsforms) . This was also causing additional errors related to PresentationCore and PresentationFramework dlls. Is there any reference for doing OPOS integration from a WinUI3 project ?
I took a look at Epson OPOS ADK download page and it seems that it supports .NET Framework 4.0 or later, but doesn't support .NET 6 or later which is required for WinUI 3.
I have never tried this but I guess you should try wrapping the Epson OPOS ADK with a .NET Standard 2.0 project. It's suppose to work.