I want to know how to debug razor files present under scripting files folder in umbraco. When the scripting file contains any errors and when i click on the preview button on the page which is associated with the scripting file, i get an error as error loading razor script....., can any one please help me on how to debug razor files directly in umbraco.
There is not really any way you can debug in Umbraco so to speak. If you have Visual Studio you can attached to the W3 process. One way may be to add some
<h1> TEST </h1>
Then see what result you get back in the cshtml file :). Charlie
Thanks for the reply charles and at times i get an error like,"error loading razor script xyz.cshtml", so even if i use h1 or any other elements , i am not able to find where the error is located . And can u brief about attaching to W3 process as i am new to it.
Not sure what to say about w3wp service, maybe have a look for something about it. My post above will tell you how to create a Umbraco instance with IIS and then you can attach to that and debug using w3wP :). What does your code look like? Maybe i can help with that :). Charlie
Actually i am new to umbraco and working on with razor snippets. I created a simple razor snippet and at intial stages i was getting errors as mentioned above and luckily i was able to solve it. I thought it would be better if there is any specific way or tool to debug razor snippets so that in future it will not be a problem for me.
Debugging razor code in umbraco
Hi All,
I want to know how to debug razor files present under scripting files folder in umbraco. When the scripting file contains any errors and when i click on the preview button on the page which is associated with the scripting file, i get an error as error loading razor script....., can any one please help me on how to debug razor files directly in umbraco.
Thanks
yogesh
There is not really any way you can debug in Umbraco so to speak. If you have Visual Studio you can attached to the W3 process. One way may be to add some
<h1> TEST </h1>
Then see what result you get back in the cshtml file :). Charlie
Thanks for the reply charles and at times i get an error like,"error loading razor script xyz.cshtml", so even if i use h1 or any other elements , i am not able to find where the error is located . And can u brief about attaching to W3 process as i am new to it.
Thanks
yogesh
Have a look at: ttp://charlesafford.com/post/2013/04/16/Setting-Up-Umbraco-with-IIS
Not sure what to say about w3wp service, maybe have a look for something about it. My post above will tell you how to create a Umbraco instance with IIS and then you can attach to that and debug using w3wP :). What does your code look like? Maybe i can help with that :). Charlie
Actually i am new to umbraco and working on with razor snippets. I created a simple razor snippet and at intial stages i was getting errors as mentioned above and luckily i was able to solve it. I thought it would be better if there is any specific way or tool to debug razor snippets so that in future it will not be a problem for me.
I will have a look at the link mentioned by you.
Thanks yogesh
is working on a reply...