If I call the middleware directly in my startup.cs
, e.g.:
public void Configure(IApplicationBuilder app)
{
app.UseMiddleware<StaticFileMiddleware>();
app.UseMiddleware<DefaultFilesMiddleware>();
}
Looking at the source on GitHub, this is exactly the code that the extension methods are calling. However, I'm getting a 500 error and a stack trace:
:(
Oops.
500 Internal Server Error
System.InvalidOperationException
The 'Invoke' method's first argument must be of type 'HttpContext'.
at Microsoft.AspNetCore.Builder.<>c__DisplayClass3_0.<UseMiddleware>b__0(RequestDelegate next)
at Microsoft.AspNetCore.Builder.Internal.ApplicationBuilder.Build()
at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()
Show raw exception details
System.InvalidOperationException: The 'Invoke' method's first argument must be of type 'HttpContext'.
at Microsoft.AspNetCore.Builder.UseMiddlewareExtensions.<>c__DisplayClass3_0.b__0(RequestDelegate next)
at Microsoft.AspNetCore.Builder.Internal.ApplicationBuilder.Build()
at Microsoft.AspNetCore.Hosting.Internal.WebHost.BuildApplication()
This might be related to my No Static Files Extensions are referable question.
Either way, I currently can't get a simple index.html
page to load successfully.
Any help?
Thanks