@@ -209,22 +209,6 @@ public DocumentationSet(
209209 . ToDictionary ( kv => kv . Item1 , kv => kv . Item2 )
210210 . ToFrozenDictionary ( ) ;
211211
212- // Validate cross-repo links in navigation
213-
214- try
215- {
216- NavigationCrossLinkValidator . ValidateNavigationCrossLinksAsync (
217- Tree ,
218- LinkResolver ,
219- ( msg ) => Context . EmitError ( Context . ConfigurationPath , msg )
220- ) . GetAwaiter ( ) . GetResult ( ) ;
221- }
222- catch ( Exception e )
223- {
224- // Log the error but don't fail the build
225- Context . EmitError ( Context . ConfigurationPath , $ "Error validating cross-links in navigation: { e . Message } ") ;
226- }
227-
228212 ValidateRedirectsExists ( ) ;
229213 }
230214
@@ -390,9 +374,27 @@ void ValidateExists(string from, string to, IReadOnlyDictionary<string, string?>
390374 return FlatMappedFiles . GetValueOrDefault ( relativePath ) ;
391375 }
392376
393- public async Task ResolveDirectoryTree ( Cancel ctx ) =>
377+ public async Task ResolveDirectoryTree ( Cancel ctx )
378+ {
394379 await Tree . Resolve ( ctx ) ;
395380
381+ // Validate cross-repo links in navigation
382+ try
383+ {
384+ await NavigationCrossLinkValidator . ValidateNavigationCrossLinksAsync (
385+ Tree ,
386+ LinkResolver ,
387+ ( msg ) => Context . EmitError ( Context . ConfigurationPath , msg ) ,
388+ ctx
389+ ) ;
390+ }
391+ catch ( Exception e )
392+ {
393+ // Log the error but don't fail the build
394+ Context . EmitError ( Context . ConfigurationPath , $ "Error validating cross-links in navigation: { e . Message } ") ;
395+ }
396+ }
397+
396398 private DocumentationFile CreateMarkDownFile ( IFileInfo file , BuildContext context )
397399 {
398400 var relativePath = Path . GetRelativePath ( SourceDirectory . FullName , file . FullName ) ;
0 commit comments