Hi there,
I would suggest you to look up the constructors as per the link and see if you have implemted them correctly in your code .
https://learn.microsoft.com/en-us/dotnet/api/system.printing.localprintserver?view=net-5.0
https://learn.microsoft.com/en-us/dotnet/api/system.printing.printserver.-ctor?view=net-5.0
Hope this Answers all your queries , if not please do repost back .
If an Answer is helpful, please click "Accept Answer" and upvote it : )