Is there any way to get ServiceHost Class and its dependencies in .net6?
You can't do it. From the ServiceHost Class, we can see this class is part of the System.ServiceModel
namespace that is not supported by .NET Core, just applies to .Net Framework application.
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.
Best regards,
Dillion