Microsoft POS for .NET | System.Diagnostics.EventLog.dll Not Found

Obada Ahmad AlAasasi 0 Reputation points
2024-01-17T07:54:14.74+00:00

I'm creating a (.NET 6) console application in Visual Studio 2022, to test communicating with a Zebra ZT230 industrial label printer using its OPOS drivers. the drivers require Microsoft POS for .NET v1.14 and .NET framework v4.8 for it to work properly. I have made sure that both are installed on my machine (.NET framework 4.8 advanced services are enabled in Windows features.)

the snippet in my code which is supposed to open the device calls the constructor of the PosExplorer class in the MS POS assembly. which returns the following error:



the assembly referenced the error cannot be found in the DLL folder of .NET 6 :
C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\6.0.20\ref\net6.0 i also cannot find it in the folder for the .NET framework:
C:\Windows\Microsoft.NET\Framework64\v4.0.30319
*
I have also tried including/referencing all other System.Diagnostics DLLs from both directories above, but nothing worked.

*
What might cause this issue? given that the POS assembly is compatible with .NET 4 and above.Screenshot 2024-01-15 181833

.NET
.NET
Microsoft Technologies based on the .NET software framework.
4,108 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
11,306 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Jiale Xue - MSFT 48,966 Reputation points Microsoft Vendor
    2024-01-17T09:31:52.4433333+00:00

    Hi @Obada Ahmad AlAasasi , Welcome to Microsoft Q&A,

    Judging from the error message, it seems that you have encountered the problem that the "System.Diagnostics.EventLog.dll" assembly cannot be found in the specified directory. The "PosExplorer" class you are using probably depends on this assembly.

    Make sure you reference the "System.Diagnostics.EventLog.dll" assembly in your project. In Visual Studio, right-click your project, select Add->Reference, and check that the necessary assembly is included. Set the "Copy Local" property of the "System.Diagnostics.EventLog.dll" reference to "True". This ensures that the DLL is copied to the project's output directory during the build.

    You also can refer to Event Handler Sample (POS for .NET v1.14 SDK Documentation)

    Best Regards,

    Jiale


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment". 

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.