简体   繁体   中英

Class library or Console Application?

I am trying to create a client on my c# application which will be listening to a server. Can I create a class library project and deploy on Azure (AKS). Or would I need to create a windows exe/console project or something?

What is recommended? New to c#

Class library

https://learn.microsoft.com/en-us/do.net/standard/class-libraries#:~:text=Class%20libraries%20are%20the%20shared,not%20known%20at%20application%20startup .

Class libraries are the shared library concept for .NET. They enable you to componentize useful functionality into modules that can be used by multiple applications. They can also be used as a means of loading functionality that is not needed or not known at application startup. Class libraries are described using the .NET Assembly file format.

In short, you cannot run the class library but you can export a dll from it and import that to other projects as a dependency.

Console application

An application that takes input and displays output at a command line with access to three basic data streams: standard input, standard output and standard error

Console application is a runnable application and it can be deployed to Azure as a WebJob ( https://learn.microsoft.com/en-us/azure/app-service/webjobs-do.net-deploy-vs ).

Hopefully, my answer is good for you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM