title: How to make a C# Windows Service that connect to a WebSocket?
body: <p>I'm new to Windows development, coming from macOS and iOS development.</p>
  
  <p>I'm trying to port a Mac software I've made to Windows.</p>
  
  <p>To do that, I need to write a Windows Service that will start with Windows and will be in charge to maintain a WebSocket connection to my server. It's basically an custom push notification service. </p>
  
  <p>On demand from the server, the service will start an update mechanism of a local database that will be read by another app later. It need to be on the system side, not the user side, since the product goal is to somehow manage some system features.</p>
  
  <p>I've started with the <code>Windows Service</code> project template in C# and then tried to add what I found to be the way to support WebSocket, with <code>Windows.Networking.Sockets.MessageWebSocket</code>.</p>
  
  <p>However, this generate an error: <code>The type or namespace name 'Windows' could not be found (are you missing a using directive or an assembly reference?)</code> for the line <code>using Windows.Networking.Sockets;</code>.</p>
  
  <p>After few google work, I've might understood that <code>Windows.Networking.Sockets</code> might not be accessible from <code>Windows Service</code> template.</p>
  
  <p>Since I'm not sure I'm here to ask what's the starting point here to achieve such a goal. Why did I get this error? If it's a project misconfiguration, what's the fix? If I can't use this API for a service, what's the options I have?</p>
  
  <p>Thanks</p>