File tree 1 file changed +7
-12
lines changed 1 file changed +7
-12
lines changed Original file line number Diff line number Diff line change @@ -12,8 +12,6 @@ These packages provide integration with ASP.NET Core and the built-in container
12
12
13
13
Adds integration with the ASP.NET Core hosting mechanism.
14
14
15
- > :warning : For this integration package to work properly, you need version 1.1 of ASP.NET Core
16
-
17
15
### Installation
18
16
19
17
Add ` StructureMap.AspNetCore ` to your project:
@@ -36,20 +34,17 @@ using System.IO;
36
34
using Microsoft .AspNetCore .Hosting ;
37
35
using StructureMap .AspNetCore ;
38
36
39
- public class Program
37
+ public static class Program
40
38
{
41
39
public static void Main (string [] args )
42
40
{
43
- var host = new WebHostBuilder ()
44
- .UseContentRoot (Directory .GetCurrentDirectory ())
45
- .UseStartup <Startup >()
46
- .UseIISIntegration ()
47
- .UseStructureMap ()
48
- .UseKestrel ()
49
- .Build ();
50
-
51
- host .Run ();
41
+ CreateWebHostBuilder (args ).Build ().Run ();
52
42
}
43
+
44
+ public static IWebHostBuilder CreateWebHostBuilder (string [] args ) =>
45
+ WebHost .CreateDefaultBuilder (args )
46
+ .UseStructureMap () // Add support for StructureMap
47
+ .UseStartup <Startup >();
53
48
}
54
49
```
55
50
You can’t perform that action at this time.
0 commit comments