FileBasedApp 0.1.0
There is a newer version of this package available.
See the version list below for details.
See the version list below for details.
dotnet add package FileBasedApp --version 0.1.0
NuGet\Install-Package FileBasedApp -Version 0.1.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="FileBasedApp" Version="0.1.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="FileBasedApp" Version="0.1.0" />
<PackageReference Include="FileBasedApp" />
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add FileBasedApp --version 0.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
#r "nuget: FileBasedApp, 0.1.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package FileBasedApp@0.1.0
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=FileBasedApp&version=0.1.0
#tool nuget:?package=FileBasedApp&version=0.1.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.
FileBasedApp
A base library for building file-based applications with dependency injection and configuration support.
Features
- Base classes for building file-based applications
- Integrated dependency injection using Microsoft.Extensions.DependencyInjection
- Configuration support with JSON files
- Built-in logging with console output
- Support for both synchronous and asynchronous applications
Installation
Install the NuGet package:
dotnet add package FileBasedApp
Usage
Synchronous Application
using FileBasedApp;
public class MyApp : FileBasedApplication
{
public override void SetupServices()
{
// Configure your services here
base.SetupServices();
}
public override void Run()
{
// Your application logic here
}
}
// Usage example:
public static void Main(string[] args)
{
var app = new MyApp();
app.Build().ConfigureServices();
app.Run();
}
Asynchronous Application
using FileBasedApp;
public class MyAsyncApp : AsyncFileBasedApplication
{
public override void SetupServices()
{
// Configure your services here
base.SetupServices();
}
public override async Task Run()
{
// Your asynchronous application logic here
}
}
// Usage example:
public static async Task Main(string[] args)
{
var app = new MyAsyncApp();
app.Build().ConfigureServices();
await app.Run();
}
Publishing to NuGet
This project is configured to automatically publish to NuGet.org using GitHub Actions.
Prerequisites
- A NuGet.org API key stored as a GitHub secret named
NUGET_API_KEY
Publishing a New Version
Option 1: Create a GitHub Release (Recommended)
- Create a new tag with the version number (e.g.,
v1.0.0) - Push the tag to GitHub
- Create a GitHub release from the tag
- The package will be automatically built and published to NuGet.org
git tag v1.0.0
git push origin v1.0.0
# Then create a release on GitHub
Option 2: Manual Workflow Dispatch
- Go to the Actions tab in GitHub
- Select the "Publish to NuGet" workflow
- Click "Run workflow"
- Enter the version number (e.g.,
1.0.0) - Click "Run workflow"
Building Locally
dotnet restore FileBasedApp/FileBasedApp.csproj
dotnet build FileBasedApp/FileBasedApp.csproj -c Release
dotnet pack FileBasedApp/FileBasedApp.csproj -c Release -o ./artifacts
License
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
-
net10.0
- Microsoft.Extensions.Configuration (>= 10.0.0)
- Microsoft.Extensions.Configuration.Json (>= 10.0.0)
- Microsoft.Extensions.DependencyInjection (>= 10.0.0)
- Microsoft.Extensions.Http (>= 10.0.0)
- Microsoft.Extensions.Logging (>= 10.0.0)
- Microsoft.Extensions.Logging.Console (>= 10.0.0)
- Microsoft.Extensions.Options (>= 10.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.