When I try to make some configurations in Startup.cs I am not able to see some of the StaticFileExtensions.
public void Configure(IApplicationBuilder app, IHostingEnvironment env)
{
if (env.IsDevelopment())
{
app.UseDeveloperExceptionPage();
}
app.UseStaticFiles();
app.UseFileServer();
app.Run(async (context) => { await context.Response.WriteAsync("Hello!"); });
}
I am not able to invoke these methods. I am a former Windows user and now I am using JetBrains Rider on Macbook and therefore I am not able to host my project InProcess and I can understand that but I expected to be able to use all static file extension methods since they are necessary implementations.
As I understand from your comments above, since you are new on Rider you might have created an empty project. If so, be sure that the following reference is included in your project:
Microsoft.AspNetCore.StaticFiles
. If you already have it and still have an issue I suggest you clean the cache because I just checked an empty project and I only saw Microsoft.AspNetCore as installed. It sounds like a missing reference issue to me.
Open terminal from Rider (or command line in VS) and clean Nuget cache by this command:
dotnet nuget locals all --clear
You may need to restart Rider to see the changes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With