Skip to content

Commit f22d4b1

Browse files
committed
Update README.md
1 parent d814714 commit f22d4b1

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

README.md

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ These packages provide integration with ASP.NET Core and the built-in container
1212

1313
Adds integration with the ASP.NET Core hosting mechanism.
1414

15-
> :warning: For this integration package to work properly, you need version 1.1 of ASP.NET Core
16-
1715
### Installation
1816

1917
Add `StructureMap.AspNetCore` to your project:
@@ -36,20 +34,17 @@ using System.IO;
3634
using Microsoft.AspNetCore.Hosting;
3735
using StructureMap.AspNetCore;
3836

39-
public class Program
37+
public static class Program
4038
{
4139
public static void Main(string[] args)
4240
{
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();
5242
}
43+
44+
public static IWebHostBuilder CreateWebHostBuilder(string[] args) =>
45+
WebHost.CreateDefaultBuilder(args)
46+
.UseStructureMap() // Add support for StructureMap
47+
.UseStartup<Startup>();
5348
}
5449
```
5550

0 commit comments

Comments
 (0)