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.
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?
- Download BFLAT anywhere on your PC
- Add BFLAT directory as
BFLAT_BINin Environment Variables - Add BFLAT directory in
%PATH%Environment Variable - Download or clone this repo
- Run
dotnet new install Templatein root of this repository - Make sure that there's no warning or errors from dotnet
- Open Visual Studio and be happy!
I have troubles with using of this template, what can I try to do?
---Visual studio troubles---
- Start button shows "Start" instead of "BFlat_Native"
- If you accidently deleted
Properties\launchSettings.jsonor builded not through VisualStudio - try to rebuild
- If you accidently deleted
- 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%
- Usually it's trouble with Visual Studio that it don't see your
- "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)
- Usually it's trouble with
- Build fails with "bflat is not recognized"
- Visual Studio don't see
bflat.exein your%PATH%. If it works in CMD, but not in VS - try to add in system%PATH%
- Visual Studio don't see
---Dotnet CLI troubles---
- Template not found
- Try to run
dotnet new uninstall Templatein root, resign account, rundotnet new install Templatein root
- Try to run
---Windows troubles---
- Environment Variables not applying
- Windows sometimes can't do "hot reload", so you need to try resign in account or restart windows.
- Execution Policy
- If you decide to add any helper scripts (.ps1), remind users to run Set-ExecutionPolicy RemoteSigned for their shell.
- 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.
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.