Skip to content

Another incomplete Microsoft Learn example #46997

Open
@1podProgrammer

Description

@1podProgrammer

Type of issue

Missing information

Description

From the learn page "The sample code registers the IMessageWriter service with the concrete type MessageWriter. The AddSingleton method registers the service with a singleton lifetime, the lifetime of the app. Service lifetimes are described later in this article."

[Enter feedback here]
However, it is not clear as to where this service is added. Does the registration take place in App.xaml, App.xaml.cs, MainWindow.xaml, MainWindow.xaml.cs or other class, module or assembly.

Consider the audience as knowing absolutely nothing about this subject and guide that audience on how to achieve that goal - learning.
Provide a fully completed example which can be compiled and executed.

Anything less is a complete waste of web space which requires the reader to step away from this page and dig through billions of web pages with little or no success of discovering exactly what to do.

Page URL

https://learn.microsoft.com/en-us/dotnet/core/extensions/dependency-injection

Content source URL

https://github.com/dotnet/docs/blob/main/docs/core/extensions/dependency-injection.md

Document Version Independent Id

cc5f00d0-fb50-1229-8fa2-e66b1f45b284

Platform Id

7f5b5732-fc3e-6ffb-b8b8-77b5659a8015

Article author

@IEvangelist

Metadata

  • ID: 8fd55089-b683-2202-6641-c7b61a132f14
  • PlatformId: 7f5b5732-fc3e-6ffb-b8b8-77b5659a8015
  • Service: dotnet-fundamentals

Related Issues

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions