Expert guidance for developing the OfficeRadio C# Windows Forms application that manages Chromecast-based office radio streaming.
You are an expert assistant for the OfficeRadio project, a C# Windows Forms desktop application for managing Chromecast-based office radio streaming. The application allows users to discover Chromecast devices on the local network and stream various radio stations to them.
1. **CRITICAL**: This application requires .NET 9.0 SDK. The project targets `net9.0-windows` and cannot be built with earlier SDK versions.
2. Install .NET 9.0 SDK using:
```bash
wget -O /tmp/dotnet-install.sh https://dot.net/v1/dotnet-install.sh
chmod +x /tmp/dotnet-install.sh
/tmp/dotnet-install.sh --channel STS
export PATH="/home/runner/.dotnet:$PATH"
```
3. **Windows Development**: This application uses Windows Forms and can only run properly on Windows. While it can be built on Linux with special configuration, runtime execution requires Windows.
**CRITICAL BUILD RULE**: NEVER CANCEL build operations. All builds complete in under 5 seconds. Always set timeout to 60+ seconds for safety.
#### Restore packages:
```bash
dotnet restore -p:EnableWindowsTargeting=true
```
Takes ~4 seconds. NEVER CANCEL.
#### Build the application:
```bash
dotnet build -p:EnableWindowsTargeting=true
```
Takes ~4-5 seconds. NEVER CANCEL.
#### Run the application (Windows only):
```bash
dotnet run --project Caster -p:EnableWindowsTargeting=true
```
**Note for Linux/macOS users**: MUST include `-p:EnableWindowsTargeting=true` for all dotnet commands due to Windows Forms dependency.
```
/
├── Caster.sln # Visual Studio solution file
├── Caster/ # Main application project
│ ├── Caster.csproj # Project file targeting net9.0-windows
│ ├── Program.cs # Application entry point
│ ├── Form1.cs # Main Windows Form UI logic
│ ├── Form1.Designer.cs # Auto-generated UI layout code
│ ├── Form1.resx # Form resources
│ ├── CastingService.cs # Chromecast device discovery and management
│ └── RadioCastingHelper.cs # Radio station definitions and media helpers
├── README.md # Basic project description
└── .github/
└── copilot-instructions.md
```
1. **ALWAYS build and verify compilation**:
```bash
dotnet build -p:EnableWindowsTargeting=true
```
2. **Check for new compiler warnings**: Address nullability warnings (CS8618, CS8622, CS8625) for better code quality.
3. **Manual testing on Windows**:
- Run the application: `dotnet run --project Caster -p:EnableWindowsTargeting=true`
- Verify Chromecast device discovery works (should complete within 30 seconds)
- Test radio station streaming functionality (KINK and Qmusic Non-Stop)
- Validate volume control and playback controls
- Ensure async operations don't block the UI thread
- Verify proper error messages for network issues or missing devices
```bash
dotnet format --verbosity diagnostic
```
**Note**: This FAILS on Linux/macOS due to Windows targeting requirements. This is expected and cannot be worked around.
1. **Edit RadioCastingHelper.cs**:
- Add new static method following the pattern of `GetKinkMedia()` and `GetQMusicNonStopMedia()`
- Use `GetLiveRadioMedia()` helper for consistent media object creation
2. **Update Form1.cs**:
- Add new button and event handler to load the new station
- Follow async/await pattern for event handlers
1. **Use Visual Studio Designer**: Open Form1.cs in Visual Studio and use the designer for layout changes
2. **Manual code changes**: Edit Form1.Designer.cs for programmatic UI modifications
3. **Event handlers**: Add new event handlers in Form1.cs, following async/await pattern
1. **Check network connectivity**: Ensure Chromecast and development machine are on same network
2. **Verify device discovery**: Check CastingService.DiscoverReceiversAsync() method
3. **Review error handling**: Add try-catch blocks around network operations
**CRITICAL REMINDER**: NEVER CANCEL build operations. They complete quickly but may appear to hang briefly during package resolution. Always set timeouts to 60+ seconds.
**ALWAYS follow these instructions first and fallback to additional search and context gathering only if the information in these instructions is incomplete or found to be in error.**
Leave a review
No reviews yet. Be the first to review this skill!
# Download SKILL.md from killerskills.ai/api/skills/officeradio-development-assistant/raw