New in .NET 10.0 [19]: Converting file-based apps to C# projects

Upgrading a file-based app to a regular C# project is possible.

listen Print view
Street sign with C#

(Image: Pincasso / Shutterstock.com)

1 min. read
By
  • Dr. Holger Schwichtenberg

Directly translating and running C# files is called file-based apps by Microsoft. If requirements grow, file-based apps are not a dead end.

The Dotnet Doctor – Holger Schwichtenberg
Der Dotnet-Doktor – Holger Schwichtenberg

Dr. Holger Schwichtenberg is the technical director of the expert network www.IT-Visions.de, which supports numerous medium-sized and large companies with consulting and training services as well as software development, drawing on the expertise of 53 renowned experts. Thanks to his appearances at numerous national and international conferences, as well as more than 90 specialist books and over 1,500 specialist articles, Holger Schwichtenberg is one of the best-known experts for .NET and web technologies in Germany.

Developers can convert a file-based app into a C# project with a .csproj project file using a command-line command:

dotnet project convert .\Filename.cs

Converting a standalone C# script file into a C# project (Fig. 1)

Videos by heise

This creates a new folder and a project file that adopts the preprocessor information from the C# file.

However, if the files Filename.settings.json and Filename.run.json exist, they are ignored during conversion.

The individual C# file becomes a C# project (Fig. 2).

(mki)

Don't miss any news – follow us on Facebook, LinkedIn or Mastodon.

This article was originally published in German. It was translated with technical assistance and editorially reviewed before publication.