xsd.exe

I can't find xsd.exe in Visual Studio 2008?

假装没事ソ 提交于 2019-11-27 14:35:07
问题 In Visual Studio 2005 the XSD compiler was in the SDK/v2.0 directory. In Visual Studio there is only a SDK/v3.5 directory has gone and so too has the xsd.exe compiler. Where has it gone? 回答1: Not being completely happy with the above answers I have found that the SDK containing amongst other things the XSD.exe compiler is distributed now as part of the Windows SDK. See http://msdn.microsoft.com/en-gb/windows/bb980924.aspx?wt.svl=more_downloads It is distributed as part of the Visual Studio

xmlserializer validation

坚强是说给别人听的谎言 提交于 2019-11-27 09:05:45
I'm using XmlSerializer to deserialize Xml achives. But I found the class xsd.exe generated only offers capability to read the xml, but no validation. For example, if one node is missing in a document, the attribute field of the generated class will be null, rather than throws a validation exception as I expected. How can I achieve that? Thanks! The following code should validate against a schema while deserializing. Similar code can be used to validate against a schema while serializing. private static Response DeserializeAndValidate(string tempFileName) { XmlSchemaSet schemas = new

Programmatically use XSD.exe tool feature (generate class from XSD Schema) through .NET Framework classes?

ぃ、小莉子 提交于 2019-11-27 06:49:00
问题 I want to generate a class from an XML XSD Schema, just as you can do with the Xsd.exe tool. E.g. XSD.exe /namespace:Generated.Xsd_1 /classes /outputdir:..\Classes Is there a way to do this by using classes in the .NET Framework instead of using the standalone tool? 回答1: Shamelessly borrowed from here: using System; using System.IO; using System.Collections.Generic; using System.Reflection; using System.Text; using System.Xml; using System.Xml.Serialization; using System.Xml.Schema; using

What is the correct way of using the Guid type in a XSD file?

霸气de小男生 提交于 2019-11-27 04:27:50
问题 I have a .xsd file which I use to generate code with the xsd.exe tool from Visual Studio. Some class members are Guids and the xsd.exe tool gives 2 warnings: Namespace 'http://microsoft.com/wsdl/types/' is not available to be referenced in this schema. Type 'http://microsoft.com/wsdl/types/:guid' is not declared. The Guid type is recognized because the generated C# file is valid and works. Anyone knows how to get rid of those warnings? What is the correct syntax for the XSD to be validated

How to read XML into a class/classes that matches its xsd

萝らか妹 提交于 2019-11-27 02:14:05
问题 So I have an XSD and a webservice that delivers in that same format. Now I could go ahead and read the xml into a document, create my objects from the class etc... But I am thinking, there must be some easier way to do that. Am I right? ;) Yahoo Maps GeocodeResponse XSD Yahoo Maps GeocodeResponse sample <ResultSet xsi:schemaLocation="urn:yahoo:maps http://api.local.yahoo.com/MapsService/V1/GeocodeResponse.xsd"> <Result precision="address"> <Latitude>47.643727</Latitude> <Longitude>-122.130474

Tool that can combine many XSD files into one?

不羁的心 提交于 2019-11-27 01:39:46
问题 I need to create XML serializer classes for approximately 65 XSD files, for which I am using Microsoft's XSD.EXE to generate the C# code... However, I keep running into Window CMD's character limit in the resulting output file (in which XSD.EXE combines the name of every XSD included): "The specified path, file name, or both are too long. The fully qualified file name must be less than 260 characters, and the directory name must be less than 248 characters." To make a long story short, it

How to create a XSD schema from a class?

亡梦爱人 提交于 2019-11-26 19:37:02
I'm having a hard time with the XSD files. I'm trying to create an XSD file from a class: public enum Levels { Easy, Medium, Hard } public sealed class Configuration { public string Name { get;set; } public Levels Level { get; set; } public ConfigurationSpec { get;set;} } public abstract class ConfigurationSpec { } public class ConfigurationSpec1 { // ... } public class ConfigurationSpec2 { // ... } Please note that I have an abstract class inside of Configuration. With that feature, is it possible to create the XSD and if it's possible how? The idea is to pass the class Configuration to the

xmlserializer validation

余生颓废 提交于 2019-11-26 14:32:32
问题 I'm using XmlSerializer to deserialize Xml achives. But I found the class xsd.exe generated only offers capability to read the xml, but no validation. For example, if one node is missing in a document, the attribute field of the generated class will be null, rather than throws a validation exception as I expected. How can I achieve that? Thanks! 回答1: The following code should validate against a schema while deserializing. Similar code can be used to validate against a schema while serializing

where to find xsd.exe in visual studio 2013 on windows 8

余生颓废 提交于 2019-11-26 09:46:46
问题 I have used the xsd.exe utility in Visual Studio 2003 and 2008 to generate typed datasets from a 3rd party XSD file. The third party has changed their schema so I need to regenerate the datasets but I can\'t find XSD.EXE . The win8 search gives me information about the utility but not where it is, I tried a search in Windows explorer and didn\'t get any results. I read posts regarding Win7/VS 2008 that say it is part of the WinSDK but I can\'t find it in that folder either. Some poster say it