I have Microsoft.AspNet.StaticFiles
referenced in my project.json
, but the UseDefaultFiles()
and UseStaticFiles()
extensions are still not recognised.
The dependencies section of project.json
is:
"dependencies": {
"Microsoft.NETCore.App": {
"version": "1.0.0-rc2-3002702",
"type": "platform"
},
"Microsoft.AspNetCore.Server.IISIntegration": "1.0.0-rc2-final",
"Microsoft.AspNetCore.Server.Kestrel": "1.0.0-rc2-final",
"Microsoft.AspNet.StaticFiles": "1.0.0-rc1-final"
}
I can see the reference in the references section of the solution explorer. I can see in the Git repo that it lives in the Microsoft.AspNetCore.Builder
namespace, as does UseDefaultFiles()
but I just get a compile error:
IApplicationBuilder' does not contain a definition for 'UseDefaultFiles' and no extension method 'UseDefaultFiles' accepting a first argument of type 'IApplicationBuilder' could be found (are you missing a using directive or an assembly reference?)
I can, however, access the middleware directly without the extension methods:
app.UseMiddleware<StaticFileMiddleware>();
app.UseMiddleware<DefaultFilesMiddleware>();
is fine.
What's going on?