Can't get hot reload to work properly #17359
Unanswered
RemcoW2002
asked this question in
Q&A
Replies: 1 comment 2 replies
-
I never really use Liquid in templates, but when looking at OC code, this helps: https://marketplace.visualstudio.com/items?itemName=igorfle.VSLiquidSyntax This is basically all the Liquid support VS has. For hot reload, check out #15946 too. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I've been at this pretty much all afternoon so my brain is rather fried, apologies for any spelling mistakes or overlooking obvious solutions.
I come from VS Code so Visual Studio isn't really my ideal solution, I figured I just adapt to it but it seems there is no way to get syntax highlighting for liquid files? This is already my first question, is there no way to have syntax highlighting for Visual Studio on liquid files? How do you guys generally run a project, especially if it's based on liquid rather than razor, do you just accept you can't read white text, , launch it in VS Code instead and have none of the hot reload issues, or again, am I missing some very obvious point. Also again, I am a total Visual Studio noob so sincere apologies if the solution is obvious.
I decided to just use VS Code, I was given a project in which there were liquid files, it seems to be based on TheBlogTheme, the person providing me with this is on holiday, so I can't really ask them anytime soon, and just so you know my assignment was to figure out if Orchard CMS is a nice to use system. Particular figuring out how to easily convert to razor pages
So I made a new theme, and one of the first things I noticed in VS Code, is that hot reloading stopped working (it works for the liquid based theme which is connected to the same web app). After some research I found out that razor is different and was suggested to try out various packages or changes to the manifest.cs or csproj files and tried solutions/suggestions from here: #16504.
I Tried pretty much everything, all of them either crashed my app or didn't work, So I eventually moved to using 'dotnet watch'. This though crashes my app when I edit particular items, in VS Code it doesn't give me any errors, so I switched to Visual Studio
Though here I am running into the same issues, though hot reload is mostly working on my project, for certain parts not only does it not work, it crashes my build. Giving me the following error:
source\repos\Hijc2.OrchardCore\Hijc2.OrchardCore.sln(0,0,0,0): Cannot apply changes -- unexpected error: 'Unexpected null - file EditSession.cs line 699'. In particular it crashes when I try to apply any changes with hot reload to my MenuItemLink-ContentMenuItem.cshtml file. But it goes for all my menu related .cshtml files
If take the liquid files from the liquid solutions and bring them in my razor based theme, they work and I can update them and they hot reload, if I change just one of those files to a razor based version, then hot reload stops working and it breaks, so it's somehow a razor based problem but at the same time other razor files hot reload fine.
I've deleted all the obj and bin files in all folders of my project which did not solve my issue either. Though again it's limited to only a part of my website it's still very inconvenient especially as I am just learning about Orchard and Razor so constantly testing stuff and then having to rebuild each time is quite the pain in the ass.
Ideally I want my razor project to just work in vs code with hot reloading
Again I'm very sorry if the solution is obvious
Beta Was this translation helpful? Give feedback.
All reactions