Expert assistant for the ScreenSoundSwitch C# audio device manager - builds, tests, and modifies both WinUI app and WebAPI with cross-platform awareness
Expert assistant for developing and maintaining ScreenSoundSwitch, a C# .NET 8.0 application that manages audio playback devices based on screen location. Handles both WinUI desktop application and WebAPI with full awareness of cross-platform limitations.
This assistant helps you work effectively with the ScreenSoundSwitch codebase by:
ScreenSoundSwitch consists of 5 projects:
1. **ScreenSoundSwitch.WinUI** - Main desktop app (Windows-only, .NET 8.0-windows)
2. **ScreenSoundSwitch.WebAPI** - REST API for remote management (.NET 8.0, cross-platform)
3. **ScreenSoundSwitch.WinUI.Audio** - Audio interface library (Windows-only)
4. **SoundSwitch.Audio.Manager** - Core audio switching logic (Windows-only)
5. **SoundSwitch.Common** - Shared utilities (.NET Standard 2.1, cross-platform)
1. **Verify Platform Requirements**
- Check operating system: Windows 10+ for full development, Linux/macOS for WebAPI only
- Confirm .NET 8.0 SDK is installed: `dotnet --version`
- If missing, download from https://dotnet.microsoft.com/download/dotnet/8.0
2. **Full Solution Build (Windows Only)**
```bash
dotnet restore
dotnet build
```
- Wait 25-30 seconds for restore. NEVER CANCEL.
- Expect ~23 nullable reference warnings in WebAPI (normal)
- Zero errors = success
3. **WebAPI Component Build**
```bash
dotnet restore ScreenSoundSwitch.WebAPI/ScreenSoundSwitch.WebAPI.csproj
# Wait 25-30 seconds. NEVER CANCEL.
dotnet build ScreenSoundSwitch.WebAPI/ScreenSoundSwitch.WebAPI.csproj
# Takes 9-10 seconds. NEVER CANCEL.
```
4. **Common Library Build**
```bash
dotnet restore SoundSwitch.Common/SoundSwitch.Common.csproj
# Takes 5-6 seconds
dotnet build SoundSwitch.Common/SoundSwitch.Common.csproj
# Takes 1-2 seconds
```
5. **Fix Resource File Case Sensitivity (Linux/macOS)**
- If you see resource not found errors:
```bash
cd SoundSwitch.Common
ln -s Resources resources
cd resources
cp defaultMicrophone.ico defaultmicrophone.ico
cp defaultSpeakers.ico defaultspeakers.ico
cd ../..
```
6. **Audio Manager Build (Optional, Linux/macOS)**
```bash
dotnet restore SoundSwitch.Audio.Manager/SoundSwitch.Audio.Manager.csproj -p:EnableWindowsTargeting=true
# Takes 10-12 seconds. NEVER CANCEL.
```
- Note: Will not fully build due to Windows-specific tools (cswinrt.exe)
7. **Start WebAPI Development Server**
```bash
dotnet run --project ScreenSoundSwitch.WebAPI/ScreenSoundSwitch.WebAPI.csproj --urls "http://localhost:5254"
```
- Swagger UI available at http://localhost:5254/swagger
- Default port 5253 configured in launchSettings.json
- Requires SQL Server database connection
8. **Test WebAPI Health**
```bash
curl http://localhost:5254/swagger/index.html
curl http://localhost:5254/api/test/check-connection
```
- Second endpoint requires authentication
9. **Run WinUI Application (Windows Only)**
- Cannot run on Linux/macOS
- Requires Windows 10.0.19041.0 or later
10. **Adding New Audio Device Support**
- Modify classes in `SoundSwitch.Common/Framework/Audio/Device/`
- Update `SoundSwitch.Audio.Manager/AudioSwitcher.cs`
- Test: `dotnet build SoundSwitch.Common/SoundSwitch.Common.csproj`
11. **Extending WebAPI Functionality**
- Add controllers in `ScreenSoundSwitch.WebAPI/Controllers/`
- Update models in `ScreenSoundSwitch.WebAPI/Models/`
- **ALWAYS** test WebAPI startup after changes
- Verify with Swagger UI
12. **Modifying WinUI Interface**
- Update XAML in `ScreenSoundSwitch.WinUI/Views/`
- Implement logic in corresponding ViewModels
- **Cannot test on Linux** - requires Windows
13. **Working with Resources**
- Always work in `SoundSwitch.Common/Resources/` directory
- Remember case sensitivity on non-Windows systems
- Update `SoundSwitch.Common/Properties/Resources.resx` for new resources
14. **Build WebAPI Container**
```bash
docker build -t screensoundswitch-webapi -f ScreenSoundSwitch.WebAPI/Dockerfile .
```
- Takes 15-20 minutes. NEVER CANCEL.
- Set timeout to 30+ minutes
15. **After Every Change**
- **ALWAYS** test WebAPI startup if modifying WebAPI components
- **ALWAYS** verify build succeeds for modified project
- **ALWAYS** test resource loading if modifying SoundSwitch.Common
- Zero errors = success (warnings acceptable)
16. **Release Build**
```bash
dotnet build --configuration Release
```
- Takes 2-3 seconds. NEVER CANCEL.
- Optimized for production
17. **Debug Build**
- Default configuration with full debugging symbols
- Use for development
18. **Nightly Build**
- Development configuration for continuous integration
**NEVER CANCEL** these operations prematurely.
**Building WebAPI on Linux:**
```bash
dotnet restore ScreenSoundSwitch.WebAPI/ScreenSoundSwitch.WebAPI.csproj
dotnet build ScreenSoundSwitch.WebAPI/ScreenSoundSwitch.WebAPI.csproj
dotnet run --project ScreenSoundSwitch.WebAPI/ScreenSoundSwitch.WebAPI.csproj --urls "http://localhost:5254"
```
**Adding a new controller:**
```bash
dotnet build ScreenSoundSwitch.WebAPI/ScreenSoundSwitch.WebAPI.csproj
dotnet run --project ScreenSoundSwitch.WebAPI/ScreenSoundSwitch.WebAPI.csproj --urls "http://localhost:5254"
```
Always build and exercise your changes manually. The codebase has no automated tests - manual validation is critical.
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/screensoundswitch-development-assistant/raw