Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

changing view name to match file casing in minimal api sample #626

Merged

Conversation

AlexGirardDev
Copy link
Contributor

@AlexGirardDev AlexGirardDev commented Feb 1, 2024

fix for #625

@AlexGirardDev
Copy link
Contributor Author

the other solution to this would have been to make this ignore file name casing when looking for files but just updating the view name seemed simpler

@sebastienros
Copy link
Owner

I checked the other files, and I see that _layout.liquid is referenced using _Layout, so it shouldn't work either. Can you confirm?

@sebastienros
Copy link
Owner

I kind of like the PascalCasing of files, if you do too then let's use that solution instead. If you don't then I'll agree with your changes.

@AlexGirardDev
Copy link
Contributor Author

good point, i just checked and layout is'nt being loaded at all because the viewstart is not being loaded.
its file name is coming from here which seems to be used by the renderer so i wonder if its just easier to proper case all the luiqud files

@sebastienros
Copy link
Owner

Looks like we have to then, good catch.

@sebastienros
Copy link
Owner

I wonder is ASP.NET is also forcing Viewstart files to follow this case on Linux.

@sebastienros sebastienros enabled auto-merge (squash) February 1, 2024 17:58
@sebastienros sebastienros merged commit d88969f into sebastienros:main Feb 1, 2024
1 check passed
@AlexGirardDev
Copy link
Contributor Author

i was curious and it just seemms like there file names are just completly case insensitive ASP.NET

i just started renaming these and everything worked as expected
image

they all did start as proper case though

@sebastienros
Copy link
Owner

I assume you tried this on Linux? (I would think so since this is how you found about this issue)

@AlexGirardDev
Copy link
Contributor Author

Ya, everything has been on linux with Rider.

I think views and more specfically _ViewStart being case sensitive could catch some people off gaurd and may be worth calling out in the docs. Especially if they are developing on windows and then deploying to linux through docker (which is pretty common nowadays i believe).

The test i did with ASP.NET was with compiled templates so i'm assuming this is how they get around the case sensitivity thing, they can just load all there templates into memory and access they view names while ignoring case through managed c# code.

But if your loading the files from disk at runtime, I think its tricker beacuse the native OS calls on a case sesenitve system won't let you access a file while ignoring case.

I was googling around a bit and found this issue on the dotnet runtime that is tangentually related
dotnet/runtime#91250

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants