Prerequisites
Before you begin, ensure you have the following installed on your development machine:Required Software
.NET 10.0 SDK
Download and install the latest .NET 10.0 SDK from the official Microsoft website
SQL Server
SQL Server 2019 or later (Express Edition is sufficient for development)
IDE
Visual Studio 2022 (recommended) or Visual Studio Code with C# extension
Git
Git for version control
Verify Installation
Verify that .NET 10.0 is installed correctly:Getting Started
Configure Database Connection
Create a Example:
Conf.txt file in the ServiciosConsolaCentralizada directory with your SQL Server connection details:The format is:
Server:Database:User:Password separated by colonsCreate the Database
Run the database creation script to set up the required tables and stored procedures:For Package Management Database:For Donations Database:Alternatively, you can open these SQL files in SQL Server Management Studio (SSMS) and execute them manually.
The scripts will create databases named
WSPaqueteria and WSDonaciones with all necessary tables, stored procedures, and initial dataRestore NuGet Packages
Navigate to the solution directory and restore all dependencies:This will install the following key packages:
- Microsoft.AspNetCore.Authentication.JwtBearer (10.0.0)
- Microsoft.Data.SqlClient (6.1.3)
- Newtonsoft.Json (13.0.4)
- Swashbuckle.AspNetCore (10.0.1)
- Twilio (7.13.7)
Build the Solution
Build the entire solution to ensure all projects compile correctly:The solution contains four projects:
- ServiciosConsolaCentralizada: Main API project
- BussinesRuls: Business logic layer
- DataManagment: Data access layer
- Objects: Shared objects and constants
Configure Application Settings
Update the See the Configuration Guide for detailed information about each setting.
appsettings.json file in the ServiciosConsolaCentralizada directory with your configuration:Project Structure
Understanding the solution architecture:Running with Visual Studio
If you’re using Visual Studio 2022:- Open
PaqueteriaWS.sln - Set
ServiciosConsolaCentralizadaas the startup project (right-click → Set as Startup Project) - Ensure
Conf.txtexists with your database connection - Press F5 to run with debugging or Ctrl+F5 to run without debugging
Troubleshooting
Database Connection Errors
Database Connection Errors
If you see connection errors:
- Verify
Conf.txtformat is correct:Server:Database:User:Password - Ensure SQL Server is running and accessible
- Check that the database name matches the one in
Conf.txt - Verify SQL Server authentication is enabled (if using SQL Server auth)
- Confirm the TrustServerCertificate setting is properly configured
Port Already in Use
Port Already in Use
If port 5005 is already in use:
- Modify the port in
Program.cs(line 42) - Or kill the process using the port:
JWT Authentication Issues
JWT Authentication Issues
If authentication fails:
- Ensure the JWT Key in
appsettings.jsonis at least 32 characters - Verify the token hasn’t expired (default is 3600 seconds = 1 hour)
- Check that the Authorization header includes “Bearer ” prefix
Missing Dependencies
Missing Dependencies
If you encounter missing package errors:
Next Steps
Configuration
Learn about configuring JWT, database, and email settings
API Reference
Explore available endpoints and authentication
Deployment
Deploy your API to production
Architecture
Understand the system architecture