11// Licensed to the .NET Foundation under one or more agreements. 
22// The .NET Foundation licenses this file to you under the MIT license. 
33
4- using  Microsoft . DotNet . Cli . Sln . Internal ; 
54using  Microsoft . DotNet . Tools ; 
65using  Microsoft . DotNet . Tools . Common ; 
76using  Microsoft . VisualStudio . SolutionPersistence ; 
@@ -286,8 +285,9 @@ public async Task WhenDuplicateReferencesArePresentItRemovesThemAll(string solut
286285                . Path ; 
287286
288287            var  solutionPath  =  Path . Combine ( projectDirectory ,  "App.sln" ) ; 
289-             SlnFile  slnFile  =  SlnFile . Read ( solutionPath ) ; 
290-             slnFile . Projects . Count . Should ( ) . Be ( 3 ) ; 
288+             ISolutionSerializer  serializer  =  SolutionSerializers . GetSerializerByMoniker ( solutionPath ) ; 
289+             SolutionModel  solution  =  await  serializer . OpenAsync ( solutionPath ,  CancellationToken . None ) ; 
290+             solution . SolutionProjects . Count . Should ( ) . Be ( 3 ) ; 
291291
292292            var  projectToRemove  =  Path . Combine ( "Lib" ,  "Lib.csproj" ) ; 
293293            var  cmd  =  new  DotnetCommand ( Log ) 
@@ -299,8 +299,7 @@ public async Task WhenDuplicateReferencesArePresentItRemovesThemAll(string solut
299299            outputText  +=  Environment . NewLine  +  outputText ; 
300300            cmd . StdOut . Should ( ) . BeVisuallyEquivalentTo ( outputText ) ; 
301301
302-             ISolutionSerializer  serializer  =  SolutionSerializers . GetSerializerByMoniker ( solutionPath ) ; 
303-             SolutionModel  solution  =  await  serializer . OpenAsync ( solutionPath ,  CancellationToken . None ) ; 
302+             solution  =  await  serializer . OpenAsync ( solutionPath ,  CancellationToken . None ) ; 
304303            solution . SolutionProjects . Count . Should ( ) . Be ( 1 ) ; 
305304            solution . SolutionProjects . Single ( ) . FilePath . Should ( ) . Be ( Path . Combine ( "App" ,  "App.csproj" ) ) ; 
306305        } 
0 commit comments