Last active
March 4, 2016 10:26
-
-
Save jzi96/0a472e838e64bfb7498b to your computer and use it in GitHub Desktop.
Ideas and snippet for MsBuild fiiles - Propertygroup and task to convert xsd to cs before build
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--Propertygroup and task to convert xsd to cs before build | |
Item must have Property MyXsd | |
--> | |
<None Include="Configuration\Parameter.xsd"> | |
<SubType>Designer</SubType> | |
<MyXsd>Custom</MyXsd> | |
</None> | |
<PropertyGroup> | |
<WIN_SDK_PATH>$(Registry:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SDKs\Windows@CurrentInstallFolder)</WIN_SDK_PATH> | |
<WIN_SDK_BIN_PATH>$(WIN_SDK_PATH)\bin</WIN_SDK_BIN_PATH> | |
<SVCUTIL>"$(WIN_SDK_BIN_PATH)\svcutil.exe"</SVCUTIL> | |
<XSD>"$(WIN_SDK_BIN_PATH)\xsd.exe"</XSD> | |
</PropertyGroup> | |
<Target Name="BeforeBuild"> | |
<Exec Outputs="Configuration" Command="$(XSD) /classes /n:MyNS.Configuration /out:Configuration /nologo @(None->'%(fullpath)', ' ')" Condition="'%(None.MyXsd)'=='Custom'" /> | |
</Target> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment