C# • Create a Project File

Listing 1. The project file defines how to build the application. You need to put this and related files in a directory, then open a Longhorn SDK command prompt, navigate to the directory containing your files, and run MSBuild. This compiles your program into an executable.

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

   <!--Imports the target which contains all the       common targets-->
   <Import Project="$(LAPI)\WindowsApplication.target" />

   <ItemGroup>
      <!-- Application markup -->
         <Item 
         Type="ApplicationDefinition" 
         Include="HelloWorldApplication.xaml" />
   
      <!-- Compiled Xaml Files list -->
      <Item Type="Pages" Include="HelloWorld.xaml"/>
   </ItemGroup>
</Project>