How to generate .xsd from .cs using xsd.exe?

I have a .cs file that contains a subclass of XTypedElement and IXMetaData. Microsoft has a tool that automatically generates XSD files from managed code, but it does not accept .cs files. It accepts only .exe, .dll, .xdr, .xml and .xsd files.

How to convert my .cs file to .xsd file with this tool?

+6
source share
1 answer

First you need to compile it into a dll or exe file, i.e. build .NET and then use it as input for xsd.exe

If you want to convert only a specific class, use the following command:

xsd bin\Release\MyAssembly.exe /type:The.FullName.Of.YourType 
+2
source

Source: https://habr.com/ru/post/915775/


All Articles