From 96c5944a67957de745f43a787e8f2ce590033b4e Mon Sep 17 00:00:00 2001 From: Chris Tacke Date: Tue, 24 Dec 2024 09:28:43 -0600 Subject: [PATCH] fix for CLIv1/Extension bug --- .../Devices/MeadowLocalDevice.FileManager.cs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/Meadow.CLI.Core/Devices/MeadowLocalDevice.FileManager.cs b/Meadow.CLI.Core/Devices/MeadowLocalDevice.FileManager.cs index 91286ce7..aa9487e6 100644 --- a/Meadow.CLI.Core/Devices/MeadowLocalDevice.FileManager.cs +++ b/Meadow.CLI.Core/Devices/MeadowLocalDevice.FileManager.cs @@ -641,7 +641,22 @@ async Task AddFile(string file, bool includePdbs) var crc = CrcTools.Crc32part(bytes, len, 0); // 0x04C11DB7); Logger.LogDebug("{file} crc is {crc:X8}", file, crc); - files.Add(file, crc); + if (files.ContainsKey(file)) + { + // file already exists in our list? + // this feels like a bug, but for now we'll see if it has the same CRC + if (crc != files[file]) + { + throw new Exception($"To differing (by CRC) versions of file '{file}' exist in the build output"); + } + + // same file CRC, just ignore the new call to add it + } + else + { + files.Add(file, crc); + } + if (includePdbs) { var pdbFile = Path.ChangeExtension(file, "pdb");