Skip to content

Instantly share code, notes, and snippets.

@Aaronontheweb
Created March 22, 2025 13:48
Show Gist options
  • Save Aaronontheweb/3423c94e802e8404a74ef40d4e6778c0 to your computer and use it in GitHub Desktop.
Save Aaronontheweb/3423c94e802e8404a74ef40d4e6778c0 to your computer and use it in GitHub Desktop.
Cursor AI prompts for Akka.NET

Akka.NET Build Warning Resolution Procedure

Initial Assessment

  1. Capture full build output:
    dotnet build src/Akka.sln > TestResults/full_build_output.txt
    Use TestResults directory as it's already in .gitignore.

Warning Analysis Checklist

1. Framework Compatibility

  • Check target frameworks in affected projects
  • Verify API usage against framework constraints:
    • netstandard2.0 compatibility
    • net6.0+ specific features
    • Cross-platform considerations

2. API Surface Changes

  • Determine if the warning involves public API
  • Check for:
    • Breaking changes
    • Member hiding (intentional vs accidental)
    • Interface implementations
    • Binary compatibility

3. Thread Safety & Concurrency

  • For volatile/concurrent code:
    • Verify thread-safety requirements
    • Check Interlocked/Volatile usage
    • Review memory barriers
    • Consider actor message passing patterns

4. Performance Impact

  • Assess if fixes might impact:
    • Message processing speed
    • Memory allocation
    • Lock contention
    • Queue operations

Resolution Process

  1. Create isolated fix branch
  2. For each change:
    • Document current behavior
    • Propose fix
    • Build affected project first
    • Build full solution
    • Run unit tests
    • Check for new warnings

Common Warning Categories

  1. CS0108: Member hiding

    • Usually intentional in actor hierarchies
    • Add new keyword only if hiding is intended
    • Document when left as-is
  2. CS0420: Volatile field access

    • Always use proper memory barriers
    • Prefer Volatile.Read/Write
    • Consider actor message passing instead
  3. CS1998: Async method without await

    • Check if async is needed
    • Document if kept for API consistency
  4. CS8974: Method group conversion

    • Use explicit lambda syntax
    • Check delegate parameter counts

Validation Steps

  1. Build specific project:

    dotnet build src/core/Akka/Akka.csproj
  2. Build full solution:

    dotnet build src/Akka.sln
  3. Run tests:

    dotnet test src/Akka.sln

When to Skip Fixes

  • Public API breaking changes
  • Intentional member hiding
  • Performance-critical code
  • Thread-safety patterns
  • Compatibility requirements

Documentation

For each warning left unresolved:

  1. Document the reason
  2. Add appropriate pragma if needed
  3. Reference any relevant issues/discussions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment