Creating C# Class from an XML file

by Brad 25. February 2008 09:16
If you've existing XML files that you need to manipulate in C# there is no need to write your own class by hand. Visual Studio ships with a little known tool XSD.exe which will do all the leg work for you. Step 1 (from a command prompt): This will create an XSD based on the XML file, which in step 2 will allow the tool to create the C# class(s) XSD.exe [XML_FILE] Step 2 (from a command prompt): Call the tool again, this time providing the newly created .xsd file, along with /c (for classes, you could use /d for a dataset) and /n for your project's namespace XSD.exe [XSD_F... [More]

Tags:

C# | Microsoft Visual Studio

Visual Studio: Commenting Code

by Brad 17. January 2008 14:31
Who hates trying to work out what a complex C# method does that you didn't write? I know I do! Now who also hates writing the aforementioned comments... yep me too again! Along comes GhostDoc... a nice little plug-in for Visual Studio that automatically generates XML comments for your C# code! All you need to do is hit the hot key (which you can define) or right click and choose "Comment this..." and bingo a method or property you had selected now has a comment. GhostDoc uses some clever behind the scenes code based on the name of the method/property and the data types involved to make a "best... [More]

Tags:

Microsoft Visual Studio

Debugging Web Applications... Quicker!

by Brad 14. January 2008 09:44
It's always frustrated me that Visual Studio takes so long to start debugging web applications compared to a standard windows form application. Also when you stop debugging it would kill the spawned IE window too - annoying if you were in the middle of testing something... Anyway I often found it was better to launch my own version of IE (so it remains open) then in Visual Studio select Debug > attach to process > then select the WebDeb.WebServer.EXE process(s). This was much quicker than clicking the standard "start debugging" button (or F5). But even that wasn't enough - it still annoy... [More]

Tags:

C# | Microsoft Visual Studio

Powered by BlogEngine.NET 1.5.0.7
Theme by Interakting

Interakting

A full service digital agency offering online strategy, design and usability, systems integration and online marketing services that deliver real business benefits and ensure your online objectives are met.

Calendar

<<  March 2010  >>
MoTuWeThFrSaSu
22232425262728
1234567
891011121314
15161718192021
22232425262728
2930311234

View posts in large calendar