How to write C# based Azure Container without starting a Web

Leonard Bernstein 45 Reputation points
2024-05-15T15:32:06.1+00:00

Hi all. I need to write an app that connects to a third-party vendor application via a Web Socket. I am using C# in Visual Studio 2022 to write my app. I have it running in my Visual Studio locally.

My question: how do I suppress the website window from popping up? My app does not need Web Site to be up and running. It is supposed to run all day long listening to a third-party vendor application for changes.

My main looks like this (for now I am using thread sleep to keep app from existing) - but still browser keeps popping up on the app startup - docker must be doing something.

public static void Main(string[] args)

{

VendorSocketSession vendor = new VendorSocketSession();

vendor.Run();
```   while (true) {

```sql
   Thread.Sleep(1000);

}
```}
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,389 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 57,891 Reputation points
    2024-05-17T15:21:11.23+00:00

    Visual studio is launching the browser because it assumes you are debugging a website. Just edit the launch settings.

    0 comments No comments