@@ -42,9 +42,6 @@ static readonly IReadOnlyDictionary<string, object> _emptyParametersDictionary
4242
4343 private bool _onNavigateCalled ;
4444
45- [ DynamicallyAccessedMembers ( LinkerFlags . Component ) ]
46- private Type ? _notFoundLayoutType ;
47-
4845 [ Inject ] private NavigationManager NavigationManager { get ; set ; }
4946
5047 [ Inject ] private INavigationInterception NavigationInterception { get ; set ; }
@@ -157,11 +154,7 @@ public async Task SetParametersAsync(ParameterView parameters)
157154 if ( routeAttributes . Length == 0 )
158155 {
159156 throw new InvalidOperationException ( $ "The type { NotFoundPage . FullName } " +
160- $ "does not have a { typeof ( RouteAttribute ) . FullName } applied to it.") ;
161- }
162-
163- var layoutAttr = NotFoundPage . GetTypeInfo ( ) . GetCustomAttribute < LayoutAttribute > ( ) ;
164- _notFoundLayoutType = layoutAttr ? . LayoutType ;
157+ $ "does not have a { typeof ( RouteAttribu
165158 }
166159
167160 if ( ! _onNavigateCalled)
@@ -401,10 +394,6 @@ private void RenderNotFound()
401394 builder . OpenComponent < RouteView > ( 0 ) ;
402395 builder . AddAttribute ( 1 , nameof ( RouteView . RouteData ) ,
403396 new RouteData ( NotFoundPage , _emptyParametersDictionary ) ) ;
404- if ( _notFoundLayoutType is Type layoutType )
405- {
406- builder . AddAttribute ( 2 , nameof ( RouteView . DefaultLayout ) , layoutType ) ;
407- }
408397 builder . CloseComponent ( ) ;
409398 }
410399 else if ( NotFound != null )
0 commit comments