C# • Build a Longhorn EXE

Listing 2. All project files begin with a root element definition named Project. Its DefaultTargets attribute specifies the names of the targets that the system should build when you don't otherwise specify a target. This example specifies that the system should build the target named Build by default. Build rules can execute conditionally based on property values.

<Project DefaultTargets="Build">
   <PropertyGroup>
      <Property Language="C#" />
      <Property DefaultClrNameSpace=
         "IntroLonghorn" />
      <Property TargetName="MyApp" />
   </PropertyGroup>

   <Import Project=
      "$(LAPI)\WindowsApplication.target" />

   <ItemGroup>
      <Item Type="ApplicationDefinition" 
         Include="MyApp.xaml" />

      <Item Type="Pages" 
         Include="HomePage.xaml" />
      <Item Type="Pages" 
         Include="DetailPage.xaml" />
      <Item Type="Code" 
         Include="DetailPage.xaml.cs"/>

      <Item Type="DependentProjects" 
         Include=
         "MyDependentAssembly.proj" /> 

      <Item Type="Components" 
         Include="SomeThirdParty.dll" />

      <Item Type="Resources" 
         Include="Picture1.jpg"
         FileStorage="embedded" 
            Localizable="False"/>
      <Item Type="Resources" 
         Include="Picture2.jpg"
         FileStorage="embedded" 
            Localizable="True"/>
   </ItemGroup>
</Project>