@@ -74,25 +74,8 @@ protected override Task<int> ExecuteCoreAsync()
74
74
return Task . FromResult ( ExitCodeFailure ) ;
75
75
}
76
76
77
- // Loading all of the extensions should succeed as the dependency checker will have already
78
- // loaded them.
79
- var extensions = new RazorExtension [ ExtensionNames . Values . Count ] ;
80
- string razorCompilerPath = null ;
81
- for ( var i = 0 ; i < ExtensionNames . Values . Count ; i ++ )
82
- {
83
- // If the extension is the Razor compiler, we'll use the referenced assembly (instead of the SDK one).
84
- // Otherwise the extension's ProvideRazorExtensionInitializerAttribute would be different from the AssemblyExtension's one,
85
- // hence the extension would not be loaded properly.
86
- razorCompilerPath ??= DiscoverCommand . GetRazorCompilerPath ( ) ;
87
- var assembly = string . Equals ( ExtensionFilePaths . Values [ i ] , razorCompilerPath , StringComparison . OrdinalIgnoreCase )
88
- ? typeof ( AssemblyExtension ) . Assembly
89
- : Parent . Loader . LoadFromPath ( ExtensionFilePaths . Values [ i ] ) ;
90
-
91
- extensions [ i ] = new AssemblyExtension ( ExtensionNames . Values [ i ] , assembly ) ;
92
- }
93
-
94
77
var version = RazorLanguageVersion . Parse ( Version . Value ( ) ) ;
95
- var configuration = RazorConfiguration . Create ( version , Configuration . Value ( ) , extensions ) ;
78
+ var configuration = new RazorConfiguration ( version , Configuration . Value ( ) , Extensions : [ ] ) ;
96
79
97
80
var sourceItems = GetSourceItems (
98
81
Sources . Values , Outputs . Values , RelativePaths . Values ,
@@ -203,6 +186,8 @@ private int ExecuteCore(
203
186
204
187
var engine = RazorProjectEngine . Create ( configuration , compositeFileSystem , b =>
205
188
{
189
+ b . RegisterExtensions ( ) ;
190
+
206
191
b . Features . Add ( new StaticTagHelperFeature ( ) { TagHelpers = tagHelpers , } ) ;
207
192
b . Features . Add ( new DefaultTypeNameFeature ( ) ) ;
208
193
0 commit comments