Open VS Code terminal
Build the project Run: dotnet build
Check for errors and warnings
Windows: dotnet build -t:Run -f net8.0-windows
1. Running the App in VS Code
Run the app on different platforms Android: dotnet build -t:Run -f net8.0-android
iOS (Mac only): dotnet build -t:Run -f net8.0-ios
Run: dotnet watch run
Use Hot Reload for real-time UI updates
Make changes in XAML or C# files and see instant updates
Click on the left margin next to the line number in VS Code
Set breakpoints in C# files
Execution will pause at breakpoints during debugging
Open "View" > "Debug Console" in VS Code
Use Debug Console for logs and outputs
Monitor app output and logs in real time
2. Debugging the App in VS Code Open the "Run and Debug" tab in VS Code
Run the app in Debug mode Choose .NET Core as the runtime
Start debugging by clicking the green "Play" button
Use "Step Over", "Step Into", and "Continue" for debugging
Step through code execution
Inspect variables and objects in the "Watch" window
Modify [Link] :
```csharp
[Link](logging =>
[Link]();
Enable logging in .NET MAUI {
[Link]([Link]);
});
3. Logging & Monitoring App Behavior ```
View logs in the terminal: dotnet run
Example:
```csharp
Use [Link] for manual logging [Link]("App Started Successfully");
```
Logs will appear in the "Output" window
Create a new folder: mkdir Tests && cd Tests
# Detailed Guide: Development
Workflow (Debugging & Testing) in Initialize a test project: dotnet new xunit -n
Set up a Unit Test Project
.NET MAUI with VS Code [Link]
Add the test project to the main solution: dotnet sln
add [Link]
Example test for NoteService:
```csharp
using Xunit;
public class NoteServiceTests
[Fact]
public void AddNote_ShouldIncreaseNoteCount()
Write Unit Tests for Business Logic
4. Unit Testing in .NET MAUI
var service = new NoteService();
{
{ [Link]("Test Note");
[Link](1, [Link]);
```
Execute: dotnet test
Run tests in VS Code
View test results in terminal output
Open test file and add breakpoints
Debug unit tests
Run tests in Debug mode: dotnet test --filter
FullyQualifiedName
Use lazy loading for large datasets
Optimize app performance Cache frequently accessed data
Minimize memory leaks by disposing objects properly
Use try-catch blocks around critical operations
Example:
```csharp
5. Performance Optimization & Error Handling try
{ var notes = [Link]();
Handle unexpected errors gracefully
}
catch (Exception ex)
{ [Link]($"Error fetching notes: {[Link]}");
```