Pregunta

I was trying to explore some ASP.NET-5 applications where I found the startup.cs file. Where we set out routing and all (of course not only for routing). I also see some demo where has shown the use of dependency injection here. So, I'm looking for answers to the below questions:

  1. Why this startup.cs is? What it does?
  2. What are the uses of this file?
  3. What is the advantages of this?

And is there any good documentation to know the use of startup.cs in details. And why the application does not work if we change the class name 'Startup' to something else?

I do have very elementary idea about OWIN and pipeline. Please help me to find these answers.

¿Fue útil?

Solución

Just repeating here what it's said in Getting started with vNext

By default, the vNext hosting environment expects to find a startup class named Startup. This class must contain a Configure method that takes an IBuilder parameter, and you configure the HTTP pipeline inside this Configure method. The empty project creates the class with nothing in the Configure method.

I would recommend you to take a look on vNext Moving Parts by Louis Dejardin since it explains a bit more about OWIN pipeline and vNext.

Sorry for not being of much help!

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top