Spearton.BFlat.Template 1.0.4

dotnet new install Spearton.BFlat.Template@1.0.4
                    
This package contains a .NET Template Package you can call from the shell/command line.

NuGet version

Visual Studio-ready project template for BFLAT C#

Quick start

1. Environment setup (PowerShell, requires restart terminals after complete)

Create file with .ps1 with script below and run:

# Note: We use C:\bflat to avoid Permission Denied errors and path length issues. You can use any location.

# Set your destination folder
$p = "C:\bflat"

# Create folder, download and extract
mkdir $p -Force; cd $p
curl -L -o bflat.zip https://github.com/bflattened/bflat/releases/download/v8.0.2/bflat-8.0.2-windows-x64.zip
tar -xf bflat.zip -C $p

# Set BFLAT_BIN variable
[Environment]::SetEnvironmentVariable("BFLAT_BIN", $p, "User")

# Add to User PATH (only if not already there)
$oldPath = [Environment]::GetEnvironmentVariable("Path", "User")
if ($oldPath -notlike "*$p*") {
    [Environment]::SetEnvironmentVariable("Path", "$oldPath;$p", "User")
}

Write-Host "Done! Please RESTART your terminals." -ForegroundColor Green

2. Install template (any command line)

dotnet new install Spearton.BFlat.Template

3. Create and run (any command line)

dotnet new bflat -n BFlatApp1
cd BFlatApp1
dotnet run

Where it works?

  • Visual Studio 2026 (Create new project)
  • Dotnet CLI (dotnet new bflat)
  • Maybe something other compatible with dotnet new install Template

What does that template?

  • Visual Studio UI-based setting-up of BFLAT parameters (when creating)
  • F5 out-of-the-box
  • Clean .csproj (you can re-setting everything you set when created the project)
  • Intellisense out-of-the-box

What I must do to use this template?

  1. Download BFLAT anywhere on your PC
  2. Add BFLAT directory as BFLAT_BIN in Environment Variables
  3. Add BFLAT directory in %PATH% Environment Variable
  4. Download or clone this repo
  5. Run dotnet new install Template in root of this repository
  6. Make sure that there's no warning or errors from dotnet
  7. Open Visual Studio and be happy!

I have troubles with using of this template, what can I try to do?

---Visual studio troubles---

  1. Start button shows "Start" instead of "BFlat_Native"
    • If you accidently deleted Properties\launchSettings.json or builded not through VisualStudio - try to rebuild
  2. Intellisense doesn't work
    • Usually it's trouble with Visual Studio that it don't see your %PATH% (or bflat inside it) and/or %BFLAT_BIN%
  3. "Executable doesn't exist" when trying to run
    • Usually it's trouble with Properties\launchSettings.json:
      • As first - try rebuild;
      • As second (if first does nothing) modify .csproj (remove generation of JSON) and launchSettings.json (set absolute literal path without macroses)
  4. Build fails with "bflat is not recognized"
    • Visual Studio don't see bflat.exe in your %PATH%. If it works in CMD, but not in VS - try to add in system %PATH%

---Dotnet CLI troubles---

  1. Template not found
    • Try to run dotnet new uninstall Template in root, resign account, run dotnet new install Template in root

---Windows troubles---

  1. Environment Variables not applying
    • Windows sometimes can't do "hot reload", so you need to try resign in account or restart windows.
  2. Execution Policy
    • If you decide to add any helper scripts (.ps1), remind users to run Set-ExecutionPolicy RemoteSigned for their shell.
  3. Path too long
    • Windows has a 260-character limit for paths. If your project is deep in folders, bflat or launchSettings might fail.
    • Enable Long Paths in Windows Registry or move your project closer to the drive root (e.g., C:\Users\..\source)

p.s. Icon for this template was generated in Google Gemini for free.

  • net10.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.4 161 4/21/2026
1.0.3 161 4/20/2026
1.0.2 150 4/20/2026
1.0.1 156 4/20/2026
1.0.0 153 4/19/2026

1. Extra-args for bflat support
2. Clean fixed
3. template .csproj now more clean
4. Custom defines fixed
5. VS "smarty" .csproj cutting NOT fixed.