# V2GDecoderC C# Porting Task List ## 📋 Execution Plan ### Phase 1: Setup & Analysis ✅ - [x] Create REPORT.md with comprehensive C code analysis - [x] Create TODO.md with execution plan ### Phase 2: .NET Core/6+ Implementation - [ ] Create `csharp` folder structure - [ ] Create `csharp\dotnet` subfolder - [ ] Port core EXI codec to .NET - [ ] Port V2G protocol implementations (ISO1, ISO2, DIN) - [ ] Create test harness for .NET version - [ ] Test with test1.exi → test1.xml → test1.exi roundtrip - [ ] Validate roundtrip integrity (original vs final) - [ ] **Git commit** .NET version ### Phase 3: .NET Framework 4.8 Implementation - [ ] Create `csharp\dotnetfx` subfolder - [ ] Port .NET version to .NET Framework 4.8 - [ ] Adjust for Framework-specific differences - [ ] Create test harness for .NET FX version - [ ] Test with test1.exi → test1.xml → test1.exi roundtrip - [ ] Validate roundtrip integrity (original vs final) - [ ] **Git commit** .NET Framework version ### Testing Strategy ``` Original: test1.exi Step 1: Decode test1.exi → test1.xml Step 2: Encode test1.xml → test1_new.exi Step 3: Binary compare test1.exi ≟ test1_new.exi Result: PASS/FAIL validation ``` ### Key Porting Considerations - **Memory Management**: C static allocation → C# managed memory - **Error Handling**: C return codes → C# exceptions - **String Handling**: C char arrays → C# string/byte[] - **Buffer Operations**: C memcpy → C# Array.Copy/Buffer.BlockCopy - **Platform Differences**: Endianness, type sizes - **Security**: Address C vulnerabilities in C# implementation ### Success Criteria 1. ✅ Functional parity with C version 2. ✅ Test roundtrip validation passes 3. ✅ Clean separation of .NET/.NET FX versions 4. ✅ Git commits for each major milestone 5. ✅ Improved memory safety vs C version