Knowledge Management Banner

Knowledge Management Banner

Create c# class from xsd file


Why the creation of c# class from xsd file is required.
  • This type of requirement generally occurs when there is implementations of service.
  • The service provider will give you sample xml or xsd file in order to develop service for it, to collect or receive data.
  • Syntax :
  • xsd.exe XSD PATH /classes /language:CS /namespace:Your Namespace /out:Output Directory

  • Consider example below.
  • Suppose your xsd file is stored on desktop and you also want your output c# class file to be generated on dektop
  • Open your command prompt as administrator
  • Navigate your cmd path to path where xsd.exe is present, generally it is present in :- C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Bin>
  • Use following cmd
  • xsd.exe C:\Users\Amol\Desktop\purchase.xsd /classes /language:CS /namespace:MyProject.Purchase /out:C:\Users\Amol\Desktop




No comments

Powered by Blogger.