File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
test/AbpCompanyName.AbpProjectName.Web.Tests Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 4
4
using Abp . AspNetCore . TestBase ;
5
5
using Abp . Dependency ;
6
6
using AbpCompanyName . AbpProjectName . EntityFrameworkCore ;
7
+ using AbpCompanyName . AbpProjectName . Web . Controllers ;
7
8
using Castle . MicroKernel . Registration ;
8
9
using Microsoft . AspNetCore . Builder ;
9
10
using Microsoft . AspNetCore . Hosting ;
11
+ using Microsoft . AspNetCore . Mvc . ApplicationParts ;
10
12
using Microsoft . EntityFrameworkCore ;
11
13
using Microsoft . Extensions . DependencyInjection ;
12
14
using Microsoft . Extensions . Logging ;
@@ -19,10 +21,17 @@ public IServiceProvider ConfigureServices(IServiceCollection services)
19
21
{
20
22
services . AddEntityFrameworkInMemoryDatabase ( ) ;
21
23
22
- services . AddMvc ( options =>
24
+ var mvc = services . AddMvc ( options =>
23
25
{
24
26
options . AddAbp ( ) ; //Add ABP infrastructure to MVC
25
- } ) . AddControllersAsServices ( ) ;
27
+ } ) ;
28
+
29
+ //Workaround defined here: https://github.com/aspnet/Mvc/issues/4897#issuecomment-228093609
30
+ var parts = mvc . PartManager . ApplicationParts ;
31
+ parts . Clear ( ) ;
32
+ parts . Add ( new AssemblyPart ( typeof ( HomeController ) . Assembly ) ) ;
33
+
34
+ mvc . AddControllersAsServices ( ) ;
26
35
27
36
//Configure Abp and Dependency Injection
28
37
return services . AddAbp ( options =>
You can’t perform that action at this time.
0 commit comments