where to find xsd.exe in visual studio 2013 on win

2019-01-06 19:14发布

问题:

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 now needs to be downloaded but from where. I am running 64 bit Windows 8 pro and Visual Studio 2013 Ultimate.

回答1:

Once you have the SDK installed * (either Manually, or with Visual Studio), you'll find it in the following directories:

SDK 8 and later

There is an an additional FX version subdirectory:

%programfiles(x86)%\Microsoft SDKs\Windows\{ver}\bin\{FXVer} Tools

Where

  • {ver} is the SDK version (e.g. v8.1A)
  • and {FXVer} is the applicable .Net Framework version, e.g. NETFX 4.0v

e.g.

C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A\bin\NETFX 4.5.1 Tools
C:\Program Files (x86)\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.6.1 Tools 

SDK 7 and lower

%programfiles(x86)%\Microsoft SDKs\Windows\{ver}\Bin\

Where {ver} is the SDK version (e.g. v7.0A)

On a 32 bit O/S, replace %programfiles(x86)% with %programfiles%

* Wikipedia maintains a fairly recent set of download links to the various SDK versions - scroll to the bottom of the table for recent ones.



回答2:

This is part of the Windows SDK. I know that you can download the Windows 7 SDK for .NET 4.0 and the files will be installed and will be fully functional on Windows 8. (It is installed in C:\Program Files (x86)\Microsoft SDKs\Windows\?version?\bin\NETFX 4.0 Tools where version will be OS version like v8 or similar)

http://www.microsoft.com/en-us/download/details.aspx?id=8279

You may also find the xsd application as part of the full SDK.

For Windows 8: http://msdn.microsoft.com/en-us/windows/desktop/hh852363.aspx
For Windows 8.1: http://msdn.microsoft.com/en-us/windows/desktop/bg162891.aspx

Also if you are so inclined to use other works, at Codeplex there is a nice alternative to xsd.exe: http://xsd2code.codeplex.com/



回答3:

If you have Visual Studio installed, then you may locate Developer Command Prompt (it is a shortcut in Start menu, or it should be available from VS IDE). A cmd window opens and you are able to run xsd.exe from it.



回答4:

Someone has posted a zip file with xsd.exe (from 2011) and xsd.exe.config on his personal web site:

(https://juliankay.com/development/download-xsd-exe/).

Download of the zipfile worked for me in 03/2017 .

Output (on Linux, with Mono Support built into the kernel):

/home/knut/bin/xsd.exe /?
WARNING: The runtime version supported by this application is unavailable.
Using default runtime: v4.0.30319
Microsoft (R) Xml Schemas/DataTypes support utility
[Microsoft (R) .NET Framework, Version 2.0.50727.3038]
Copyright (C) Microsoft Corporation. All rights reserved.

xsd.exe -
    Utility to generate schema or class files from given source.