Developer forum

Forum » Development » How to Debug Razor code in templates?

How to Debug Razor code in templates?

Davor Zlotrg
Reply

Hi DynamicWeb,

Is there a way to Debug Razor code in templates? 

I tried to Attach to proccess (w3wp) but with no success (this was working for template extenders).

Thanks,


Replies

 
Mikkel Ricky
Reply

Dynamicweb is using RazorEngine to process Razor templates and currently it doesn't support debugging directly in Visual Studio. However, some work has been done to make debugging work (see https://github.com/Antaris/RazorEngine/pull/131/), but we haven't looked into this yet.

Best regards,
Mikkel

 
Kim Søjborg Pedersen
Reply

any news about the possibility to debug in razor templates?

 
Nicolai Høeg Pedersen
Reply

No, that is still not possible.

 
Mikkel Ulstrup
Reply

Sorry for Necroposting! :)

 

Any news on this issue?

 
Nicolai Pedersen
Reply

Hi Mikkel

You can just do it using VS debugging.

  1. Start Visual Studio as an administrator (right click the icon "Run as administrator")
  2. Open your Visual Studio web project
  3. Go to debug, Attach to process
  4. Choose you local iis instance and attach the debugger
  5. Debug...

See dumps.

Screenshot_2021-01-13_103821.JPG Screenshot_2021-01-13_103921.JPG Screenshot_2021-01-13_104615.JPG
 
Nicolai Pedersen
Reply

Got it working?

 

You must be logged in to post in the forum