asp.net: output object properties to html
Does anyone know of a class or something that will display an object as HTML, so i can view al the properties and values of that object, and go deeper inside them?
Idealy i would like to get a web-page that looks like the popup-windows that you get in Visual Studio when you click an object while debugging. So if the object contains any arrays, i'd also like to see what's in them, and for all those objects inside i would also like to be able to go deeper into those objects.
T开发者_如何学Pythonhe reason i'm asking this, is that I can't debug my code locally (because it uses a web-service that will only run on the production), and I can't install Visual Studio on the production server, So i need to be able to actually debug on the production server. I can write my code locally though, and upload it to the production.
You can do what Oded said but its kinda dangerous because its exposing the internal workings of your application via a Web Page call.
If I were in your shoes the first thing I would do is figure out a way to get out of your Developmestuction environment
You can also try remote debugging as Paddy wrote but this can freeze up the environment for other users when your hit pause or hit a break point. (all threads freeze even the ones that aren't "yours")
Instead I would either add logging to the application or use debug diag to take snapshots and then inspect them via WinDBG. Note there is a steep learning curve for WinDBG
There is nothing built in.
You can use reflection to build up the list of members for an object (and query the values), and use that to build up HTML.
You could also look at remote debugging:
http://msdn.microsoft.com/en-us/library/bt727f1t(VS.71).aspx
精彩评论