SJ Alex
SJ Alex

Reputation: 159

Generate C# Class with svcutil.exe against xsd using External tools in VS 2012

I have created a C# Data Contract class against XSD and used my WCF service. And I have setup the xsd.exe using Visual Studio External Tools like below,

Use bat file with:

call "C:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\Tools\VsDevCmd.bat"

xsd %1 %2 /classes /language:CS

and then used bat file in external tools.

Title : XSD
Command :C:\Tools\bin\xsd.bat
Arguments : "$(ItemPath)" "/outputdir:$(ProjectDir)"

to this setup I am getting a class file in my project directory.

So, My question is how to set up same kind of external tools in visual studio for SVCUTIL.EXE tool.

please suggest the better ways of doing..

I am having a XSD file and I need pure Data Contract c sharp class for this.

I have tried SVCutil.exe tool in command line option.

svcutil.exe "E:\Test.xsd" /dconly

Getting this error: Error: Type 'LoadReference' in namespace '' cannot be imported. Complex types with simple content extension are not supported. Either change the schema so that the types can map to data contract types or use ImportXmlType or use a different serializer.

It seems like this tool not supporting complex types.

Thanks in advance...

Upvotes: 0

Views: 2669

Answers (0)

Related Questions