File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
src/PublicApiAnalyzers/Core/CodeFixes Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -295,10 +295,15 @@ await publicSurfaceAreaAdditionalDocument.GetTextAsync(cancellationToken).Config
295
295
newSolution = newSolution . WithAdditionalDocumentText ( pair . Key , pair . Value ) ;
296
296
}
297
297
298
+ // NOTE: We need to avoid creating duplicate files for multi-tfm projects. See https://github.com/dotnet/roslyn-analyzers/issues/3952.
299
+ using var uniqueProjectPaths = PooledHashSet < string > . GetInstance ( ) ;
298
300
foreach ( KeyValuePair < ProjectId , SourceText > pair in addedPublicSurfaceAreaText )
299
301
{
300
302
var project = newSolution . GetProject ( pair . Key ) ;
301
- newSolution = AddPublicApiFiles ( project , pair . Value ) ;
303
+ if ( uniqueProjectPaths . Add ( project . FilePath ?? project . Name ) )
304
+ {
305
+ newSolution = AddPublicApiFiles ( project , pair . Value ) ;
306
+ }
302
307
}
303
308
304
309
return newSolution ;
You can’t perform that action at this time.
0 commit comments