Skip to content

Commit bd2252c

Browse files
docs: Update local development setup instructions for backend services
1 parent f231e45 commit bd2252c

1 file changed

Lines changed: 69 additions & 14 deletions

File tree

docs/LocalDevelopmentSetup.md

Lines changed: 69 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,14 @@ This application consists of **three separate services** that run independently:
1515
> **⚠️ Critical: Each service must run in its own terminal/console window**
1616
>
1717
> - **Do NOT close terminals/windows** while services are running
18-
> - Open **Kernel Memory** and **Backend API** in Visual Studio.
18+
> - You can use **Visual Studio** or **dotnet CLI** (from VS Code terminal / PowerShell) for the backend services.
1919
> - Open **Frontend** in Visual Studio Code.
2020
> - Each service will occupy its terminal and show live logs
2121
>
2222
> **Terminal/Window Organization:**
23-
> - **Visual Studio window 1**: Kernel Memory - Service runs on port 9001
24-
> - **Visual Studio window 2**: Backend API - HTTP server runs on port 52190
25-
> - **Visual Studio Code Terminal**: Frontend - Development server on port 5900
23+
> - **Terminal 1**: Kernel Memory - Service runs on port 9001
24+
> - **Terminal 2**: Backend API - HTTP server runs on port 5000
25+
> - **Terminal 3 (VS Code)**: Frontend - Development server on port 5900
2626
2727
### Path Conventions
2828

@@ -285,7 +285,11 @@ If you prefer or need to use the Azure Portal instead of CLI commands:
285285

286286
## Step 3: Backend Setup & Run Instructions
287287

288-
### 3.1. Open Solutions in Visual Studio
288+
You can run the backend services using either **Visual Studio** (Option A) or the **dotnet CLI** from a terminal (Option B).
289+
290+
### 3.1. Open Solutions
291+
292+
#### Option A: Visual Studio
289293

290294
Navigate to the cloned repository and open the following solution files from Visual Studio:
291295

@@ -295,6 +299,14 @@ Navigate to the cloned repository and open the following solution files from Vis
295299

296300
**Sign in to Visual Studio** using your tenant account with the required permissions.
297301

302+
> **⚠️ Important: KernelMemory.sln build issue**
303+
> The `KernelMemory.sln` solution file references example and evaluation projects (`examples/`, `applications/`) that are **not included** in this repository. Building the full solution will produce errors.
304+
> **Workaround:** In Visual Studio, right-click the **Service** project (inside the `service` folder) → **Set as Startup Project**. Visual Studio will only build the Service project and its dependencies when you press F5.
305+
306+
#### Option B: dotnet CLI (VS Code / PowerShell)
307+
308+
No solution file is needed. You will run individual projects directly using `dotnet run`. See Step 4.3 for the CLI commands.
309+
298310
---
299311

300312
### 3.2. Create/Verify `appsettings.Development.json` Files
@@ -352,13 +364,13 @@ Copy-Item Deployment\appconfig\aiservice\appsettings.Development.json.template A
352364

353365
## Step 4: Run Backend Services
354366

355-
### 4.1. Set Startup Projects
367+
### 4.1. Set Startup Projects (Visual Studio only)
356368

357369
- **KernelMemory Solution:**
358-
Set **Service** (located inside the `service` folder) as the startup project to run the Kernel Memory service.
370+
Right-click **Service** (located inside the `service` folder) **Set as Startup Project**. This ensures only the Service project and its dependencies are built, avoiding errors from missing example projects in the solution.
359371

360372
- **Microsoft.GS.DPS Solution:**
361-
Set **Microsoft.GS.DPS.Host** as the startup project to run the API.
373+
Right-click **Microsoft.GS.DPS.Host** **Set as Startup Project**.
362374

363375
### 4.2. Update Kernel Memory Endpoint in Azure App Configuration
364376

@@ -386,12 +398,40 @@ Copy-Item Deployment\appconfig\aiservice\appsettings.Development.json.template A
386398
387399
### 4.3. Run the Backend Services
388400
401+
#### Option A: Visual Studio
402+
389403
1. In Visual Studio, run both solutions (KernelMemory and Microsoft.GS.DPS) by pressing **F5** or clicking the **Start** button.
390404
2. Two terminal windows will appear showing the service logs.
391-
3. Once both services start successfully:
405+
406+
#### Option B: dotnet CLI (VS Code / PowerShell)
407+
408+
> **⚠️ Critical:** You must set the `ASPNETCORE_ENVIRONMENT` environment variable to `Development` before running.
409+
> Without this, the `appsettings.Development.json` file will **not** be loaded, and the application will fail with a `NullReferenceException` because the App Configuration URL is not found.
410+
411+
Open **two separate terminals** and run one service in each:
412+
413+
**Terminal 1 – Kernel Memory Service:**
414+
```powershell
415+
# From repository root
416+
$env:ASPNETCORE_ENVIRONMENT = "Development"
417+
dotnet run --project App\kernel-memory\service\Service\Service.csproj --configuration Debug
418+
```
419+
420+
**Terminal 2 – Backend API:**
421+
```powershell
422+
# From repository root
423+
$env:ASPNETCORE_ENVIRONMENT = "Development"
424+
dotnet run --project App\backend-api\Microsoft.GS.DPS.Host\Microsoft.GS.DPS.Host.csproj --configuration Debug
425+
```
426+
427+
> **Note:** Do **not** build the full `KernelMemory.sln` from CLI (`dotnet build KernelMemory.sln`). It will fail because the solution references example projects that are not in this repository. Always use `--project` to target the Service project directly.
428+
429+
#### Verify Services
430+
431+
Once both services start successfully:
392432
- **Kernel Memory Service** will be available at: http://localhost:9001
393-
- **Backend API** will be available at: https://localhost:52190
394-
- **Swagger UI** will open automatically at http://localhost:52190 for API validation
433+
- **Backend API** will be available at: http://localhost:5000
434+
- **Swagger UI** will be available at: http://localhost:5000 for API validation
395435

396436
> **⚠️ Important:** Keep both terminal windows open while the services are running. Do not close them until you're done with development.
397437
@@ -415,13 +455,15 @@ Copy-Item Deployment\appconfig\frontapp\.env.template App\frontend-app\.env
415455

416456
### 5.3. Configure the `.env` file
417457

418-
Update the `VITE_API_ENDPOINT` value with your local Backend API URL, e.g.:
458+
Update the `VITE_API_ENDPOINT` value with your local Backend API URL:
419459

420460
```env
421-
VITE_API_ENDPOINT=https://localhost:52190
461+
VITE_API_ENDPOINT=http://localhost:5000
422462
DISABLE_AUTH=true
423463
VITE_ENABLE_UPLOAD_BUTTON=true
424464
```
465+
466+
> **Note:** The Backend API runs on **`http://localhost:5000`** by default (HTTP, not HTTPS).
425467
### 5.4. Verify Node.js and Yarn Installation
426468

427469
Before installing dependencies, verify that Node.js (LTS) and Yarn are already installed from Step 1:
@@ -457,7 +499,7 @@ yarn start
457499

458500
**Services will be available at:**
459501
- **Kernel Memory Service**: http://localhost:9001
460-
- **Backend API**: https://localhost:52190
502+
- **Backend API**: http://localhost:5000
461503
- **Frontend Application**: http://localhost:5900
462504

463505
You're now ready to run and debug the application locally!
@@ -468,6 +510,19 @@ You're now ready to run and debug the application locally!
468510

469511
### Common Issues
470512

513+
#### `NullReferenceException` or `ArgumentNullException: Value cannot be null (Parameter 'uriString')` on startup
514+
515+
This means `appsettings.Development.json` is not being loaded. Ensure:
516+
1. The `ASPNETCORE_ENVIRONMENT` environment variable is set to `Development` (see Step 4.3).
517+
2. The `appsettings.Development.json` file exists in the correct project directory (see Step 3.2).
518+
3. The `ConnectionStrings:AppConfig` value contains your actual Azure App Configuration URL, not the placeholder.
519+
520+
#### `KernelMemory.sln` build fails with "project file was not found" errors
521+
522+
The solution references example projects not included in this repository. **Do not build the full solution.** Instead:
523+
- In Visual Studio: Set **Service** as the startup project and press F5.
524+
- In CLI: Use `dotnet run --project App\kernel-memory\service\Service\Service.csproj`.
525+
471526
#### Connection Issues
472527

473528
- While running the Kernel solution, if you encounter an error such as ``server not responded`` or ``server not found``, it usually indicates that the required resource is not responding.

0 commit comments

Comments
 (0)