Skip to main content
This guide covers building and running TechCore Mini ERP on your local development environment.

Prerequisites

Before running the application, ensure you have:

Building the Application

TechCore requires building both the .NET application and Tailwind CSS assets.

Building CSS Assets

The project uses Tailwind CSS 4.2.1 with DaisyUI 5.5.19 for styling. CSS is built automatically during the .NET build process via a pre-build target. To manually build CSS:
npm run css:build
This runs:
npx tailwindcss -i ./wwwroot/css/site.css -o ./wwwroot/css/styles.css --minify

Building the .NET Application

1

Navigate to project directory

cd TechCore
2

Build the project

dotnet build
This will:
  • Restore NuGet packages if needed
  • Run the Tailwind CSS build (via the pre-build target)
  • Compile the application
  • Output binaries to bin/Debug/net10.0/
The build process automatically triggers npm run css:build before compilation, as defined in the Tailwind target in TechCore.csproj.

Running Database Migrations

Before running the application for the first time, create the database:
1

Ensure SQL Server is running

Verify that your SQL Server instance is running and accessible.
2

Apply migrations

dotnet ef database update
This creates the TechCore database and all required tables based on your Entity Framework Core 10.0.3 migrations.
3

Verify database creation

Connect to your SQL Server and confirm the TechCore database exists.

Creating New Migrations

When you modify entity models, create a new migration:
dotnet ef migrations add MigrationName
Then apply it:
dotnet ef database update

Running the Application

Using .NET CLI

1

Navigate to project directory

cd TechCore
2

Run the application

dotnet run
The application will:
  • Build the project (including CSS assets)
  • Start the Kestrel web server
  • Display the URLs where the app is listening
3

Check the output

You should see output similar to:
info: Microsoft.Hosting.Lifetime[14]
      Now listening on: https://localhost:5001
info: Microsoft.Hosting.Lifetime[14]
      Now listening on: http://localhost:5000

Using Visual Studio

1

Open solution

Open TechCore.sln in Visual Studio 2022.
2

Set startup project

Ensure TechCore is set as the startup project (right-click project > Set as Startup Project).
3

Run

Press F5 to run with debugging, or Ctrl+F5 to run without debugging.The application will build and launch in your default browser.

Using Visual Studio Code

1

Open project folder

Open the TechCore folder in VS Code.
2

Install C# Dev Kit

Ensure you have the C# Dev Kit extension installed.
3

Run

Press F5 or use the Run menu > Start Debugging.VS Code will use the launch configuration from .vscode/launch.json if present.

Accessing the Application

Once running, access TechCore at:
  • HTTPS: https://localhost:5001
  • HTTP: http://localhost:5000
The default route is configured as {controller=Home}/{action=Index}/{id?}, so navigating to the root URL will load the Home controller’s Index action.

Development vs Production Mode

The application behavior changes based on the environment:

Development Mode

Program.cs:22-27
if (!app.Environment.IsDevelopment())
{
    app.UseExceptionHandler("/Home/Error");
    app.UseHsts();
}
In Development:
  • Detailed error pages are shown
  • HSTS is disabled
  • appsettings.Development.json overrides are applied

Production Mode

In Production:
  • Errors are handled by the /Home/Error endpoint
  • HSTS (HTTP Strict Transport Security) is enabled with a 30-day max-age
  • Only appsettings.json is used

Hot Reload

.NET 10.0 supports hot reload for rapid development:
dotnet watch run
This will:
  • Run the application
  • Watch for file changes
  • Automatically rebuild and refresh when you save changes
CSS changes require a manual rebuild (npm run css:build) or restarting dotnet watch to take effect.

Troubleshooting

Port Already in Use

If ports 5000 or 5001 are already in use, you can specify different ports:
dotnet run --urls "https://localhost:7001;http://localhost:7000"

CSS Not Loading

If styles are not appearing:
  1. Verify npm packages are installed:
    npm install
    
  2. Manually build CSS:
    npm run css:build
    
  3. Check that wwwroot/css/styles.css was generated

Database Connection Failed

If you see database connection errors:
  1. Verify SQL Server is running
  2. Check your connection string in appsettings.json or user secrets
  3. Ensure the database exists:
    dotnet ef database update
    

Entity Framework Tools Not Found

If dotnet ef commands fail:
dotnet tool install --global dotnet-ef
Or update to the latest version:
dotnet tool update --global dotnet-ef

Development Workflow

Recommended workflow for local development:
1

Create feature branch

git checkout -b feature/your-feature-name
2

Run with hot reload

dotnet watch run
3

Make changes and test

Edit code, save, and test the automatically reloaded application.
4

Commit changes

git add .
git commit -m "Descriptive commit message"
5

Push to remote

git push -u origin feature/your-feature-name

Next Steps

Build docs developers (and LLMs) love