Skip to content

Commit 440a46b

Browse files
Fix the README.md to call the AddServiceCollection() in the Application_Start() method instead the constructor.
1 parent 378d2a1 commit 440a46b

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

README.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,15 @@ Install-Package PosInformatique.AspNet.WebForms.DependencyInjection
1111

1212
## Setting up
1313
After adding the **PosInformatique.AspNet.WebForms.DependencyInjection** package on your ASP .NET
14-
WebForms project call the `AddServiceCollection` the following lines in the constructor of your `HttpApplication` class in the
14+
WebForms project call the `AddServiceCollection` the following lines in the ``Application_Start`` of your `HttpApplication` class in the
1515
`Global.asax.cs` code behind:
1616
```csharp
1717
public class Global : HttpApplication
1818
{
19-
public Global()
19+
protected void Application_Start(Object sender, EventArgs e)
2020
{
2121
ServicesConfig.RegisterServices(this.AddServiceCollection());
22-
}
2322

24-
void Application_Start(object sender, EventArgs e)
25-
{
2623
// Code that runs on application startup
2724
RouteConfig.RegisterRoutes(RouteTable.Routes);
2825
BundleConfig.RegisterBundles(BundleTable.Bundles);

0 commit comments

Comments
 (0)