@@ -57,6 +57,7 @@ void WriteDepsFile(DependencyContext context)
57
57
new DependencyContextWriter ( ) . Write ( context , wrt ) ;
58
58
}
59
59
60
+ /// <inheritdoc />
60
61
public override bool Execute ( )
61
62
{
62
63
WriteDepsFile ( BuildDependencyContext ( ReadDepsFile ( ) ) ) ;
@@ -197,10 +198,9 @@ RuntimeAssetGroup BuildRuntimeLibraryRuntimeAssemblyGroupWithAdditional(Dependen
197
198
// normalize Windows paths
198
199
path = path . Replace ( '\\ ' , '/' ) ;
199
200
200
- // find existing runtime file and remove
201
+ // find existing file and clear duplicates
201
202
var file = runtimeFiles . FirstOrDefault ( i => ( i . Path ?? "" ) == path ) ;
202
- if ( file != null )
203
- runtimeFiles . Remove ( file ) ;
203
+ runtimeFiles . RemoveAll ( i => ( i . Path ?? "" ) == path ) ;
204
204
205
205
var assemblyVersion = addl . GetMetadata ( METADATA_LIBRARY_ASSET_ASSEMBLYVERSION ) ?? file ? . AssemblyVersion ;
206
206
if ( string . IsNullOrEmpty ( assemblyVersion ) )
@@ -251,10 +251,9 @@ RuntimeAssetGroup BuildRuntimeLibraryNativeAssetGroupWithAdditional(DependencyCo
251
251
// normalize Windows paths
252
252
path = path . Replace ( '\\ ' , '/' ) ;
253
253
254
- // find existing runtime file and remove
254
+ // find existing file and clear duplicates
255
255
var file = runtimeFiles . FirstOrDefault ( i => ( i . Path ?? "" ) == path ) ;
256
- if ( file != null )
257
- runtimeFiles . Remove ( file ) ;
256
+ runtimeFiles . RemoveAll ( i => ( i . Path ?? "" ) == path ) ;
258
257
259
258
var assemblyVersion = addl . GetMetadata ( METADATA_LIBRARY_ASSET_ASSEMBLYVERSION ) ?? file ? . AssemblyVersion ;
260
259
if ( string . IsNullOrEmpty ( assemblyVersion ) )
0 commit comments