diff --git a/src/Features/Core/Portable/EditAndContinue/CommittedSolution.cs b/src/Features/Core/Portable/EditAndContinue/CommittedSolution.cs index 69083fbf5ef2f..5d588eee9c820 100644 --- a/src/Features/Core/Portable/EditAndContinue/CommittedSolution.cs +++ b/src/Features/Core/Portable/EditAndContinue/CommittedSolution.cs @@ -421,6 +421,32 @@ private static bool IsMatchingSourceText(SourceText sourceText, ImmutableArray 0) + { + log.Write($"Checksum differs for source file '{sourceFilePath}', trying without preamble", LogMessageSeverity.Warning); + // Try again without BOM + fileStream.Seek(0, SeekOrigin.Begin); + sourceText = SourceText.From(fileStream, new UTF8Encoding(encoderShouldEmitUTF8Identifier: false), checksumAlgorithm); + + if (IsMatchingSourceText(sourceText, requiredChecksum, checksumAlgorithm)) + { + return sourceText; + } + } + } log.Write($"Checksum differs for source file '{sourceFilePath}'", LogMessageSeverity.Warning);