ASP.NET Hosting

ASP.NET Tutorial: How to Change a Created Class Library to Console Application?

This blog talksĀ about how to change a created class library with a Console application in .net core. First, open a class library project in Visual Studio.

Step 1

  • Right-click on the project from inside Visual Studio.
  • Then click the properties option.

Step 2

  • Change Class library selection to Console Application in Application > General > Output type.
  • Then, save the changes and build the project.

Step 3

  • Create a Program.cs file inside the project and add a Main(string[] args) inside a Program Class.
  • Then, add a required function inside and execute a Console application.

The above-mentioned step is one way to handle this case. One more way is there to change a created class library with the Console application from the .csproj file.

  • Edit the file .csproj <PropertyGroup><OutputType>Library</OutputType></PropertyGroup> Change “Library” to “Exe” to make it a console application.
  • Save the .csproj file and close it.
  • Then, add the Main function inside Program.cs and build the project.

.csproj

<PropertyGroup>
   <IncludeSymbols>true</IncludeSymbols>
   <SymbolPackageFormat>snupkg</SymbolPackageFormat>
   <OutputType>Exe</OutputType>
</PropertyGroup>

ASP.NET Core 9 Hosting Recommendation

HostForLIFE.eu
HostForLIFE.eu is a popular recommendation that offers various hosting choices. Starting from shared hosting to dedicated servers, you will find options fit for beginners and popular websites. It offers various hosting choices if you want to scale up. Also, you get flexible billing plans where you can choose to purchase a subscription even for one or six months.