Skip to content

Commit 8566f26

Browse files
Chris Martinezcommonsensesoftware
authored andcommitted
Remove MVC UI compilation setup for tests; it's no longer needed
1 parent 70675d7 commit 8566f26

File tree

1 file changed

+0
-28
lines changed
  • test/Microsoft.AspNetCore.Mvc.Acceptance.Tests/Mvc/Basic

1 file changed

+0
-28
lines changed
Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,7 @@
11
namespace Microsoft.AspNetCore.Mvc.Basic
22
{
33
using Microsoft.AspNetCore.Mvc.ApplicationParts;
4-
using Microsoft.AspNetCore.Mvc.Razor;
54
using Microsoft.AspNetCore.Mvc.Versioning;
6-
using Microsoft.Extensions.DependencyInjection;
7-
using System.Linq;
8-
using System.Reflection;
9-
using static Microsoft.CodeAnalysis.MetadataReference;
10-
using static System.Reflection.Assembly;
115

126
public class UIFixture : HttpServerFixture
137
{
@@ -18,27 +12,5 @@ protected override void OnConfigurePartManager( ApplicationPartManager partManag
1812
partManager.FeatureProviders.Add( (IApplicationFeatureProvider) FilteredControllerTypes );
1913
partManager.ApplicationParts.Add( new AssemblyPart( GetType().Assembly ) );
2014
}
21-
22-
protected override void OnConfigureServices( IServiceCollection services )
23-
{
24-
services.Configure<RazorViewEngineOptions>( options =>
25-
{
26-
options.CompilationCallback += context =>
27-
{
28-
var assembly = GetType().GetTypeInfo().Assembly;
29-
var assemblies = assembly.GetReferencedAssemblies().Select( x => CreateFromFile( Load( x ).Location ) ).ToList();
30-
31-
assemblies.Add( CreateFromFile( Load( new AssemblyName( "mscorlib" ) ).Location ) );
32-
#if NET461
33-
assemblies.Add( CreateFromFile( Load( new AssemblyName( "netstandard" ) ).Location ) );
34-
#else
35-
assemblies.Add( CreateFromFile( Load( new AssemblyName( "System.Private.Corelib" ) ).Location ) );
36-
#endif
37-
assemblies.Add( CreateFromFile( Load( new AssemblyName( "System.Dynamic.Runtime" ) ).Location ) );
38-
assemblies.Add( CreateFromFile( Load( new AssemblyName( "Microsoft.AspNetCore.Razor" ) ).Location ) );
39-
context.Compilation = context.Compilation.AddReferences( assemblies );
40-
};
41-
} );
42-
}
4315
}
4416
}

0 commit comments

Comments
 (0)