How to debug and hit breakpoints in Umbraco Razor ...
# help-with-umbraco
a
I am trying to debug razor view pages in umbraco and I can't find the process to attach to using Visual Studio 2022 Community IIS and Google Chrome .NET Core 7 and Umbraco 13, anyone got any advice?
a
When using IIS u can usually attach to the w3wp process
u
Remember to run Visual Studio as an Administrator so it can see the process
a
It sees the process without it though, but will notify it needs to be in administrator mode to actually connect πŸ™‚
u
My shortcut to VS is always set to Run as Admin so I don't have to restart VS in order to attach to IIS as that's such a pain. Probably doing it less now as I'm using IIS less locally for modern sites.
and I have set it to run as administrator
a
Do you have a checkbox with, 'show all processes' ?
and ofc, is your site running ? πŸ™‚
a
hi, yes it is running and I have show all processes checked, thanks for the help so far πŸ™‚
@Ambert any ideas on this? I still have this issue and w3wp is nowhere to be seen 😦
a
Is your website started in IIs?
s
Make sure after deploying to your local IIS folder you hit a page. IIS doesn't spin a site up until it needs to (or feels like it).
a
Apologies guys, I have been starting it up through IIS Express through visual studio, I haven't explicitly been deploying it to my local IIS
p
@User May I suggest β€œpeople” instead of "guys"? We use gender inclusive language in this Discord. πŸ˜€
a
thanks for the help, I'll try this out!
s
Check your build is a Debug build (first dropdown in the top menu buttons). You shouldn't need to attach to a process - just F5 - start with debugging should be enough. I have had this before - are the breakpoints a solid red or greyed out? I think it was a setting in VS in the end... google was my friend, sorry can't recall exactly what was turned off / on
a
For iis express you can just hit the debug button in visualstudio/rider, no attaching is necessary indeed
a
I see, I have enabled debug in the appsettings and am running the app in debug mode, the breakpoints are red when the code is valid and compiles, however I don't get any compiler errors when the code isn't valid, which is preventing me from debugging properly as it could be anything that is causing the errors
currently I am guessing as to what's causing the razor code not to compile
a
Is the code you are debugging inside of the project you started? πŸ˜…
a
yes, I guess I'm answering the question for myself xD I forget Razor is compiled code so all I need to do is restart the project lol
a
Haha!
a
thanks for the help!
a
Anytime!
9 Views