question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Option to make PhysicalFileProvider case insensitive

See original GitHub issue

Is your feature request related to a problem? Please describe.

We currently host our .NET Core services on Windows servers, but would really like to move them to Linux Docker containers some time down the line. However, having the PhysicalFileProvider rely on how the underlying OS treats casing for files and directories puts this as risk as our services currently ignore file and directory casing as they are hosted on Windows, moving them to Linux could potentially break a lot of our applications.

Describe the solution you’d like

While simply doing everything in lower case is an option, I would rather have an option to enable case insensitivity.

Maybe something in the lines on this

app.UseStaticFiles(new StaticFileOptions
{
    FileProvider = new PhysicalFileProvider("some path")
    {
        UseActivePolling = true,
        IgnoreCase = true
    }
});

Describe alternatives you’ve considered

As mentioned, while simply deciding to do everything lower case is an option, I would rather be able to ensure that there isn’t any issues like this in our future migration.

Additional context

None

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:3
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
XiaoFayecommented, Nov 17, 2019

@rasmus Hi, I have created a middleware which allows ignore case for static files, it might be able to help you. https://github.com/XiaoFaye/CaseInsensitiveStaticFile

0reactions
BrennanConroycommented, Oct 29, 2020

Similar/same thing tracked in https://github.com/dotnet/runtime/issues/35128. PhysicalFileProvider is not in this repo anymore.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Option to make PhysicalFileProvider case insensitive #2183
We currently host our .NET Core services on Windows servers, but would really like to move them to Linux Docker containers some time...
Read more >
Static files in ASP.NET Core
Learn how to serve and secure static files and configure static file hosting middleware behaviors in an ASP.NET Core web app.
Read more >
Are the configuration keys in asp.net core supposed to be ...
I just created a new Dictionary, I'm not sure if it's possible to make it case-insensitive without writing a lot more code.
Read more >
Working with Static Files - ASP.NET Core Documentation
The URLs for content exposed with UseDirectoryBrowser and UseStaticFiles are subject to the case sensitivity and character restrictions of their underlying file ...
Read more >
How to enable case-insensitive property name matching ...
Learn how to enable case-insensitive property name matching while serializing to and deserializing from JSON in .NET.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found