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.
(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.
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)