FAQ: Dependency Injection - Registering other services

This community-built FAQ covers the " Registering other services" exercise from the lesson “Dependency Injection”.

Paths and Courses
This exercise can be found in the following Codecademy content:

Build Web Apps with ASP.NET

FAQs on the exercise _ Registering other services_

There are currently no frequently asked questions associated with this exercise – that’s where you come in! You can contribute to this section by offering your own questions, answers, or clarifications on this exercise. Ask or answer a question by clicking reply (reply) below.

If you’ve had an “aha” moment about the concepts, formatting, syntax, or anything else with this exercise, consider sharing those insights! Teaching others and answering their questions is one of the best ways to learn and stay sharp.

Join the Discussion. Help a fellow learner on their journey.

Ask or answer a question about this exercise by clicking reply (reply) below!
You can also find further discussion and get answers to your questions over in Language Help.

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources? Head to Language Help and Tips and Resources. If you are wanting feedback or inspiration for a project, check out Projects.

Looking for motivation to keep learning? Join our wider discussions in Community

Learn more about how to use this guide.

Found a bug? Report it online, or post in Bug Reporting

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!

Hello. On step 2(it has a bug) on this exercise it says for us to…

Access the IStringGenerator service in IndexModel.cshtml.cs :

  • Declare a private readonly field of type IStringGenerator .
  • Add an IStringGenerator parameter to the constructor.
  • In the constructor body, store the parameter’s value in your new field.

Then, when codecademy marked it as wrong, it turned out they wanted us to do another thing as well, which is modify the OnGet() method in the IndexModel class (by the way, in Index.cshtml.cs)

1 Like

2023 and still not fixed.

Soon its 2024 and it’s… still not fixed.

Its incredible that CodeCademy completely ignores how awful this Skill Path functions… People have paid to enroll in these learning environments…