punker76
punker76

Reputation: 14611

Why starts xsd execution in msbuild Visual Studio?

I have the following execution task in my msbuild.xml

<Target Name="XSD">
  <ItemGroup>
    <XSDEXE Include="lib\xsd\xsd.exe" />
  </ItemGroup>
  <Exec Command="$(XSDEXE) path2myXSD\mySpecial.xsd /o:outPutPath /c /n:mySpecialNamespace" />
</Target>

If I execute this with

MSBuild.exe msbuild.xml /target:XSD

the Visual Studio starts with the xsd in design mode.

WHY ?

Upvotes: 0

Views: 123

Answers (1)

Nicodemeus
Nicodemeus

Reputation: 4083

Because $(XSDEXE) references a property rather than an ItemGroup, so when you execute that task, you're passing this command line:

path2myXSD\mySpecial.xsd /o:outPutPath /c /n:mySpecialNamespace

To resolve this, change the ItemGroup to a PropertyGroup like so:

<PropertyGroup>
    <XSDEXE>lib\xsd\xsd.exe</XSDEXE>
</PropertyGroup>

For extra credit, make a diagnostic log allowing you to quickly diagnose the problem.

msbuild.exe <your arguments> /fl5 /flp5:Verbosity=diag;logfile=msbuild.log

Upvotes: 1

Related Questions