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

Update the sample #23

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open

Update the sample #23

wants to merge 5 commits into from

Conversation

mlaily
Copy link

@mlaily mlaily commented Nov 16, 2021

I wanted to test the feasibility of Razor views in an F# web project, but I realized with this sample that multiple things do not work out of the box.
Since I spent a few hours on this, here are some improvements so others don't have to go through the same thing... :)

Summary of the changes (also see commit list):

  • Update to .NET 6.0 and F# 6
  • Extract the views to a C# project so we get full VS support in .cshtml files
    • This is probably the most controversial change of this PR. It seems Visual Studio does not completely support cshtml files in fsproj project, and the intellisense does not work. This considerably reduces the usefulness of Razor views.
    • It complexifies the sample a bit, but this seems like a more realistic usage and I think the tradeoff is worth it.
  • I didn't check whether Razor runtime compilation properly worked before (it might have been used instead of statically compiled views in release mode too, which is to be avoided), but I made sure it does work now.
  • Other minor fixes and improvements.

…l files

The models also had to move so they can be referenced both
by the views and the web project.
and another navigation link in the partial view
@SCullman SCullman mentioned this pull request Aug 21, 2022
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.

None yet

1 participant