Unable to run PrintTicket example in .NET 6 console app

Nicholas Piazza 536 Reputation points
2022-01-08T19:38:46.073+00:00

I am trying to run the example shown in the Microsoft Windows Desktop 6 System.Printing documentation (URL: https://learn.microsoft.com/en-us/dotnet/api/system.printing.printticket?view=windowsdesktop-6.0) in a .NET 6 console application in Visual Studio 2022. In the Dependencies, I was able to add System.Printing.dll, ReachFramework.dll, and WindowsBase.dll. However, now when I run the app, it returns an exception: 163392-dllexception.png

as shown in the attachment. I tried adding Presentationnative_cor3.dll to the dependency references, but I get the message "The reference is invalid or unsupported". Is there any way to run this example in .NET 6?

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.
10,364 questions
0 comments No comments
{count} votes

0 additional answers

Sort by: Most helpful