1

I was playing with a project. And the following line piqued my interest where Startup is a custom class

Microsoft.Owin.Hosting.WebApp.Start<Startup>(url);

And when I examine the class Startup, I've found out that it did not inherit from any class or interface. And after that I looked into WebApp.Start and there was no constraints on TStartup. So in place of Startup on the above line of code, I can even write int and it compiles just fine. However in runtime it gives the following error:

"The following errors occurred while attempting to load the app.\r\n - No 'Configuration' method was found in class 'System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'.":""

So it requires a Configuration method which in fact exists in the original Startup class. Then my question is that why did they not use an interface with a Configuration method?

Nuri Tasdemir
  • 9,720
  • 3
  • 42
  • 67

0 Answers0