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)
281281 version = match . Groups [ 3 ] . Value ;
282282 }
283283
284- // Find existing registration for this package or null if not found
284+ // Find existing registration for this package with the SAME VERSION
285285 var existingRegistration = manifest . Registrations ? . FirstOrDefault ( r =>
286286 r . Component != null &&
287287 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 ) ) ;
289290
290291 if ( existingRegistration == null )
291292 {
292- // Add new package if it doesn't exist
293+ // Add new package if it doesn't exist with this version
293294 manifest . Registrations ? . Add ( new Registration
294295 {
295296 Component = new Component
@@ -304,12 +305,6 @@ private void RecordPackages(string projectDirectory)
304305 } ) ;
305306 updatedManifest = true ;
306307 }
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- }
313308 }
314309 }
315310
You can’t perform that action at this time.
0 commit comments