File tree Expand file tree Collapse file tree 1 file changed +4
-9
lines changed
test/dotnet-new.IntegrationTests Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -281,15 +281,16 @@ private void RecordPackages(string projectDirectory)
281
281
version = match . Groups [ 3 ] . Value ;
282
282
}
283
283
284
- // Find existing registration for this package or null if not found
284
+ // Find existing registration for this package with the SAME VERSION
285
285
var existingRegistration = manifest . Registrations ? . FirstOrDefault ( r =>
286
286
r . Component != null &&
287
287
r . Component . Nuget != null &&
288
- string . Equals ( r . Component . Nuget . Name , packageId , StringComparison . OrdinalIgnoreCase ) ) ;
288
+ string . Equals ( r . Component . Nuget . Name , packageId , StringComparison . OrdinalIgnoreCase ) &&
289
+ string . Equals ( r . Component . Nuget . Version , version , StringComparison . OrdinalIgnoreCase ) ) ;
289
290
290
291
if ( existingRegistration == null )
291
292
{
292
- // Add new package if it doesn't exist
293
+ // Add new package if it doesn't exist with this version
293
294
manifest . Registrations ? . Add ( new Registration
294
295
{
295
296
Component = new Component
@@ -304,12 +305,6 @@ private void RecordPackages(string projectDirectory)
304
305
} ) ;
305
306
updatedManifest = true ;
306
307
}
307
- else if ( existingRegistration . Component ? . Nuget ? . Version != version )
308
- {
309
- // Update version if it's different from the existing one
310
- existingRegistration . Component ? . Nuget ? . Version = version;
311
- updatedManifest = true;
312
- }
313
308
}
314
309
}
315
310
You can’t perform that action at this time.
0 commit comments