Zum Hauptinhalt springen
tsecurity.de LIVE
Echtzeit-Radar & Feeds
Alle RSS Feeds
👥 Community & Social
YouTube Security VideosGoogle Cloud Tech: Gemini is coming to your city(24.09.2026 um 15:00 Uhr)
AI & KI NachrichtenGoogle’s latest moonshot to put machine learning in space(24.09.2026 um 15:12 Uhr)
Windows Tipps & SecurityPoll: What's your favorite Surface of 2026?(24.09.2026 um 14:58 Uhr)
Sichere ProgrammierungStreaming Materialized Views for Live Read Models (2026)(24.09.2026 um 15:02 Uhr)
Sichere ProgrammierungA Day Is Not 86400 Seconds: The DST Bug in Your Date Math(24.09.2026 um 15:02 Uhr)
Sichere ProgrammierungSetting up Traefik: reverse proxy with automatic HTTPS(24.09.2026 um 15:02 Uhr)
Sichere ProgrammierungA 200 OK response does not prove a secret leak(24.09.2026 um 15:02 Uhr)
Sichere ProgrammierungHow hot do you like it?(24.09.2026 um 15:05 Uhr)
YouTube Security VideosGoogle Cloud Tech: Gemini is coming to your city(24.09.2026 um 15:00 Uhr)
AI & KI NachrichtenGoogle’s latest moonshot to put machine learning in space(24.09.2026 um 15:12 Uhr)
Windows Tipps & SecurityPoll: What's your favorite Surface of 2026?(24.09.2026 um 14:58 Uhr)
Sichere ProgrammierungStreaming Materialized Views for Live Read Models (2026)(24.09.2026 um 15:02 Uhr)
Sichere ProgrammierungA Day Is Not 86400 Seconds: The DST Bug in Your Date Math(24.09.2026 um 15:02 Uhr)
Sichere ProgrammierungSetting up Traefik: reverse proxy with automatic HTTPS(24.09.2026 um 15:02 Uhr)
Sichere ProgrammierungA 200 OK response does not prove a secret leak(24.09.2026 um 15:02 Uhr)
Sichere ProgrammierungHow hot do you like it?(24.09.2026 um 15:05 Uhr)
Intelligence View
⚡ tsecurity.de Intelligence

New File-Based Apps in .NET 10: You Can Now Run C# in Just 1 File!

Hi lovely readers, Sometimes you just need a quick script in the language you are most comfortable with, C# for example, but then you have to go through the hassle of creating a solution with a project and a bunch of extra files you…

0
↗ Quelle (dev.to)
Reagiere als Erste:r — dein Feedback zählt!

Hi lovely readers,



Sometimes you just need a quick script in the language you are most comfortable with, C# for example, but then you have to go through the hassle of creating a solution with a project and a bunch of extra files you probably do not need, just to run ten lines of code. Using C# for a small task has always felt like overkill.



.NET 10 now fixes this with file-based apps. It introduces a new lightweight execution model that lets you run a C# program contained in a single file with no project or solution setup at all.



In this blog post, we are going to take a look at file based apps and how to use them.






Why file-based apps





  1. No project overhead



    Write your C# code in one .cs file and run it directly. That is all you need. There is no .csproj file, no solution, and no boilerplate. This simplicity means you can get started right away when you want to build a quick tool or demo.




  2. Great for prototyping and scripting



    File-based apps are perfect for prototypes, one off console utilities, CI or CD scripts, or quick data processing tasks. Instead of creating a full project for a ten line script, you can just run a single file. It makes C# feel competitive with traditional scripting languages like PowerShell or Bash.




  3. Full power of C# and .NET



    You are still writing a real C# program. You get the strong type system, performance, LINQ, the full .NET libraries, and even NuGet packages. Nothing is limited just because you are using one file.




  4. Full-on CLI support



    This feature is built right into the .NET CLI. No extra tools or interpreters are required. Just run dotnet run <YourFile>.cs and the CLI takes care of the rest. On Unix like systems, you can even add a shebang so you can run your file like a regular script.




  5. Easy to scale up



    A file-based app is not something you will outgrow. If your single file script becomes something larger, the .NET 10 SDK includes a tool that converts it into a full project with a .csproj, keeping your package references and settings.








How to use file-based apps






Create and run a single file program



To get started, all you need is the .NET 10 SDK installed. You can install it from dotnet.microsoft.com. In whatever text editor or IDE you want write your code in a single C# file. You can use top-level statements that were introduced in the past so you don’t need a Main method.



For example, create a file called DiceThrow.cs:




// DiceThrow.cs
var rng = new Random();
int roll = rng.Next(1, 7);
Console.WriteLine($"You rolled a {roll}!");






Then open your terminal in the same folder and run:




dotnet run DiceThrow.cs






The CLI creates a temporary project in the cache, compiles your file, and runs it. The first run takes a moment, but after that it launches almost instantly.






Using NuGet packages with #:package



Sometimes you will need some extra help from a NuGet package. You can add those to your script too. If your script needs a NuGet package, you can add it at the top of your file.



For example, here is a script that uses Figgle to create ASCII art. Save it as ASCIIArt.cs:




#:package Figgle@0.6.5
#:package Figgle.Fonts@0.6.5

using Figgle;
using Figgle.Fonts;

Console.WriteLine(FiggleFonts.Standard.Render("Hello World"));






Terminal with Hello World in ASCII



The version numbers after the at sign are required. If you are not sure which version to use, the NuGet Gallery page shows a ready to copy snippet under the File-Based Apps tab. For example, the Figgle NuGet Gallery page looks like this:



Nuget Gallery page of Figgle with the File-based app tab selected






Running your C# file as a script on Unix



If you like the convenience of running scripts directly, you can add a shebang to the top of your file.




#!/usr/bin/env dotnet run
Console.WriteLine("Hello from shebang!");






Make it executable:




chmod +x Shebang.cs






And finally run it like this:




./Shebang.cs






It feels just like running any other script.






To keep in mind




  • Only one file is supported right now. Multi file support is coming in .NET 11.

  • These are compiled C# programs, not interpreted scripts.

  • You can debug your script in your IDE by opening the file and setting breakpoints.






That is a wrap



File-based apps in .NET 10 make C# feel more flexible and accessible for small tasks. You no longer have to switch to Python or Bash when you want to automate something quickly. Now you can stay in the language you love, with your favorite NuGet packages available right away.



I hope this post helped you understand file-based apps in modern C#. If you have any questions or comments, feel free to reach out on almost every social media platform (louella.dev/socials) or leave a comment down below.



See ya!

CTI Threat Relationship Graph4 Knoten / 3 Relationen
CVE / Incident Software MITRE ATT&CK CWE Weakness IoC
SOC Incident Playbook: Vulnerability Remediation & Verification
title: Detect Exploitation - New File-Based Apps in .NET 10: You Can Now Run C# in Just 1 File!
id: 20664d38-7457-45a2-baee-5a3bd420da23
status: experimental
description: Automatisch generierte SIEM-Erkennungsregel basierend auf CTI Intelligence
references:
  - https://tsecurity.de/
author: iShareStuff CTI Automated Detection Engine
date: 2026-09-24
logsource:
  category: network_connection
  product: any
detection:
  selection:
      CommandLine|contains:
        - 'exploit'
  condition: selection
falsepositives:
  - Legitime administrative Zugriffe oder Penetrationstests
level: high
tags:
  - attack.initial_access
  - attack.t1059
rule CTI_Threat_Indicator {
    meta:
        author = "iShareStuff CTI Automated Detection Engine"
        date = "2026-09-24"
        description = "YARA Signature for "
    strings:
        $str = "New File-Based Apps in .NET 10" ascii wide
    condition:
        any of them
}
tsecurity.de Cognitive Threat RAG
Fokus-Vektor:

Kognitive Analyse für identifizierte Bedrohung: Erhöhte Bedrohungslage im Bereich New File-Based Apps in .NET 10: You Can .... Basierend auf 368k Vektor-Korrelationen werden sofortige Isolationsmaßnahmen für betroffene Endpunkte empfohlen.

🛡️ Angriffsfläche & Exposure

Netzwerk/Remote-Zugriff ohne Vorauthentifizierung möglich.

Empfohlene Sofortmaßnahmen
  • 1. Perimeter-Inspektion: Relevante Portfreigaben und exponierte Endpunkte unverzüglich scannen.
  • 2. Patch-Applikation: Hersteller-Hotfix einspielen oder betroffene Daemons in isolierte DMZ-Segmente überführen.
  • 3. Telemetrie & EDR-Alerts: Prozessaufrufe und Child-Processes auf anomale Shell-Spawns überwachen.
🔗 Semantisch verwandte Zero-Days MariaDB 11.7 VEC
Ähnliche Beiträge
🔍 Verwandte News

Auch interessante Nachrichten New File-Based Apps in .NET 10: You Can Now Run C# in Just 1 File!

Thematisch verwandte Begriffe: FileBased, Apps, Just, File · 6 Treffer

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Laden...

Beiträge werden geladen ...

Laden...

Videos werden geladen ...

Zum Aktualisieren ziehen
ZERO-DAY CVE-2026-97179 | A security vulnerability has been detected in O2OA up to 9.5.3/10.0.2. T…
Advisory →
TTS Reader • tsecurity.de Voice
tsecurity.de Icon
tsecurity.de App
Offline-Lesen, Eilmeldungen & 0ms Ladezeit

Installiere tsecurity.de direkt auf deinen Home-Bildschirm für das ultimative Vollbild-Magazinerlebnis ohne Browser-Leisten.

Nächster Beitrag
Themen-Radar & Intelligence Matrix
Echtzeit-Taxonomie nach Angriffsvektoren & Plattformen

tsecurity.de Live Threat Radar

🔴 LIVE RADAR
MONITORING
AKTIV
CVE-DATENBANK
LIVE
🔍
Community Radar & Live Chat
Sentinel Bot online • Live-Stream
Dein Cluster: Security Explorer
Match:
lädt…
Verbindung zum Community-Stream wird aufgebaut...
Bearbeitungsmodus — Senden überschreibt deine Nachricht
Community-Puls — was gerade passiert
lädt…
Aktivitäten deiner Analysten
lädt…
Neues Thema oder Eilmeldung einreichen

Reiche interessante Links, Zero-Days oder Debatten ein. Die Community entscheidet per Upvote über die Veröffentlichung.

Heiß diskutierte Einreichungen
🔖 Gespeicherte Artikel
📂 Keine gespeicherten Artikel vorhanden.
Zurück Ziehen Vor
Links: vorheriger Artikel Rechts: nächster Artikel unten: schließen
News NIS-2 Frühwarnung Tier-1 Intel TTP ⏱️ 3 Min vor 10 Min
Artikeldaten werden geladen...

Zurück: vorheriger Vor: nächster
↗ Original-Quelle
Social Reaktionen Deine Reaktion zählt
Einstufung & Relevanz-Poll 0 Stimmen
In sozialen Netzwerken teilen 1-Klick